Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds fail with (lang dune 3.17) #115

Open
henrytill opened this issue Mar 8, 2025 · 4 comments
Open

Builds fail with (lang dune 3.17) #115

henrytill opened this issue Mar 8, 2025 · 4 comments

Comments

@henrytill
Copy link
Contributor

Describe the bug
When dune-project contains (lang dune 3.17), builds fail with:

error: builder for '/nix/store/6i5di8cfaxp8fjzh0xp177l5zfkiphip-repro-dev.drv' failed with exit code 1;
       last 12 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/yr0mkpxm5bpzi33br6q6jf0gb7dd8m49-01klbdnhwh0s9j5km1pnb030px9angz5-bk9izj5svxgyvcmmvjhcjc0wfazifacn-source
       > source root is 01klbdnhwh0s9j5km1pnb030px9angz5-bk9izj5svxgyvcmmvjhcjc0wfazifacn-source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > patching script interpreter paths in .
       > Running phase: buildPhase
       > File "repro.opam", line 1, characters 10-25:
       > 1 | # This file is generated by dune, edit dune-project instead
       >               ^^^^^^^^^^^^^^^
       > Error: repository does not contain any version information
       For full logs, run 'nix-store -l /nix/store/6i5di8cfaxp8fjzh0xp177l5zfkiphip-repro-dev.drv'.

To Reproduce

dune init proj repro
cd repro
dune build @all
nix flake init -t github:tweag/opam-nix
sed -i 's/throw "Put the package name here!"/"repro"/' flake.nix
nix build # fails
sed -i 's/3.17/3.16/' dune-project 
nix build # succeeds

Expected behavior
Build succeeds.

Environment

$ uname -a
Linux thalassa 6.12.12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.12-1 (2025-02-02) x86_64 GNU/Linux
$ dune --version
3.17.2
$ nix --version
nix (Nix) 2.25.3
@balsoft
Copy link
Collaborator

balsoft commented Mar 8, 2025 via email

@balsoft
Copy link
Collaborator

balsoft commented Mar 8, 2025

There's a couple of similar issues in dune's bug tracker: ocaml/dune#11200 ocaml/dune#11290

@balsoft
Copy link
Collaborator

balsoft commented Mar 8, 2025

Aha, there's actually this exact issue already reported as well: ocaml/dune#11045

I think it makes sense to close this issue in favor of that one, do you agree?

@henrytill
Copy link
Contributor Author

Thanks for looking into this, much appreciated.

Indeed this works around the problem for now:

echo "(subst disabled)" >> dune-project
dune build repro.opam
nix build # succeeds

I agree with your assertion that this is seems to be an upstream issue.

At the same time, anyone starting a fresh project bringing in opam-nix or wanting to upgrade to use newer features like wasm_of_ocaml support (like #113) is going to hit this issue until it's addressed upstream. In fact, I discovered this bug trying to use wasm_of_ocaml in an existing project and only discovered then that it could be reproduced with a fresh project.

So it may make sense to leave this open for visibility, so that other users can find out what is happening when they hit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants