Skip to content

fix: include sys/wait.h on NetBSD in lev_stubs.c#14512

Merged
Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-luqkkqzskttx
May 13, 2026
Merged

fix: include sys/wait.h on NetBSD in lev_stubs.c#14512
Alizter merged 1 commit into
ocaml:mainfrom
Alizter:push-luqkkqzskttx

Conversation

@Alizter

@Alizter Alizter commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Fixes #14484.

NetBSD needs the same <sys/wait.h> include as FreeBSD and OpenBSD so that the WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG and WTERMSIG macros are available when building lev_stubs.c. Without it the bootstrap fails at link time on NetBSD with undefined references to these symbols.

ld: /home/runner/work/dune/dune/_boot/src/lev/src/lev_stubs.c:515: undefined reference to `WIFEXITED'
ld: …:517: undefined reference to `WEXITSTATUS'
ld: …:518: undefined reference to `WIFSTOPPED'
ld: …:525: undefined reference to `WTERMSIG'
ld: …:521: undefined reference to `WSTOPSIG'
Error: Error during linking (exit code 1)

Failing CI run (before the fix): https://github.com/Alizter/dune/actions/runs/25815321578/job/75842142913?pr=9#step:3:403

Passing NetBSD x86-64 job on this PR (with the fix): https://github.com/ocaml/dune/actions/runs/25816678888/job/75846908855

Patch suggested by @0-wiz-0 in #14484.

@Alizter Alizter force-pushed the push-luqkkqzskttx branch from 13d55fa to 1619ed3 Compare May 13, 2026 17:52
NetBSD needs the same header as FreeBSD and OpenBSD for W* macros
(WIFEXITED, WEXITSTATUS, WIFSTOPPED, WSTOPSIG, WTERMSIG).

Patch suggested by Thomas Klausner (0-wiz-0) in ocaml#14484.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the push-luqkkqzskttx branch from 1619ed3 to 0e85346 Compare May 13, 2026 18:02
@Alizter Alizter requested a review from rgrinberg May 13, 2026 18:07
@Alizter Alizter marked this pull request as ready for review May 13, 2026 18:07
@Alizter Alizter mentioned this pull request May 13, 2026
20 tasks

@rgrinberg rgrinberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks OK. This CI should only be advisory for maintainers. We do not promise to support netbsd

@Alizter Alizter merged commit 52ab5a1 into ocaml:main May 13, 2026
31 checks passed
@Alizter Alizter deleted the push-luqkkqzskttx branch May 13, 2026 20:35
Leonidas-from-XIV pushed a commit to Leonidas-from-XIV/dune that referenced this pull request May 14, 2026
Fixes ocaml#14484.

NetBSD needs the same `<sys/wait.h>` include as FreeBSD and OpenBSD so
that the `WIFEXITED`, `WEXITSTATUS`, `WIFSTOPPED`, `WSTOPSIG` and
`WTERMSIG` macros are available when building `lev_stubs.c`. Without it
the bootstrap fails at link time on NetBSD with undefined references to
these symbols.

```
ld: /home/runner/work/dune/dune/_boot/src/lev/src/lev_stubs.c:515: undefined reference to `WIFEXITED'
ld: …:517: undefined reference to `WEXITSTATUS'
ld: …:518: undefined reference to `WIFSTOPPED'
ld: …:525: undefined reference to `WTERMSIG'
ld: …:521: undefined reference to `WSTOPSIG'
Error: Error during linking (exit code 1)
```
Failing CI run (before the fix):
https://github.com/Alizter/dune/actions/runs/25815321578/job/75842142913?pr=9#step:3:403

Passing NetBSD x86-64 job on this PR (with the fix):
https://github.com/ocaml/dune/actions/runs/25816678888/job/75846908855

Patch suggested by @0-wiz-0 in ocaml#14484.

Signed-off-by: Marek Kubica <marek@tarides.com>
shonfeder added a commit that referenced this pull request May 14, 2026
shonfeder added a commit to ocaml/opam-repository that referenced this pull request May 19, 2026
CHANGES:

### Fixed

- Fix the `menhir` opam dependency injection introduced in 3.23. Dune
  now only fills in the lower bound `{>= "20180523"}` on an existing
  user-declared `menhir` dependency; it no longer adds `menhir` as a
  new dependency to packages that did not declare it themselves.
  (ocaml/dune#14434, fixes ocaml/dune#14428, @robinbb)

- Gate the `dune` version-bound deduplication in generated opam files
  (introduced in 3.23) on `(lang dune 3.23)`. Projects at earlier lang
  versions get the prior `And [...]` shape — e.g.
  `{>= "3.17" & >= "3.20"}` — restoring 3.22 behaviour and avoiding a
  silent change to opam output on dune-binary upgrade. (ocaml/dune#14436,
  @robinbb)

- Preserve library order when building a shared jsoo standalone runtime.
  (ocaml/dune#14438, @vouillon)

- Fix the fallback to the secondary compiler, allowing recovering of support for
  packages with upper bounds on OCaml less than 4.14. Packages depending on dune
  3.23.1 or later and with an upper bound on the OCaml compiler that is less
  than 4.14, will now be able to use the latest dune, but dune will be built
  with the secondary compiler at version 4.14. (ocaml/dune#14443, @Alizter)

- Fix the bootstrap on NetBSD by including `<sys/wait.h>` in `lev_stubs.c`,
  matching the existing FreeBSD/OpenBSD guard.
  (ocaml/dune#14512, fixes ocaml/dune#14484, @0-wiz-0)
@Alizter Alizter added this to the 3.23.1 milestone Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NetBSD compilation fix

2 participants