casaroli opened a new pull request, #3685: URL: https://github.com/apache/nuttx-apps/pull/3685
> [!IMPORTANT] > **Draft, and it must not merge before two other PRs.** > > 1. **apache/nuttx#19562** — this PR removes the code that lets `ostest` build against a NuttX *without* the `fork()`/`vfork()`/`task_fork()` split. Merged before the NuttX side, it deletes the fork tests from every configuration. > 2. **apache/nuttx-apps#3673** — this branch is stacked on it. The first of the two commits below **is** #3673 and is not for review here; only `testing/ostest: drop the pre-split fork() fallbacks` belongs to this PR. > > It is open early so the end state is visible while #3673 is being reviewed — several review comments there ask for exactly this, and it is easier to agree the destination than to describe it. ## Summary apache/nuttx-apps#3673 makes every fork-family test also accept `CONFIG_ARCH_HAVE_FORK`, because the NuttX symbols naming the three primitives do not exist yet. It has to: it merges first, so for a window `apps` master is built against a NuttX that has none of them, and keying on them directly would silently compile the tests out and leave a green build with no fork coverage at all. Once apache/nuttx#19562 lands, that reason is gone. This removes the transitional layer so each test gates on the one primitive it tests: | test | gate | |---|---| | `task_fork_test()` | `CONFIG_TASK_FORK` | | `vfork_test()` | `CONFIG_ARCH_HAVE_VFORK` | | `fork_test()` | `CONFIG_ARCH_HAVE_FORK` | The `OSTEST_HAVE_*` indirection goes with the fallbacks, as does the `task_fork() -> fork()` shim in `nand_sim_main.c`. The whole-file `#ifdef` in `task_fork.c` goes too — the build files already decide whether the file is compiled, which is why `fork.c` and `vfork.c` do not carry one either. The same `|| ARCH_HAVE_FORK` fallbacks are dropped from `interpreters/python`, `netutils/libwebsockets`, `testing/fs/fdsantest` and `testing/drivers/nand_sim`. **`task_fork_test()` keys on `CONFIG_TASK_FORK`, not on the capability symbol.** `ARCH_HAVE_TASK_FORK` says the architecture *can* clone a task; `TASK_FORK` says this build asked for it, and `task_fork()` is declared only under the latter, so gating on the capability alone fails to compile a `TASK_FORK=n` build. `TESTING_NAND_SIM` depends on the same symbol for the same reason. `vfork_test()` and `fork_test()` have no such split and key on the capability symbols directly. ## Impact - New feature: **No**. - User adaptation: **No**. - Build impact: **Yes**, and it is the reason for the merge ordering above. After apache/nuttx#19562 this is a no-op in coverage terms — the same tests build in the same configurations, by a shorter route. Before it, it removes them. - Hardware impact: **No**. - Documentation impact: **No**. - Security impact: **No**. - Compatibility impact: **No**, given the ordering. - Dependency: **apache/nuttx#19562** and **apache/nuttx-apps#3673**, both of which must merge first. ## Testing Host: macOS 15 (Darwin 25.5.0) on Apple Silicon, QEMU 11.0.3, xPack `riscv-none-elf-gcc` 14.2.0-3. `ostest` built and run to completion against a NuttX carrying the split: | config | verdict | `task_fork` | `vfork` | `fork` | |---|---|---|---|---| | `rv-virt:nsh64` (FLAT) | PASS, exit 0 | PASS | PASS | absent — no `ARCH_HAVE_FORK` | | `rv-virt:knsh64` (KERNEL) | PASS, exit 0 | PASS | PASS | PASS | ```text task_fork_test: Child 6 ran successfully vfork_test: Child 7 ran and exited before the parent resumed fork_test: Parent and child had independent memory ostest_main: Exiting with status 0 ``` `fork_test` being absent on the FLAT configuration and present on the KERNEL one is the intended behaviour: `ARCH_HAVE_FORK` follows `ARCH_ADDRENV && ARCH_HAVE_ADDRENV_FORK`, so only a configuration with an address environment provides POSIX `fork()`. ### Style `../nuttx/tools/checkpatch.sh -c -u -m -g <base>..HEAD`, the command `.github/workflows/check.yml` runs — **✔️ All checks pass**, with `codespell`, `cvt2utf`, `cmake-format` and `nxstyle` installed. ## PR verification self-check - [x] This PR introduces one focused functional change. - [x] All required PR description fields are completed. - [x] The commit has a descriptive topic/body, `Signed-off-by`, and `Assisted-by` trailer. - [x] This PR is a draft, and the merge order it depends on is stated above. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
