-
Notifications
You must be signed in to change notification settings - Fork 412
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
Fix directory targets with empty subdirs #11226
base: main
Are you sure you want to change the base?
Conversation
c252cc8
to
7ad4e6d
Compare
Below are the initial text of the PR, and a comment I made after working on this for a week. They are now outdated, I'm just keeping them here for posterity.This PR is related to... a lot of things actually. For some context, let's take this test file from #11116 & #11117:
I'm not really sure, and the original author of this piece of code (rleshchinskiy) doesn't seem very active in this project at this time. Debugging this is tricky, as a lot of tests fail with a cryptic
I'll note however that the problems likely originates in either #9407, #9470, or #9535. Belated update before the holidays: Hope this progress report isn't too arcanic for reviewers 🙂 |
ed32398
to
c181da2
Compare
f720346
to
9852aad
Compare
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
Signed-off-by: Ambre Austen Suhamy <[email protected]>
229e158
to
957a6cc
Compare
Incorporates and replaces #11213, replaces #10931 and #11203, fixes #10609, #11117, #11214.
Work mostly done by myself, with various helpful insights by @maiste and @art-w.
The core of the changes are in
dune_targets.ml
, where I changed the representation of targets (Targets.Produced.t
) from a flat structure to a hierarchical one, mirroring the file system. This makes all traversals easier to reason about, and prevents problems of hittingdirA/dirB/fileB
beforedirA/fileA
, along with the intended feature of actually processing directories properly.Other noteworthy changes are:
Local.Target.create
now also creates directories, not just filesBuild_system.file_exists
now also checks for directories, not just filesDune_cache_storage.Artifacts.Metadata_entry.{to,of}_sexp
have slightly changed semantics, I added the possibilty to have no digest but instead a simple"<dir>"
to indicate a directory. I wouldn't be surprised to hear this has long ramifications. Same concern forTargets.Produced.{digest,to_dyn}
.I'll add for the record that a lot of functions named
do_something_file
also work on directories, but not all, and that is rather confusing. If I'm not the only one with this sentiment I could do a refactor to make this clear everywhere.