Skip to content

Backport 16580 16563 16565 - #16590

Merged
shonfeder merged 3 commits into
3.25.0-rcfrom
backport-16580-16563-16565
Oct 13, 2026
Merged

shonfeder merged 3 commits into
3.25.0-rcfrom
backport-16580-16563-16565

Conversation

@shonfeder

@shonfeder shonfeder commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

It is an established convention for artifacts to end up in _build that
are not tracked by dune's build engine, so long as they stay out of
dune's workspace contexts or its private directories. Dune itself does
this with its trace files, but we also see this with oxcaml, which puts
artifacts in a _build/_bootinstall (e.g., in
https://github.com/oxcaml/oxcaml/blob/main/Makefile.common-ox#L216-L228).
It is reasonable, and convenient for users, for dune to to allow this.

However, oxcaml happens to be locating a built compiler in that
location, which caused the fix in
#16374 to produce a regression when
building the oxcaml trunk for the following reason: the fix in #16374
ensured that the stdblib provided by portable compilers via dune package
management was made accessible in sandboxed builds cross all supported
platforms (as far as we know). To achieve this, it localizes the path to
the stdlib *if* the stdlib is in the build directory. This is reasonable
to do under the assumption that anything within the _build directory is
managed by dune's build. However, this invariant does not hold, as shown
by the the convention of putting stuff that is not part of dune's build
in the root of the _build directory. This fix weakens the assumption, so
that now only stdlibs located within a registered *context* within the
_build directory get localized. The required invariant should indeed
hold in that case, and we avoid the build failure on oxcaml (or any
other project doing similar things).

Signed-off-by: Shon Feder <[email protected]>
@shonfeder shonfeder mentioned this pull request Oct 13, 2026
62 tasks done
The oxcaml trunk builds started failing with dune. I think this was
after
https://github.com/oxcaml/oxcaml/pull/6562/changes#diff-6cff31f46da42c5f179cda29f9fe7f8dbb6441dcb4d1bd5bfa0a2b9070d87325R107
which ends up leading to tests being build on run on C++, if it's
available (as per the target at
https://github.com/oxcaml/oxcaml/pull/6562/changes#diff-84be0d67b9397fd509a12b5fbc24ec217c1a8f3900388234f6a2a28d102211bbR1266)

`NIX_CFLAGS_COMPILE` apparently get passed to during both C++ and C
compilation, but `-std=gnu17` is not valid for C++, leading to the error

```
cc1plus: error: command-line option '-std=gnu17' is valid for C/ObjC but not for C++ [-Werror]
cc1plus: all warnings being treated as errors
```

As per NixOS/nixpkgs#79303, `CFLAGS` (resp.
`CXXFLAGS` should be preferred).

Applying that fix here allows us to get a clean build of the oxcaml
trunk with dune.

Signed-off-by: Shon Feder <[email protected]>
@shonfeder
shonfeder marked this pull request as ready for review October 13, 2026 17:21
@shonfeder

Copy link
Copy Markdown
Member Author

Test failures are unrelated I think we'll need the ppx bound into the rc too.

@shonfeder
shonfeder merged commit 9023be6 into 3.25.0-rc Oct 13, 2026
33 of 36 checks passed
@shonfeder
shonfeder deleted the backport-16580-16563-16565 branch October 13, 2026 18:23
@Alizter Alizter added this to the 3.25.0 milestone Oct 14, 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.

2 participants