Skip to content

Conversation

@trns1997
Copy link
Contributor

@trns1997 trns1997 commented Sep 14, 2025

Note: Please adhere to Contributing Guidelines.

Summary

This PR introduces a new CI test for out-of-tree builds to prevent regressions in the make export workflow.
Specifically, it adds a test-oot-build.sh script that:

  • Builds NuttX using a selected configuration.
  • Runs make export to generate the export package.
  • Copies the nuttx-export to the oot build project.
  • Verifies that compilation and linking succeed.

Issue: #17016
Provides: apache/nuttx-apps#3185
Depends-on: #16976

Impact

  • Please fill in Impact section.

Testing

  • Please fill in Testing section.

@trns1997 trns1997 marked this pull request as draft September 14, 2025 14:02
@github-actions github-actions bot added Area: Tooling Board: arm Size: M The size of the change in this PR is medium labels Sep 14, 2025
@trns1997
Copy link
Contributor Author

I’ve added a hellocpp out-of-tree CMake project based on #16970 and a test-oot-build.sh script.

The script does the following:

  • Configures a board and builds NuttX.
  • Runs make export to generate the export tarball.
  • Copies and extracts the export package into the hellocpp folder.
  • Builds the out-of-tree CMake project to verify that compilation and linking succeed.

It currently works locally, but I’d like some guidance on CI integration:

  • Should I add a step in tools/testbuild.sh to call this script?
  • CI currently runs builds for all boards listed under tools/testlist/. Do we also want to run this out-of-tree export test for all boards, or should we select a single representative board/config to keep CI runtime reasonable?

Looking for feedback on where this test should live in the CI pipeline and which boards we should cover.

@trns1997
Copy link
Contributor Author

I’ve added a hellocpp out-of-tree CMake project based on #16970 and a test-oot-build.sh script.

The script does the following:

* Configures a board and builds NuttX.

* Runs make export to generate the export tarball.

* Copies and extracts the export package into the hellocpp folder.

* Builds the out-of-tree CMake project to verify that compilation and linking succeed.

It currently works locally, but I’d like some guidance on CI integration:

* Should I add a step in `tools/testbuild.sh` to call this script?

* CI currently runs builds for all boards listed under `tools/testlist/`. Do we also want to run this out-of-tree export test for all boards, or should we select a single representative board/config to keep CI runtime reasonable?

Looking for feedback on where this test should live in the CI pipeline and which boards we should cover.

ping @leducp i would like your input on this plz :)

@raiden00pl
Copy link
Member

Should I add a step in tools/testbuild.sh to call this script?
CI currently runs builds for all boards listed under tools/testlist/. Do we also want to run this out-of-tree export test for all boards, or should we select a single representative board/config to keep CI runtime reasonable?

We need to conserve CI resources due to Apache Foundation restrictions, so one representative board is enough. In the future we can include tests for various host OSes (Mac, Windows) but for now Linux is probably enough?

I'm not sure where to run this script, probably we should add another job in the build workflow and call it directly: https://github.com/apache/nuttx/blob/master/.github/workflows/build.yml

tools/testbuild.sh is designed to work with <testlist-file> and in the case of your script, <testlist-file> is not used, so these two don't really fit together.

@leducp
Copy link
Contributor

leducp commented Sep 15, 2025

I’ve added a hellocpp out-of-tree CMake project based on #16970 and a test-oot-build.sh script.
The script does the following:

* Configures a board and builds NuttX.

* Runs make export to generate the export tarball.

* Copies and extracts the export package into the hellocpp folder.

* Builds the out-of-tree CMake project to verify that compilation and linking succeed.

It currently works locally, but I’d like some guidance on CI integration:

* Should I add a step in `tools/testbuild.sh` to call this script?

* CI currently runs builds for all boards listed under `tools/testlist/`. Do we also want to run this out-of-tree export test for all boards, or should we select a single representative board/config to keep CI runtime reasonable?

Looking for feedback on where this test should live in the CI pipeline and which boards we should cover.

ping @leducp i would like your input on this plz :)

