Skip to content

Commit

Permalink
Refactor load path management and initial environment
Browse files Browse the repository at this point in the history
- Add a Load_path module which caches files lookup

- Instead of falling back to the external environment, allow to
  declare in the environment that a module comes from the external
  world. This allows persistent structures to shadows non-persistent
  ones
  • Loading branch information
jeremiedimino authored and dra27 committed Jan 30, 2019
1 parent 2956845 commit 7e0862a
Show file tree
Hide file tree
Showing 57 changed files with 760 additions and 321 deletions.
58 changes: 50 additions & 8 deletions .depend
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ utils/build_path_prefix_map.cmx : \
utils/build_path_prefix_map.cmi :
utils/ccomp.cmo : \
utils/misc.cmi \
utils/load_path.cmi \
utils/config.cmi \
utils/clflags.cmi \
utils/ccomp.cmi
utils/ccomp.cmx : \
utils/misc.cmx \
utils/load_path.cmx \
utils/config.cmx \
utils/clflags.cmx \
utils/ccomp.cmi
Expand Down Expand Up @@ -53,6 +55,13 @@ utils/identifiable.cmx : \
utils/misc.cmx \
utils/identifiable.cmi
utils/identifiable.cmi :
utils/load_path.cmo : \
utils/misc.cmi \
utils/load_path.cmi
utils/load_path.cmx : \
utils/misc.cmx \
utils/load_path.cmi
utils/load_path.cmi :
utils/misc.cmo : \
utils/config.cmi \
utils/build_path_prefix_map.cmi \
Expand Down Expand Up @@ -169,6 +178,7 @@ parsing/ast_mapper.cmo : \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/load_path.cmi \
utils/config.cmi \
utils/clflags.cmi \
parsing/asttypes.cmi \
Expand All @@ -179,6 +189,7 @@ parsing/ast_mapper.cmx : \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
utils/load_path.cmx \
utils/config.cmx \
utils/clflags.cmx \
parsing/asttypes.cmi \
Expand Down Expand Up @@ -438,6 +449,7 @@ typing/cmt_format.cmo : \
typing/tast_mapper.cmi \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
parsing/lexer.cmi \
typing/env.cmi \
utils/config.cmi \
Expand All @@ -450,6 +462,7 @@ typing/cmt_format.cmx : \
typing/tast_mapper.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
parsing/lexer.cmx \
typing/env.cmx \
utils/config.cmx \
Expand Down Expand Up @@ -526,6 +539,7 @@ typing/env.cmo : \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/load_path.cmi \
typing/ident.cmi \
typing/datarepr.cmi \
utils/consistbl.cmi \
Expand All @@ -545,6 +559,7 @@ typing/env.cmx : \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
utils/load_path.cmx \
typing/ident.cmx \
typing/datarepr.cmx \
utils/consistbl.cmx \
Expand All @@ -563,6 +578,7 @@ typing/env.cmi : \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/load_path.cmi \
typing/ident.cmi \
utils/consistbl.cmi \
typing/cmi_format.cmi \
Expand All @@ -573,13 +589,15 @@ typing/envaux.cmo : \
typing/path.cmi \
typing/ident.cmi \
typing/env.cmi \
parsing/asttypes.cmi \
typing/envaux.cmi
typing/envaux.cmx : \
typing/subst.cmx \
typing/printtyp.cmx \
typing/path.cmx \
typing/ident.cmx \
typing/env.cmx \
parsing/asttypes.cmi \
typing/envaux.cmi
typing/envaux.cmi : \
typing/subst.cmi \
Expand Down Expand Up @@ -1387,6 +1405,7 @@ typing/typemod.cmo : \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/load_path.cmi \
typing/includemod.cmi \
typing/ident.cmi \
typing/env.cmi \
Expand Down Expand Up @@ -1418,6 +1437,7 @@ typing/typemod.cmx : \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
utils/load_path.cmx \
typing/includemod.cmx \
typing/ident.cmx \
typing/env.cmx \
Expand Down Expand Up @@ -1623,6 +1643,7 @@ bytecomp/bytegen.cmi : \
bytecomp/bytelibrarian.cmo : \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
bytecomp/emitcode.cmi \
utils/config.cmi \
bytecomp/cmo_format.cmi \
Expand All @@ -1632,6 +1653,7 @@ bytecomp/bytelibrarian.cmo : \
bytecomp/bytelibrarian.cmx : \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
bytecomp/emitcode.cmx \
utils/config.cmx \
bytecomp/cmo_format.cmi \
Expand All @@ -1645,6 +1667,7 @@ bytecomp/bytelink.cmo : \
bytecomp/opcodes.cmo \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
bytecomp/instruct.cmi \
typing/ident.cmi \
bytecomp/emitcode.cmi \
Expand All @@ -1662,6 +1685,7 @@ bytecomp/bytelink.cmx : \
bytecomp/opcodes.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
bytecomp/instruct.cmx \
typing/ident.cmx \
bytecomp/emitcode.cmx \
Expand All @@ -1684,6 +1708,7 @@ bytecomp/bytepackager.cmo : \
typing/path.cmi \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
bytecomp/instruct.cmi \
typing/ident.cmi \
typing/env.cmi \
Expand All @@ -1702,6 +1727,7 @@ bytecomp/bytepackager.cmx : \
typing/path.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
bytecomp/instruct.cmx \
typing/ident.cmx \
typing/env.cmx \
Expand Down Expand Up @@ -1801,6 +1827,7 @@ bytecomp/lambda.cmo : \
typing/primitive.cmi \
typing/path.cmi \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
typing/ident.cmi \
typing/env.cmi \
Expand All @@ -1811,6 +1838,7 @@ bytecomp/lambda.cmx : \
typing/primitive.cmx \
typing/path.cmx \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
typing/ident.cmx \
typing/env.cmx \
Expand Down Expand Up @@ -2134,7 +2162,6 @@ bytecomp/translmod.cmo : \
typing/path.cmi \
typing/mtype.cmi \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
bytecomp/lambda.cmi \
typing/ident.cmi \
Expand All @@ -2156,7 +2183,6 @@ bytecomp/translmod.cmx : \
typing/path.cmx \
typing/mtype.cmx \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
bytecomp/lambda.cmx \
typing/ident.cmx \
Expand All @@ -2174,7 +2200,6 @@ bytecomp/translmod.cmi : \
bytecomp/translobj.cmo : \
typing/primitive.cmi \
utils/misc.cmi \
parsing/longident.cmi \
parsing/location.cmi \
bytecomp/lambda.cmi \
typing/ident.cmi \
Expand All @@ -2187,7 +2212,6 @@ bytecomp/translobj.cmo : \
bytecomp/translobj.cmx : \
typing/primitive.cmx \
utils/misc.cmx \
parsing/longident.cmx \
parsing/location.cmx \
bytecomp/lambda.cmx \
typing/ident.cmx \
Expand Down Expand Up @@ -2393,6 +2417,7 @@ asmcomp/asmgen.cmi : \
asmcomp/asmlibrarian.cmo : \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
asmcomp/export_info.cmi \
utils/config.cmi \
asmcomp/compilenv.cmi \
Expand All @@ -2405,6 +2430,7 @@ asmcomp/asmlibrarian.cmo : \
asmcomp/asmlibrarian.cmx : \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
asmcomp/export_info.cmx \
utils/config.cmx \
asmcomp/compilenv.cmx \
Expand All @@ -2420,6 +2446,7 @@ asmcomp/asmlink.cmo : \
utils/profile.cmi \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
asmcomp/emitaux.cmi \
asmcomp/emit.cmi \
utils/consistbl.cmi \
Expand All @@ -2437,6 +2464,7 @@ asmcomp/asmlink.cmx : \
utils/profile.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
asmcomp/emitaux.cmx \
asmcomp/emit.cmx \
utils/consistbl.cmx \
Expand All @@ -2458,6 +2486,7 @@ asmcomp/asmpackager.cmo : \
utils/misc.cmi \
middle_end/middle_end.cmi \
parsing/location.cmi \
utils/load_path.cmi \
bytecomp/lambda.cmi \
typing/ident.cmi \
asmcomp/export_info_for_pack.cmi \
Expand All @@ -2479,6 +2508,7 @@ asmcomp/asmpackager.cmx : \
utils/misc.cmx \
middle_end/middle_end.cmx \
parsing/location.cmx \
utils/load_path.cmx \
bytecomp/lambda.cmx \
typing/ident.cmx \
asmcomp/export_info_for_pack.cmx \
Expand Down Expand Up @@ -2781,6 +2811,7 @@ asmcomp/compilenv.cmo : \
typing/path.cmi \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
middle_end/base_types/linkage_name.cmi \
typing/ident.cmi \
asmcomp/export_info.cmi \
Expand All @@ -2800,6 +2831,7 @@ asmcomp/compilenv.cmx : \
typing/path.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
middle_end/base_types/linkage_name.cmx \
typing/ident.cmx \
asmcomp/export_info.cmx \
Expand Down Expand Up @@ -5408,6 +5440,7 @@ driver/compmisc.cmo : \
typing/typemod.cmi \
utils/misc.cmi \
parsing/location.cmi \
utils/load_path.cmi \
typing/ident.cmi \
typing/env.cmi \
utils/config.cmi \
Expand All @@ -5419,6 +5452,7 @@ driver/compmisc.cmx : \
typing/typemod.cmx \
utils/misc.cmx \
parsing/location.cmx \
utils/load_path.cmx \
typing/ident.cmx \
typing/env.cmx \
utils/config.cmx \
Expand All @@ -5429,18 +5463,16 @@ driver/compmisc.cmi : \
typing/env.cmi \
utils/clflags.cmi
driver/compplugin.cmo : \
utils/misc.cmi \
parsing/location.cmi \
utils/config.cmi \
utils/load_path.cmi \
driver/compmisc.cmi \
driver/compenv.cmi \
driver/compdynlink.cmi \
utils/clflags.cmi \
driver/compplugin.cmi
driver/compplugin.cmx : \
utils/misc.cmx \
parsing/location.cmx \
utils/config.cmx \
utils/load_path.cmx \
driver/compmisc.cmx \
driver/compenv.cmx \
driver/compdynlink.cmi \
Expand Down Expand Up @@ -5702,6 +5734,8 @@ toplevel/opttopdirs.cmo : \
toplevel/opttoploop.cmi \
utils/misc.cmi \
parsing/longident.cmi \
utils/load_path.cmi \
typing/ident.cmi \
typing/env.cmi \
typing/ctype.cmi \
utils/config.cmi \
Expand All @@ -5716,6 +5750,8 @@ toplevel/opttopdirs.cmx : \
toplevel/opttoploop.cmx \
utils/misc.cmx \
parsing/longident.cmx \
utils/load_path.cmx \
typing/ident.cmx \
typing/env.cmx \
typing/ctype.cmx \
utils/config.cmx \
Expand Down Expand Up @@ -5750,6 +5786,7 @@ toplevel/opttoploop.cmo : \
middle_end/middle_end.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/load_path.cmi \
parsing/lexer.cmi \
bytecomp/lambda.cmi \
typing/includemod.cmi \
Expand Down Expand Up @@ -5795,6 +5832,7 @@ toplevel/opttoploop.cmx : \
middle_end/middle_end.cmx \
parsing/longident.cmx \
parsing/location.cmx \
utils/load_path.cmx \
parsing/lexer.cmx \
bytecomp/lambda.cmx \
typing/includemod.cmx \
Expand Down Expand Up @@ -5869,6 +5907,7 @@ toplevel/topdirs.cmo : \
bytecomp/meta.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/load_path.cmi \
typing/ident.cmi \
typing/env.cmi \
bytecomp/dll.cmi \
Expand Down Expand Up @@ -5897,6 +5936,7 @@ toplevel/topdirs.cmx : \
bytecomp/meta.cmx \
parsing/longident.cmx \
parsing/location.cmx \
utils/load_path.cmx \
typing/ident.cmx \
typing/env.cmx \
bytecomp/dll.cmx \
Expand Down Expand Up @@ -5938,6 +5978,7 @@ toplevel/toploop.cmo : \
bytecomp/meta.cmi \
parsing/longident.cmi \
parsing/location.cmi \
utils/load_path.cmi \
parsing/lexer.cmi \
typing/includemod.cmi \
typing/ident.cmi \
Expand Down Expand Up @@ -5982,6 +6023,7 @@ toplevel/toploop.cmx : \
bytecomp/meta.cmx \
parsing/longident.cmx \
parsing/location.cmx \
utils/load_path.cmx \
parsing/lexer.cmx \
typing/includemod.cmx \
typing/ident.cmx \
Expand Down
7 changes: 7 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ OCaml 4.08.0
(Alban Reynaud and Gabriel Scherer,
review by Jeremy Yallop and Armaël Guéneau)

* MPR#7814, GPR#2041: allow modules from include directories to shadow
other ones, even in the toplevel
(Jérémie Dimino, review by Alain Frisch and David Allsopp)

### Standard library:

- GPR#2128: Add Fun module.
Expand Down Expand Up @@ -606,6 +610,9 @@ OCaml 4.08.0
for parser testing. See parsing/HACKING.adoc.
(Gabriel Scherer, review by Nicolás Ojeda Bär)

* GPR#2041: add a cache for looking up files in the load path
(Jérémie Dimino, review by Alain Frisch and David Allsopp)

- GPR#2047: a new type for unification traces
(Florian Angeletti, review by Thomas Refis and Gabriel Scherer)

Expand Down
Loading

0 comments on commit 7e0862a

Please sign in to comment.