diff --git a/prelude/ocaml/ocaml.bzl b/prelude/ocaml/ocaml.bzl index 99694ff4..7afc804b 100644 --- a/prelude/ocaml/ocaml.bzl +++ b/prelude/ocaml/ocaml.bzl @@ -96,7 +96,7 @@ load("@prelude//utils:graph_utils.bzl", "breadth_first_traversal", "post_order_t load("@prelude//utils:platform_flavors_util.bzl", "by_platform") load("@prelude//utils:utils.bzl", "filter_and_map_idx", "flatten") load(":makefile.bzl", "parse_makefile") -load(":ocaml_toolchain_types.bzl", "OCamlLibraryInfo", "OCamlLinkInfo", "OCamlToolchainInfo", "OcamlIdeInfo", "OtherOutputsInfo", "merge_ocaml_link_infos", "merge_other_outputs_info") +load(":ocaml_toolchain_types.bzl", "OCamlLibraryInfo", "OCamlLinkInfo", "OCamlToolchainInfo", "OtherOutputsInfo", "merge_ocaml_link_infos", "merge_other_outputs_info") BuildMode = enum("native", "bytecode", "expand") @@ -688,8 +688,9 @@ def ocaml_library_impl(ctx: AnalysisContext) -> list[Provider]: other_outputs_info = merge_other_outputs_info(ctx, other_outputs, _attr_deps_other_outputs_infos(ctx)) info_ide = [ - OcamlIdeInfo( - outputs = [cmd_args(other_outputs_info.info.project_as_args("ide"))], + DefaultInfo( + default_output = cmts_nat[0] if cmts_nat else None, + other_outputs = [cmd_args(other_outputs_info.info.project_as_args("ide"))], ), ] info_byt = [ @@ -783,6 +784,7 @@ def ocaml_binary_impl(ctx: AnalysisContext) -> list[Provider]: info_ide = [ DefaultInfo( + default_output = cmts_nat[0] if cmts_nat else None, other_outputs = [cmd_args(other_outputs_info.info.project_as_args("ide"))], ), ] @@ -874,7 +876,7 @@ def ocaml_object_impl(ctx: AnalysisContext) -> list[Provider]: info_ide = [ DefaultInfo( - default_output = obj, + default_output = cmts[0] if cmts else None, other_outputs = [cmd_args(other_outputs_info.info.project_as_args("ide"))], ), ] @@ -956,7 +958,7 @@ def ocaml_shared_impl(ctx: AnalysisContext) -> list[Provider]: info_ide = [ DefaultInfo( - default_output = binary_nat, + default_output = cmts_nat[0] if cmts_nat else None, other_outputs = [cmd_args(other_outputs_info.info.project_as_args("ide"))], ), ] diff --git a/prelude/ocaml/ocaml_toolchain_types.bzl b/prelude/ocaml/ocaml_toolchain_types.bzl index f301a29d..de38f9e8 100644 --- a/prelude/ocaml/ocaml_toolchain_types.bzl +++ b/prelude/ocaml/ocaml_toolchain_types.bzl @@ -58,12 +58,6 @@ OCamlLinkInfo = provider( fields = {"info": provider_field(typing.Any, default = None)}, ) -OcamlIdeInfo = provider( - fields = { - "outputs": provider_field(typing.Any, default = []), - }, -) - # A record of an OCaml library. OCamlLibraryInfo = record( # The library target name: e.g. "`foo`"