Repository navigation
fix(ox.nix): use CFLAGS for cflags - #16565
Merged
Merged
Conversation
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
force-pushed
the
shonfeder/fix-ox.nix-flags
branch
from
October 13, 2026 16:30
2f4f796 to
2f33ad3
Compare
3 tasks done
Alizter
added a commit
that referenced
this pull request
Oct 13, 2026
Inherit Stdlib.Option’s type and constructor representation instead of redeclaring it with a fixed representation. This fixes bootstrap with OxCaml main’s updated option type. Follow-up to #16582. ### CI comparison Both runs include the CFLAGS fix (#16565) and use OxCaml revision `2a0f110add615cd062940fc610a2d7a8dd534939`. | Run | Build OxCaml | Bootstrap Dune | | --- | --- | --- | | [Before: main (`887d8d67`)](https://github.com/ocaml/dune/actions/runs/38456887336) | Pass | Fail: `Option.t` constructor representation mismatch | | [After: this fix (`e2d48866`)](https://github.com/Alizter/dune/actions/runs/38456923728) | Pass | Pass |
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.
Description
The oxcaml trunk builds started failing. I think this was due to https://github.com/oxcaml/oxcaml/pull/6562/changes#diff-6cff31f46da42c5f179cda29f9fe7f8dbb6441dcb4d1bd5bfa0a2b9070d87325R107 which ends up leading to tests being built and run on C++, if it's available (as per the target at https://github.com/oxcaml/oxcaml/pull/6562/changes#diff-84be0d67b9397fd509a12b5fbc24ec217c1a8f3900388234f6a2a28d102211bbR1266).
The
NIX_CFLAGS_COMPILEapparently get passed to both C++ and C compilation, but-std=gnu17is not valid for C++, leading to the error:As per NixOS/nixpkgs#79303,
CFLAGS(resp.CXXFLAGSshould be preferred).Applying that fix here allows us to get a clean build of the oxcaml trunk with dune.
CI results:
Note that this is on top of #16563 and will need a rebase once that is merged.
Checklist