Repository navigation
Backport 16580 16563 16565 - #16590
Merged
Merged
Conversation
Reproduction case for #16521 Signed-off-by: Shon Feder <[email protected]>
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]>
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
marked this pull request as ready for review
October 13, 2026 17:21
Member
Author
|
Test failures are unrelated I think we'll need the ppx bound into the rc too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports into 3.25 for