forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dune-project stanza, map_workspace_root, to control workspace map…
…ping. Add a "map_workspace_root" stanza to the dune-project file. If true, references to the workspace root directory in output files are mapped to "/workspace_root". If false, such references are not modified. If missing, it defaults to true. Note that in the added tests, for some configurations quotes are needed around the "EOF" delimeter to get expansion. Note also that when enabled, the debug search directories in the debug information produced by ocamlc are also mapped, with the result that ocamldebug cannot find the files. Fixes ocaml#6929, provided user disables mapping. Co-authored-by: Christine Rose <[email protected]> Co-authored-by: Etienne Millon <[email protected]> Co-authored-by: Ali Caglayan <[email protected]> Signed-off-by: Richard L Ford <[email protected]>
- Loading branch information
1 parent
50eda63
commit 832bd3e
Showing
8 changed files
with
112 additions
and
3 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
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
test/blackbox-tests/test-cases/map-workspace-root-disabled.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,21 @@ | ||
Check that Dune does not do rewriting of build directory to /workspace_root | ||
if inhibited. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.7) | ||
> (map_workspace_root false) | ||
> EOF | ||
$ cat > dune << "EOF" | ||
> (rule | ||
> (target x) | ||
> (action (system "dune_cmd rewrite-path $PWD | grep -c /workspace_root; touch x"))) | ||
> EOF | ||
|
||
$ dune build | ||
0 | ||
|
||
It works with sandboxing as well: | ||
|
||
$ dune clean | ||
$ dune build --sandbox copy | ||
0 |
21 changes: 21 additions & 0 deletions
21
test/blackbox-tests/test-cases/map-workspace-root-enabled.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,21 @@ | ||
Check that Dune does not do rewriting of build directory to /workspace_root | ||
if inhibited. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.7) | ||
> (map_workspace_root true) | ||
> EOF | ||
$ cat > dune << "EOF" | ||
> (rule | ||
> (target x) | ||
> (action (system "dune_cmd rewrite-path $PWD | grep -c /workspace_root; touch x"))) | ||
> EOF | ||
|
||
$ dune build | ||
1 | ||
|
||
It works with sandboxing as well: | ||
|
||
$ dune clean | ||
$ dune build --sandbox copy | ||
1 |