-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(melange): account for preprocessing when getting library's Module…
…s.t during emission (#10297) * test: show melange.emit regression attempting to read wrong ocamldep result Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * fix: read the processed file in Ocamldep.read_immediate_deps_of Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> * fix(virtual_lib_compilation_test): only add dependency if impl exists Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com> --------- Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
- Loading branch information
1 parent
3a4ce9c
commit f9950b2
Showing
3 changed files
with
179 additions
and
110 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
43 changes: 43 additions & 0 deletions
43
test/blackbox-tests/test-cases/melange/unexpected-ocamldep-output.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,43 @@ | ||
Show that `melange.emit` + correct dependency tracking reads the processed | ||
file after any dialects have run | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.11) | ||
> (using melange 0.1) | ||
> (dialect | ||
> (name myd) | ||
> (implementation | ||
> (preprocess (run cat %{input-file})) | ||
> (extension myd))) | ||
> EOF | ||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (alias mel) | ||
> (libraries foo) | ||
> (emit_stdlib false)) | ||
> EOF | ||
$ mkdir lib | ||
$ cat > lib/dune <<EOF | ||
> (library | ||
> (name foo) | ||
> (modes melange)) | ||
> EOF | ||
$ cat > lib/foo.myd <<EOF | ||
> let name = Bar.name | ||
> EOF | ||
$ cat > lib/bar.ml <<EOF | ||
> let name = "Zoe" | ||
> EOF | ||
$ dune build @mel | ||
|
||
Now try preprocessing too | ||
|
||
$ dune clean | ||
$ cat > lib/dune <<EOF | ||
> (library | ||
> (name foo) | ||
> (preprocess (action (run cat %{input-file}))) | ||
> (modes melange)) | ||
> EOF | ||
$ dune build @mel |