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

The new dir install feature does not work on existing directories #6133

Open
kit-ty-kate opened this issue Sep 7, 2022 · 3 comments
Open
Assignees
Labels

Comments

@kit-ty-kate
Copy link
Member

Using dune master (7659e30 + #6119), the following project:

$ cat dune-project
(lang dune 3.5)
$ cat dune
(install
 (dirs (existing-dir as target-dir))
 (section lib_root))
$ mkdir existing-dir
$ touch existing-dir/a existing-dir/b

fails with:

Error: No rule found for existing-dir
-> required by alias all
-> required by alias default

From #5097 description, it doesn't seem like existing-dir needs to have a target (what would it even be?) or that opam requires it to be generated somehow.

Also, as an aside, renaming target-dir to test makes dune change its error to:

Error: No rule found for existing-dir
-> required by alias all
-> required by alias default
File "dune", line 2, characters 8-20:
2 |  (dirs (existing-dir as test))
            ^^^^^^^^^^^^
Error: This rule defines a target "test" whose name conflicts with an
internal directory used by Dune. Please use a different name.

I'm not sure to understand why test would be a forbidden target in lib_root.

@emillon
Copy link
Collaborator

emillon commented Oct 11, 2022

As per last week's dev meeting, this is a new feature so it's ok to have this limitation, so I'm moving this to 3.6.0. A better error message would be good and can be added in 3.5.0.

@emillon emillon modified the milestones: 3.5.0, 3.6.0 Oct 11, 2022
@rgrinberg rgrinberg modified the milestones: 3.6.0, 3.7.0 Nov 4, 2022
@emillon
Copy link
Collaborator

emillon commented Jan 30, 2023

I don't think we'll have a fix for this in 3.7 so I'm moving the milestone.

@emillon emillon modified the milestones: 3.7.0, 3.8.0 Jan 30, 2023
@rgrinberg rgrinberg added the bug label Feb 21, 2023
@rgrinberg
Copy link
Member

I remember trying to implement this before and realized it wasn't that easy. The main issue is that the current directory loading code has special handling for source directories so implementing this feature would require some deep changes to the rule loading.

@rgrinberg rgrinberg removed this from the 3.8.0 milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants