Skip to content

Commit

Permalink
fix: declare deps for ccomp detection
Browse files Browse the repository at this point in the history
This ensures that c++ compiler can be detected even with an explicit
`--sandbox`.

Fixes ocaml#6415

Signed-off-by: Etienne Millon <[email protected]>
  • Loading branch information
emillon committed Nov 30, 2022
1 parent 9fb3533 commit 8d5b866
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Unreleased

- Fix configurator when using the MSVC compiler (#6538, fixes #6537, @nojb)

- Fix missing dependencies when detecting the kind of C compiler we're using
(#6610, fixes #6415, @emillon)

3.6.0 (2022-11-14)
------------------

Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/cxx_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let rules ~sctx ~dir =
[ (match Ocaml_config.ccomp_type ocfg with
| Msvc -> A "/EP"
| Other _ -> As [ "-E"; "-P" ])
; A Path.(to_absolute_filename (build header_file))
; Path (Path.build header_file)
]
in
let action =
Expand Down
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/cxx-flags.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ With use_standard_c_and_cxx_flags = true
(this also works with sandbox=symlink, #6415)

$ dune exec --sandbox symlink ./main.exe
File ".dune/ccomp/_unknown_", line 1, characters 0-0:
cc1: fatal error: $TESTCASE_ROOT/_build/default/.dune/ccomp/header_check.h: No such file or directory
compilation terminated.
[1]
2046
4096
Hello World Baz!
Hello World Bazexe!

ccomp is not computed if not required
=====================================
Expand Down

0 comments on commit 8d5b866

Please sign in to comment.