-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] [directory targets] Fix promotion of directory targets in some …
…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 / #9407 Closes #10609 . Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
- Loading branch information
Showing
4 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- Fix promotion of directory targets when the promoted directory has | ||
sub-directories with only other sub-directories inside; regression | ||
in b1c339b / #9407 (@ejgallego, closes #10609) |
This file contains 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
24 changes: 24 additions & 0 deletions
24
test/blackbox-tests/test-cases/directory-targets/github10609/run.t
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
We test that a directory target with only other subdirs can be | ||
properly promoted. | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.16) | ||
> (using directory-targets 0.1) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (rule | ||
> (targets (dir node_modules)) | ||
> (mode (promote (until-clean))) | ||
> (action | ||
> (progn | ||
> (system "mkdir -p node_modules/node-cmake/") | ||
> (system "touch node_modules/node-cmake/.jshintrc") | ||
> (system "mkdir -p node_modules/node-cmake/node_modules/ansi-regex") | ||
> (system "touch node_modules/node-cmake/node_modules/ansi-regex/index.js") | ||
> ))) | ||
> EOF | ||
|
||
$ dune build node_modules | ||
$ ls node_modules | ||
node-cmake |
This file contains 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