Skip to content

Fix Corelib detection on dune exec -- rocq with dune 3.24#22252

Open
rlepigre-skylabs-ai wants to merge 1 commit into
rocq-prover:masterfrom
rlepigre-skylabs-ai:dune-fix
Open

Fix Corelib detection on dune exec -- rocq with dune 3.24#22252
rlepigre-skylabs-ai wants to merge 1 commit into
rocq-prover:masterfrom
rlepigre-skylabs-ai:dune-fix

Conversation

@rlepigre-skylabs-ai

Copy link
Copy Markdown
Contributor

@rlepigre-skylabs-ai rlepigre-skylabs-ai requested a review from a team as a code owner July 9, 2026 22:37
@coqbot-app coqbot-app Bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Jul 9, 2026
@rlepigre-skylabs-ai

Copy link
Copy Markdown
Contributor Author

@coqbot run full ci

@coqbot-app coqbot-app Bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Jul 9, 2026
@SkySkimmer

Copy link
Copy Markdown
Contributor

Isn't this a dune bug? I'm not sure we want workaround code for it.

If we do want code for it maybe we could rely on INSIDE_DUNE instead of unconditionally crawling the filesystem?

@rlepigre-skylabs-ai

Copy link
Copy Markdown
Contributor Author

Isn't this a dune bug? I'm not sure we want workaround code for it.

I'm not sure this qualifies as a dune bug, as we're kind of abusing implementation details. The change proposed in ocaml/dune#14432 seems pretty reasonable to me, but maybe @Alizter can comment.

For context, we relied on dune exec -- rocq to resolve to _build/install/default/bin/rocq to locate Corelib and so on relative to the binary. Now, this is broken and one needs to run _build/install/default/bin/rocq directly for things to work as expected.

If we do want code for it maybe we could rely on INSIDE_DUNE instead of unconditionally crawling the filesystem?

Something like that might mess with composed builds, and would also prevent running _build/default/topbin/rocq.exe directly (not sure that last one is an issue though).

@SkySkimmer

Copy link
Copy Markdown
Contributor

https://dune.readthedocs.io/en/latest/reference/cli.html#describe-dune-exec

Execute a command in a similar environment as if installation was performed.

How is running from the build layout "as if installation was performed"?
How can we justify dune exec -- rocq and dune exec -- env rocq giving different results?

Something like that might mess with composed builds, and would also prevent running _build/default/topbin/rocq.exe directly (not sure that last one is an issue though).

It's explicitly not supported when configured relocatable. relocatable rocq expects the install layout, not the build layout.

@SkySkimmer

Copy link
Copy Markdown
Contributor

Checking if basename (dirname argv[0]) is "topbin" could also work to detect the build layout

@rlepigre-skylabs-ai

Copy link
Copy Markdown
Contributor Author

Checking if basename (dirname argv[0]) is "topbin" could also work to detect the build layout

That would definitely work too.

@SkySkimmer

Copy link
Copy Markdown
Contributor

BTW coq_config_to_make call (in test-suite/dune) is probably broken by this dune change too (I didn't check though).

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

Successfully merging this pull request may close these issues.

2 participants