-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To achieve reproducible builds, currently Dune rewrites paths based of the current build directory. However it misses paths based on the OCaml installation directory (usually ~/.opam/switch). This change also maps paths in the installation tree to abstract paths headed by "/workspace_root". Signed-off-by: Richard L Ford <[email protected]>
- Loading branch information
1 parent
f6e974a
commit b04df9e
Showing
17 changed files
with
312 additions
and
255 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
330 changes: 165 additions & 165 deletions
330
test/blackbox-tests/test-cases/install-dir/install-libdir.t/run.t
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -34,21 +34,21 @@ | |
Paths to Melange stdlib appear in B and S entries without melange.emit stanza | ||
|
||
$ dune ocaml dump-dot-merlin $PWD | grep -e "^B " -e "^S " | ||
B /MELC_STDLIB/melange | ||
B /MELC_STDLIB/melange | ||
B /MELC_STDLIB/melange | ||
B /workspace_root/lib/melange/belt/melange | ||
B /workspace_root/lib/melange/melange | ||
B /workspace_root/lib/melange/runtime/melange | ||
B $TESTCASE_ROOT/_build/default/.foo.objs/melange | ||
S /MELC_STDLIB | ||
S /MELC_STDLIB | ||
S /MELC_STDLIB | ||
S /workspace_root/lib/melange | ||
S /workspace_root/lib/melange/belt | ||
S /workspace_root/lib/melange/runtime | ||
S $TESTCASE_ROOT | ||
All 3 modules (Foo, Foo__ and Bar) contain a ppx directive | ||
$ dune ocaml merlin dump-config $PWD | grep -i "ppx" | ||
(FLG (-ppx "/MELC_COMPILER -as-ppx")) | ||
(FLG (-ppx "/MELC_COMPILER -as-ppx")) | ||
(FLG (-ppx "/MELC_COMPILER -as-ppx")) | ||
(FLG (-ppx "/workspace_root/bin/melc -as-ppx")) | ||
(FLG (-ppx "/workspace_root/bin/melc -as-ppx")) | ||
(FLG (-ppx "/workspace_root/bin/melc -as-ppx")) | ||
|
||
$ target=output | ||
$ cat >dune <<EOF | ||
|
@@ -65,22 +65,22 @@ All 3 modules (Foo, Foo__ and Bar) contain a ppx directive | |
The melange.emit entry contains a ppx directive | ||
|
||
$ dune ocaml merlin dump-config $PWD | grep -i "ppx" | ||
(FLG (-ppx "/MELC_COMPILER -as-ppx")) | ||
(FLG (-ppx "/workspace_root/bin/melc -as-ppx")) | ||
|
||
Dump-dot-merlin includes the melange flags | ||
|
||
$ dune ocaml dump-dot-merlin $PWD | ||
EXCLUDE_QUERY_DIR | ||
STDLIB /MELC_STDLIB/melange | ||
B /MELC_STDLIB/melange | ||
B /MELC_STDLIB/melange | ||
B /MELC_STDLIB/melange | ||
STDLIB /workspace_root/lib/melange/melange | ||
B /workspace_root/lib/melange/belt/melange | ||
B /workspace_root/lib/melange/melange | ||
B /workspace_root/lib/melange/runtime/melange | ||
B $TESTCASE_ROOT/_build/default/.output.mobjs/melange | ||
S /MELC_STDLIB | ||
S /MELC_STDLIB | ||
S /MELC_STDLIB | ||
S /workspace_root/lib/melange | ||
S /workspace_root/lib/melange/belt | ||
S /workspace_root/lib/melange/runtime | ||
S $TESTCASE_ROOT | ||
# FLG -ppx '/MELC_COMPILER -as-ppx' | ||
# FLG -ppx '/workspace_root/bin/melc -as-ppx' | ||
# FLG -w @[email protected]@30..39@[email protected]@[email protected]@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g | ||
|
@@ -123,7 +123,7 @@ Melange ppx should appear after user ppx, so that Merlin applies the former firs | |
|
||
$ dune ocaml merlin dump-config $PWD | grep -v "(B " | grep -v "(S " | ||
Bar | ||
((STDLIB /MELC_STDLIB/melange) | ||
((STDLIB /workspace_root/lib/melange/melange) | ||
(EXCLUDE_QUERY_DIR) | ||
(B | ||
$TESTCASE_ROOT/_build/default/.foo.objs/melange) | ||
|
@@ -136,7 +136,7 @@ Melange ppx should appear after user ppx, so that Merlin applies the former firs | |
--as-ppx | ||
--cookie | ||
'library-name="foo"'")) | ||
(FLG (-ppx "/MELC_COMPILER -as-ppx")) | ||
(FLG (-ppx "/workspace_root/bin/melc -as-ppx")) | ||
(FLG | ||
(-w | ||
@1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 | ||
|
@@ -146,7 +146,7 @@ Melange ppx should appear after user ppx, so that Merlin applies the former firs | |
-keep-locs | ||
-g))) | ||
Foo | ||
((STDLIB /MELC_STDLIB/melange) | ||
((STDLIB /workspace_root/lib/melange/melange) | ||
(EXCLUDE_QUERY_DIR) | ||
(B | ||
$TESTCASE_ROOT/_build/default/.foo.objs/melange) | ||
|
@@ -158,7 +158,7 @@ Melange ppx should appear after user ppx, so that Merlin applies the former firs | |
--as-ppx | ||
--cookie | ||
'library-name="foo"'")) | ||
(FLG (-ppx "/MELC_COMPILER -as-ppx")) | ||
(FLG (-ppx "/workspace_root/bin/melc -as-ppx")) | ||
(FLG | ||
(-w | ||
@1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 | ||
|
@@ -168,7 +168,7 @@ Melange ppx should appear after user ppx, so that Merlin applies the former firs | |
-keep-locs | ||
-g))) | ||
Fooppx | ||
((STDLIB /OCAMLC_WHERE) | ||
((STDLIB /workspace_root/lib/ocaml) | ||
(EXCLUDE_QUERY_DIR) | ||
(B | ||
$TESTCASE_ROOT/_build/default/.fooppx.objs/byte) | ||
|
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
6 changes: 3 additions & 3 deletions
6
test/blackbox-tests/test-cases/merlin/dump-dot-merlin.t/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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
$ ocamlc_where="$(ocamlc -where)" | ||
$ export BUILD_PATH_PREFIX_MAP="/OCAMLC_WHERE=$ocamlc_where:$BUILD_PATH_PREFIX_MAP" | ||
$ export BUILD_PATH_PREFIX_MAP="/workspace_root/lib/ocaml=$ocamlc_where:$BUILD_PATH_PREFIX_MAP" | ||
|
||
$ dune build | ||
$ dune ocaml dump-dot-merlin src\ with\ spaces | ||
EXCLUDE_QUERY_DIR | ||
STDLIB /OCAMLC_WHERE | ||
STDLIB /workspace_root/lib/ocaml | ||
B $TESTCASE_ROOT/_build/default/src with spaces/.foo.eobjs/byte | ||
S $TESTCASE_ROOT/src with spaces | ||
# FLG -pp ''\''$TESTCASE_ROOT/_build/default/p p/pp.exe'\''' | ||
# FLG -w @[email protected]@30..39@[email protected]@[email protected] -strict-sequence -strict-formats -short-paths -keep-locs -g | ||
$ dune ocaml dump-dot-merlin "p p" | ||
EXCLUDE_QUERY_DIR | ||
STDLIB /OCAMLC_WHERE | ||
STDLIB /workspace_root/lib/ocaml | ||
B $TESTCASE_ROOT/_build/default/p p/.pp.eobjs/byte | ||
S $TESTCASE_ROOT/p p | ||
# FLG -w @[email protected]@30..39@[email protected]@[email protected] -strict-sequence -strict-formats -short-paths -keep-locs -g | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ We build the project | |
Verify that merlin configuration was generated... | ||
$ dune ocaml merlin dump-config $PWD | ||
Test | ||
((STDLIB /OCAMLC_WHERE) | ||
((STDLIB /workspace_root/lib/ocaml) | ||
(EXCLUDE_QUERY_DIR) | ||
(B | ||
$TESTCASE_ROOT/_build/default/.foo.objs/byte) | ||
|
@@ -27,7 +27,7 @@ Verify that merlin configuration was generated... | |
-keep-locs | ||
-g))) | ||
Foo | ||
((STDLIB /OCAMLC_WHERE) | ||
((STDLIB /workspace_root/lib/ocaml) | ||
(EXCLUDE_QUERY_DIR) | ||
(B | ||
$TESTCASE_ROOT/_build/default/.foo.objs/byte) | ||
|
@@ -52,7 +52,7 @@ Now we check that both querying from the root and the subfolder works | |
$ FILE411=$PWD/411/test.ml | ||
|
||
$ printf "(4:File%d:%s)" ${#FILE} $FILE | dune ocaml-merlin | sed -E "s/[[:digit:]]+:/\?:/g" | ||
((?:STDLIB?:/OCAMLC_WHERE)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-g))) | ||
((?:STDLIB?:/workspace_root/lib/ocaml)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5[email protected]@[email protected]@[email protected]?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-g))) | ||
|
||
$ printf "(4:File%d:%s)" ${#FILE411} $FILE411 | dune ocaml-merlin | sed -E "s/[[:digit:]]+:/\?:/g" | ||
((?:STDLIB?:/OCAMLC_WHERE)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.test.eobjs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-g))) | ||
((?:STDLIB?:/workspace_root/lib/ocaml)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.test.eobjs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5[email protected]@[email protected]@[email protected]?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-g))) |
Oops, something went wrong.