Merge pull request #444 from rgrinberg/reproduce-scope-bug
META generation bug in different scopes
This commit is contained in:
commit
fde877838b
|
@ -199,7 +199,7 @@ let ppx_runtime_deps_for_deprecated_method_exn t ~dir lib_deps =
|
||||||
let lib_is_available name =
|
let lib_is_available name =
|
||||||
String_set.mem name !seen || lib_is_available t ~from:dir name
|
String_set.mem name !seen || lib_is_available t ~from:dir name
|
||||||
in
|
in
|
||||||
let rec loop lib_dep =
|
let rec loop dir lib_dep =
|
||||||
match lib_dep with
|
match lib_dep with
|
||||||
| Lib_dep.Direct name ->
|
| Lib_dep.Direct name ->
|
||||||
if not (String_set.mem name !seen) then begin
|
if not (String_set.mem name !seen) then begin
|
||||||
|
@ -227,7 +227,7 @@ let ppx_runtime_deps_for_deprecated_method_exn t ~dir lib_deps =
|
||||||
| None -> Loc.fail loc "No solution found for this select form"
|
| None -> Loc.fail loc "No solution found for this select form"
|
||||||
and process (lib : Lib.t) =
|
and process (lib : Lib.t) =
|
||||||
match lib with
|
match lib with
|
||||||
| Internal (_, lib) ->
|
| Internal (dir, lib) ->
|
||||||
seen :=
|
seen :=
|
||||||
(let set = String_set.add lib.name !seen in
|
(let set = String_set.add lib.name !seen in
|
||||||
match lib.public with
|
match lib.public with
|
||||||
|
@ -235,14 +235,14 @@ let ppx_runtime_deps_for_deprecated_method_exn t ~dir lib_deps =
|
||||||
| Some p -> String_set.add p.name set);
|
| Some p -> String_set.add p.name set);
|
||||||
result := String_set.union !result
|
result := String_set.union !result
|
||||||
(String_set.of_list lib.ppx_runtime_libraries);
|
(String_set.of_list lib.ppx_runtime_libraries);
|
||||||
List.iter lib.buildable.libraries ~f:loop
|
List.iter lib.buildable.libraries ~f:(loop dir)
|
||||||
| External pkg ->
|
| External pkg ->
|
||||||
seen := String_set.add pkg.name !seen;
|
seen := String_set.add pkg.name !seen;
|
||||||
result := String_set.union !result
|
result := String_set.union !result
|
||||||
(String_set.of_list
|
(String_set.of_list
|
||||||
(List.map pkg.ppx_runtime_deps ~f:(fun p -> p.Findlib.name)))
|
(List.map pkg.ppx_runtime_deps ~f:(fun p -> p.Findlib.name)))
|
||||||
in
|
in
|
||||||
List.iter lib_deps ~f:loop;
|
List.iter lib_deps ~f:(loop dir);
|
||||||
!result
|
!result
|
||||||
|
|
||||||
type resolved_select =
|
type resolved_select =
|
||||||
|
|
|
@ -257,3 +257,13 @@
|
||||||
(progn
|
(progn
|
||||||
(run ${exe:cram.exe} run.t)
|
(run ${exe:cram.exe} run.t)
|
||||||
(diff? run.t run.t.corrected)))))))
|
(diff? run.t run.t.corrected)))))))
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest)
|
||||||
|
(deps ((files_recursively_in test-cases/scope-bug)))
|
||||||
|
(action
|
||||||
|
(chdir test-cases/scope-bug
|
||||||
|
(setenv JBUILDER ${bin:jbuilder}
|
||||||
|
(progn
|
||||||
|
(run ${exe:cram.exe} run.t)
|
||||||
|
(diff? run.t run.t.corrected)))))))
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
(jbuild_version 1)
|
||||||
|
|
||||||
|
(library
|
||||||
|
((name alib)
|
||||||
|
(public_name alib)
|
||||||
|
(libraries (blib))))
|
|
@ -0,0 +1,6 @@
|
||||||
|
(jbuild_version 1)
|
||||||
|
|
||||||
|
(library
|
||||||
|
((name blib)
|
||||||
|
(public_name blib)
|
||||||
|
(libraries (sub))))
|
|
@ -0,0 +1,5 @@
|
||||||
|
(jbuild_version 1)
|
||||||
|
|
||||||
|
(library
|
||||||
|
((name sub)
|
||||||
|
(public_name blib.sub)))
|
|
@ -0,0 +1,23 @@
|
||||||
|
$ $JBUILDER build -j1 --root . @install
|
||||||
|
ocamldep alib/alib.depends.ocamldep-output
|
||||||
|
ocamlc alib/alib__.{cmi,cmo,cmt}
|
||||||
|
ocamldep blib/blib.depends.ocamldep-output
|
||||||
|
ocamldep blib/sub/sub.depends.ocamldep-output
|
||||||
|
ocamlopt alib/alib__.{cmx,o}
|
||||||
|
ocamlc blib/sub/sub.{cmi,cmo,cmt}
|
||||||
|
ocamlopt blib/sub/sub.{cmx,o}
|
||||||
|
ocamlc blib/blib.{cmi,cmo,cmt}
|
||||||
|
ocamlc blib/sub/sub.cma
|
||||||
|
ocamlopt blib/sub/sub.{a,cmxa}
|
||||||
|
ocamlopt blib/blib.{cmx,o}
|
||||||
|
ocamlc alib/alib.{cmi,cmo,cmt}
|
||||||
|
ocamlc alib/alib__Main.{cmi,cmo,cmt}
|
||||||
|
ocamlc blib/blib.cma
|
||||||
|
ocamlopt blib/sub/sub.cmxs
|
||||||
|
ocamlopt blib/blib.{a,cmxa}
|
||||||
|
ocamlopt alib/alib.{cmx,o}
|
||||||
|
ocamlopt alib/alib__Main.{cmx,o}
|
||||||
|
ocamlc alib/alib.cma
|
||||||
|
ocamlopt blib/blib.cmxs
|
||||||
|
ocamlopt alib/alib.{a,cmxa}
|
||||||
|
ocamlopt alib/alib.cmxs
|
Loading…
Reference in New Issue