Skip to content

fix(ox.nix): use CFLAGS for cflags - #16565

Merged
shonfeder merged 1 commit into
mainfrom
shonfeder/fix-ox.nix-flags
Oct 13, 2026
Merged

shonfeder merged 1 commit into
mainfrom
shonfeder/fix-ox.nix-flags

Conversation

@shonfeder

@shonfeder shonfeder commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

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_COMPILE apparently get passed to 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.

CI results:

Note that this is on top of #16563 and will need a rebase once that is merged.

Checklist

  • Tests added, if applicable.
  • Change log entry added for any user-facing changes.
  • Documentation added for any user-facing changes.

@shonfeder
shonfeder requested a review from Alizter October 9, 2026 21:17
@shonfeder shonfeder changed the title Shonfeder/fix ox.nix flags fix(ox.nix): use CFLAGS for cflags Oct 9, 2026
@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 force-pushed the shonfeder/fix-ox.nix-flags branch from 2f4f796 to 2f33ad3 Compare October 13, 2026 16:30
@shonfeder shonfeder mentioned this pull request Oct 13, 2026
3 tasks done
@shonfeder
shonfeder merged commit 887d8d6 into main Oct 13, 2026
38 of 39 checks passed
@shonfeder
shonfeder deleted the shonfeder/fix-ox.nix-flags branch October 13, 2026 17:19
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 |
@Alizter Alizter added this to the 3.26.0 milestone Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants