Skip to content

"system" behaves differently since dune 3 (Windows only) #5523

@fdopen

Description

@fdopen

Some packages that use "system" could be compiled with dune version 2.9.3 and earlier, but no longer with dune 3.

e.g:
mesh-easymesh.0.9.5:
https://github.com/Chris00/mesh/blob/be7f043df3dedca862ad650538f8483855836c34/easymesh/dune#L20

Reproduction

opam install dune.3.0.3 mesh-easymesh.0.9.5
File "easymesh/dune", line 17, characters 0-111:
17 | (rule
18 |  (targets EasyMesh.exe)
19 |  (deps    easymesh.c)
20 |  (action  (system "%{cc} -o EasyMesh.exe easymesh.c -lm")))
(cd _build/default/easymesh && C:\Windows\system32\cmd.exe /c "cl -nologo -O2 -Gy- -MD -o EasyMesh.exe easymesh.c -lm")
The command ""cl -nologo -O2 -Gy- -MD -o EasyMesh.exe easymesh.c -lm" is either misspelled or could not be found

No errors with

opam install dune.2.9.3 mesh-easymesh.0.9.5

or

opam install dune.1.11.4 mesh-easymesh.0.9.5

similar:
bin_prot.v0.12.0:
https://github.com/janestreet/bin_prot/blob/c4cfc29bfeadd69a644b6627f458ed66679aa37f/src/dune#L7

mpg123.0.3:
https://github.com/mbacarella/mpg123/blob/63c2d9be32892732d1957ad2df24d393fb747b2d/c/dune#L25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions