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

Hidden folders are ignored in source_tree dep #7135

Open
SUPERCILEX opened this issue Feb 21, 2023 · 11 comments
Open

Hidden folders are ignored in source_tree dep #7135

SUPERCILEX opened this issue Feb 21, 2023 · 11 comments
Labels
docs Documentation improvements

Comments

@SUPERCILEX
Copy link

Expected Behavior

If I have a file onchip/.cargo/config.toml and include it with (source_tree onchip), it should be part of the sources.

Actual Behavior

It's impossible to get dune to see the file. Even explicitly saying (file onchip/.cargo/config.toml) doesn't work.

Error: No rule found for soft/onchip/.cargo/config.toml

Specifications

  • Version of dune (output of dune --version): 3.6.1
@rgrinberg rgrinberg added the bug label Feb 21, 2023
@rgrinberg
Copy link
Member

Did you try doing (dirs :standard .cargo) in the directory containing the .cargo dir?

@SUPERCILEX
Copy link
Author

That worked, thanks! It should be documented somewhere with the word hidden so people can find it.

@rgrinberg rgrinberg added bug docs Documentation improvements and removed bug labels Feb 21, 2023
@Lupus
Copy link

Lupus commented May 10, 2023

I've also stumbled upon this behavior. After trial and error I intuitively managed to fix it by adding (data_only_dirs .cargo) stanza, went on to report this and found this issue. This case definitely needs better documentation, I've tried searching for "hidden files" but no results. Also dune could probably hint me when complaining about no rule for file that file actually exists in the source tree, but in a hidden folder so maybe I need to add corresponding stanza to my dune file. That would be really user-friendly.

@Alizter
Copy link
Collaborator

Alizter commented May 10, 2023

@emillon we should document hidden files for 3.8.

@Alizter Alizter modified the milestones: 3.9.0, 3.8.0 May 10, 2023
@emillon
Copy link
Collaborator

emillon commented May 15, 2023

it's important to fix but I wouldn't say we should delay 3.8 on this.

@emillon emillon removed this from the 3.8.0 milestone May 15, 2023
@gridbugs
Copy link
Collaborator

gridbugs commented Jul 3, 2023

I also just ran into this problem (also with .cargo) and was confused/frustrated and eventually just renamed it to "dot_cargo" and used a dune rule to rename it to ".cargo" before building. Does anyone know the original motivation for ignoring hidden files? Would it be reasonable to print a warning when a file is ignored in this manner which doesn't match some list of known files to ignore (e.g. .git)?

@Alizter
Copy link
Collaborator

Alizter commented Jul 5, 2023

I think it was just not very well thought out. I believe that we discussed at some point to weaken this restriction to specific cases like .git.

@gridbugs
Copy link
Collaborator

gridbugs commented Jul 5, 2023

I propose we create a page of dune gotchas. I feel like dune often surprises me with its opinions and I spend time thinking I'm doing something wrong only to learn that I've encountered a quirk of the build system. We could list all the things about dune that those less familiar with it (like me) have found surprising and link to open issues to address the quirks that we'd like to change in the future and include explanations of the quirks that we want to keep. I think it would be useful for new adopters who hit some unexpected behaviour to have a place to look to see if it's well-known unexpected behaviour. I recently made a non-trivial dune-based project from scratch for the first time and at several points was surprised by something dune did or didn't do. I'd be happy to start such a document while these memories are still fresh.

@Alizter
Copy link
Collaborator

Alizter commented Jul 5, 2023

I think this was one of the motivations with the FAQ page.

@gridbugs
Copy link
Collaborator

gridbugs commented Jul 5, 2023

Ah cool. I have some updates to make then!

@Alizter
Copy link
Collaborator

Alizter commented Jul 5, 2023

IINM :standard does not include _* or .* however you can glob all directories with *. So it should be possible to do (dirs * \ .git) though I haven't tried it.

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

No branches or pull requests

6 participants