Seems OK as a starter: having an export + OOT app build and linked to it is already years away from the current state :)

@trns1997
Copy link
Contributor Author

Should I add a step in tools/testbuild.sh to call this script?
CI currently runs builds for all boards listed under tools/testlist/. Do we also want to run this out-of-tree export test for all boards, or should we select a single representative board/config to keep CI runtime reasonable?

We need to conserve CI resources due to Apache Foundation restrictions, so one representative board is enough. In the future we can include tests for various host OSes (Mac, Windows) but for now Linux is probably enough?

I'm not sure where to run this script, probably we should add another job in the build workflow and call it directly: https://github.com/apache/nuttx/blob/master/.github/workflows/build.yml

tools/testbuild.sh is designed to work with <testlist-file> and in the case of your script, <testlist-file> is not used, so these two don't really fit together.

Noted, i will treat this as a seperate test and add a new stage to build.yml for stm32f4discovery:cxx-oot-build :)

@acassis
Copy link
Contributor

acassis commented Sep 15, 2025

@trns1997 please add entry to cxx-oot-build board profile in the Documentation/ please explain the details to test it.

@trns1997 trns1997 force-pushed the nuttx-oot-build-test branch from 757f071 to e361d2f Compare September 18, 2025 14:42
@trns1997 trns1997 marked this pull request as ready for review September 18, 2025 18:19
@trns1997
Copy link
Contributor Author

@trns1997 please add entry to cxx-oot-build board profile in the Documentation/ please explain the details to test it.

Do you prefer a separate document or should I integrate it with an existing one? Like the cpp cmake out of tree example updated by @leducp recently?

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @trns1997 :-) Please take a look at [1] [2] [3] and update git commit message and PR description to match requirements :-)

[1] https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
[2] https://nuttx.apache.org/docs/latest/contributing/index.html
[3] https://nuttx.apache.org/docs/latest/contributing/coding_style.html

@github-actions github-actions bot added the Area: Documentation Improvements or additions to documentation label Sep 23, 2025
@trns1997 trns1997 force-pushed the nuttx-oot-build-test branch from d4a7054 to f6d9558 Compare September 23, 2025 18:42
acassis
acassis previously approved these changes Sep 23, 2025
@acassis
Copy link
Contributor

acassis commented Sep 23, 2025

@trns1997 to test the Documentation:
$ cd Documentation
$ make html

@trns1997 trns1997 force-pushed the nuttx-oot-build-test branch 2 times, most recently from 60c6adf to b2f21ed Compare September 24, 2025 15:06
@trns1997
Copy link
Contributor Author

@xiaoxiang781216 can we rerun just the last stage or should we rerun the entire pipeline?

@simbit18
Copy link
Contributor

simbit18 commented Sep 25, 2025

@trns1997 Everything needs to be redone. Here, nuttx-apps does not have the latest updates.

# Fetch the source from nuttx and nuttx-apps repos

@trns1997 trns1997 force-pushed the nuttx-oot-build-test branch from b2f21ed to 21f6e32 Compare September 25, 2025 12:26
@simbit18
Copy link
Contributor

simbit18 commented Sep 25, 2025

@trns1997 Please, can you add tests done locally?
The cibuild-oot.sh script is missing the step where artifacts are stored.

you can see in this script testbuild.sh

if [ -z $ARTIFACTDIR ]; then

if [ ${SAVEARTIFACTS} -eq 1 ]; then

Introduce a new CI test to validate out-of-tree builds
and prevent regressions in the `make export` workflow.
Specifically, this change adds `test-oot-build.sh` that:
* Builds NuttX using a selected configuration.
* Runs `make export` to generate the export package.
* Copies the `nuttx-export` to the OOT build project.
* Verifies that compilation and linking succeed.

Signed-off-by: trns1997 <trns1997@gmail.com>
@xiaoxiang781216 xiaoxiang781216 merged commit d7b2df6 into apache:master Sep 27, 2025
75 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CI Area: Documentation Improvements or additions to documentation Area: Tooling Board: arm Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add a CI test for out-of-tree builds (e.g. exported package + CMake) to catch regressions early

7 participants