Repository navigation
Refactor Dune_engine.Targets - #9407
Merged
Merged
Conversation
rleshchinskiy
marked this pull request as ready for review
December 11, 2023 17:07
snowleopard
approved these changes
Dec 11, 2023
rgrinberg
force-pushed
the
refactor-targets
branch
3 times, most recently
from
December 12, 2023 04:46
faa0d18 to
46011a8
Compare
rgrinberg
approved these changes
Dec 12, 2023
rgrinberg
left a comment
Member
There was a problem hiding this comment.
I've replaced the use of symlinking to create a directory target with just normal copying as an experiment and it didn't seem to help. I've also experimented with sandboxing to make sure that we specified all dependencies correctly and again without success.
The fact that doing a clean build gives us the right answer in the install rules is rather concerning and my first assumption is that there's some bug in the engine.
Unfortunately, I didn't get anywhere investigating. I'll keep investigating, but I don't think this should block the PR.
I've left a commit (which I later reverted) switching the symlinking to copying in case anyone wants to experiment.
rleshchinskiy
force-pushed
the
refactor-targets
branch
from
December 12, 2023 09:13
8982e81 to
e5c880e
Compare
We had similar but subtly different code for sandboxed and non-sandboxed directory targets. This patch unifies the two. We also no longer promote empty (sub)directories. Previously, this was only the case for sandboxed directory targets because we didn't move empty (sub)directories from the sandbox to the build dir. Signed-off-by: Roman Leshchinskiy <[email protected]>
There was some code duplication here which gets in the way of subsequent refactoring. Let's get rid of it. Signed-off-by: Roman Leshchinskiy <[email protected]>
This is a pure refactoring. The main goal is to be able to move Dune_engine.Targets into a separate package which can be used from dune_cache. However, I believe that it also makes the code simpler to follow overall. The main change is that we move everything to do with async file operations into Build_system which really is the only user of those, anyway. In addition, we also slightly generalise [Targets.Produced.collect_digests] and remove an unused pretty-printing function. Signed-off-by: Roman Leshchinskiy <[email protected]>
The test was creating a broken symlink which was subsequently ignored by Dune. We no longer ignore symlinks so this fails at a later stage. This patch makes the symlink be valid. Signed-off-by: Roman Leshchinskiy <[email protected]>
Signed-off-by: Rudi Grinberg <[email protected]>
This reverts commit 46011a8. Signed-off-by: Rudi Grinberg <[email protected]>
rleshchinskiy
force-pushed
the
refactor-targets
branch
from
December 12, 2023 09:47
e5c880e to
92e776f
Compare
ejgallego
added a commit
to ejgallego/dune
that referenced
this pull request
Sep 17, 2024
…cases When the promoted directory has sub-directories with only other sub-directories inside, the map will miss that directory and it will not be properly re-created, failing at children creation time. Regression in b1c339b / ocaml#9407 Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
ejgallego
added a commit
to ejgallego/dune
that referenced
this pull request
Sep 17, 2024
…cases When the promoted directory has sub-directories with only other sub-directories inside, the map will miss that directory and it will not be properly re-created, failing at children creation time. I am not sure I fully follow the logic here (cc: @rleshchinskiy), for example, I did have trouble making a testcase fail without using `npm` to generate a large directory. Regression in b1c339b / ocaml#9407 Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
ejgallego
added a commit
to ejgallego/dune
that referenced
this pull request
Sep 17, 2024
…cases When the promoted directory has sub-directories with only other sub-directories inside, the map will miss that directory and it will not be properly re-created, failing at children creation time. I am not sure I fully follow the logic here (cc: @rleshchinskiy), for example, I did have trouble making a testcase fail without using `npm` to generate a large directory. Regression in b1c339b / ocaml#9407 Closes ocaml#10609 . Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
ejgallego
added a commit
to ejgallego/dune
that referenced
this pull request
Sep 17, 2024
…cases When the promoted directory has sub-directories with only other sub-directories inside, the map will miss that directory and it will not be properly re-created, failing at children creation time. I am not sure I fully follow the logic here (cc: @rleshchinskiy). The current test case works for me (TM), if we revert the fix we get: ``` Error: Cannot promote files to "node_modules/node-cmake/node_modules/ansi-regex". Reason: opendir(node_modules/node-cmake/node_modules/ansi-regex): No such file or directory ``` Regression in b1c339b / ocaml#9407 Closes ocaml#10609 . Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a bunch of refactoring around
Targetsand especiallyTargets.Produced. The main changes are:Targets.Produced.collect_digestswhich allows us to removeTargets.Produced.Option.Build_systemwhich really is the only user of those, anyway.Dune_enginefromTargets. A later PR will move those into a separate library which will allow us to use them in the cache as well.