diff --git a/src/dune_rules/artifacts.ml b/src/dune_rules/artifacts.ml index d3efc20a3b1..87668448807 100644 --- a/src/dune_rules/artifacts.ml +++ b/src/dune_rules/artifacts.ml @@ -93,6 +93,9 @@ type t = ; bin : Bin.t } +let bin t = t.bin +let public_libs t = t.public_libs + let create (context : Context.t) ~public_libs ~local_bins = { public_libs = Public_libs.create ~context ~public_libs ; bin = Bin.create ~context ~local_bins diff --git a/src/dune_rules/artifacts.mli b/src/dune_rules/artifacts.mli index cb30a1e7b82..7d66a6ada98 100644 --- a/src/dune_rules/artifacts.mli +++ b/src/dune_rules/artifacts.mli @@ -36,9 +36,8 @@ module Public_libs : sig } end -type t = private - { public_libs : Public_libs.t - ; bin : Bin.t - } +type t +val bin : t -> Bin.t +val public_libs : t -> Public_libs.t val create : Context.t -> public_libs:Lib.DB.t -> local_bins:Bin.Local.t Memo.Lazy.t -> t diff --git a/src/dune_rules/super_context.ml b/src/dune_rules/super_context.ml index 4530b482941..6621fec3a63 100644 --- a/src/dune_rules/super_context.ml +++ b/src/dune_rules/super_context.ml @@ -437,7 +437,7 @@ let make_default_env_node ~expander_for_artifacts ~default_context_flags ~default_env:root_env - ~default_bin_artifacts:artifacts.bin + ~default_bin_artifacts:(Artifacts.bin artifacts) ~default_bin_annot:true in make @@ -504,9 +504,9 @@ let create ~(context : Context.t) ~(host : t option) ~packages ~stanzas = ~scope_host ~context ~env:expander_env - ~lib_artifacts:artifacts.public_libs - ~bin_artifacts_host:artifacts_host.bin - ~lib_artifacts_host:artifacts_host.public_libs + ~lib_artifacts:(Artifacts.public_libs artifacts) + ~bin_artifacts_host:(Artifacts.bin artifacts_host) + ~lib_artifacts_host:(Artifacts.public_libs artifacts_host) and+ root_env = add_packages_env (Context.name context) ~base:expander_env stanzas packages in @@ -529,7 +529,7 @@ let create ~(context : Context.t) ~(host : t option) ~packages ~stanzas = ~default_env ~host_env_tree:host ~root_expander - ~bin_artifacts:artifacts.bin + ~bin_artifacts:(Artifacts.bin artifacts) ~context_env:root_env ;;