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

Running "dune build @install" in a workspace sub-project puts files in an unexpected directory #7335

Open
rlepigre opened this issue Mar 16, 2023 · 5 comments
Labels
bug docs Documentation improvements

Comments

@rlepigre
Copy link
Contributor

rlepigre commented Mar 16, 2023

Expected Behavior

When I work in a dune workspace containing several dune projects, I expect all produced files (barring promoted ones) to end up in <workspace_root>/_build.

Actual Behavior

This does not seem to be the case when using dune build @install from a project subdirectory: files end up in a _build placed under project's root (instead of the workspace root).

Reproduction

See #7336 install-workspace.tar.gz.

rlepigre pushed a commit to rlepigre/dune that referenced this issue Mar 16, 2023
@emillon
Copy link
Collaborator

emillon commented Mar 16, 2023

Thanks. The title mentions dune install but the body dune build @install. This is about the latter, right?

@rlepigre rlepigre changed the title Running "dune install" in a workspace sub-project puts files in an unexpected directory Running "dune build @install" in a workspace sub-project puts files in an unexpected directory Mar 16, 2023
@rlepigre
Copy link
Contributor Author

Thanks. The title mentions dune install but the body dune build @install. This is about the latter, right?

Indeed, sorry, I fixed the title.

rlepigre pushed a commit to rlepigre/dune that referenced this issue Mar 17, 2023
Signed-off-by: Rodolphe Lepigre <[email protected]>
@Alizter Alizter added the bug label Apr 27, 2023
Alizter pushed a commit to rlepigre/dune that referenced this issue Apr 30, 2023
Signed-off-by: Rodolphe Lepigre <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Alizter pushed a commit to rlepigre/dune that referenced this issue Apr 30, 2023
Signed-off-by: Rodolphe Lepigre <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
Alizter pushed a commit to rlepigre/dune that referenced this issue Apr 30, 2023
Signed-off-by: Rodolphe Lepigre <[email protected]>
Signed-off-by: Ali Caglayan <[email protected]>
@Alizter
Copy link
Collaborator

Alizter commented Apr 30, 2023

@rlepigre as explained in #7336 this is the intended behaviour since -p will set the root to the current directory. As I explained in the PR, the original cram test was incorrect due to the setting of INSIDE_DUNE. I also mention why unsetting that in fact gives the desired behaviour. All I can add to this is "don't use -p unless you are in the project root or your name is opam".

@emillon maybe it is worth adding some documentation about this difference (the fact that -p is setting the root). However I can only find documentation about -p in the help page rather than in the manual.

@Alizter Alizter added the docs Documentation improvements label Apr 30, 2023
@rlepigre
Copy link
Contributor Author

OK, I see. This behaviour sounds a bit weird to me, but I understand this cannot be changed at this point. Thanks!

@emillon
Copy link
Collaborator

emillon commented May 16, 2023

maybe it is worth adding some documentation about this difference (the fact that -p is setting the root). However I can only find documentation about -p in the help page rather than in the manual.

I recently added that part to explain how the opam integration works:

https://dune.readthedocs.io/en/latest/explanation/opam-integration.html#what-p-means

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

No branches or pull requests

3 participants