Open abrisco opened 1 month ago
I tried the following diff but ran into more issues downstream
diff --git a/bison/rules/bison_cc_library.bzl b/bison/rules/bison_cc_library.bzl
index bc662af..4038ce5 100644
--- a/bison/rules/bison_cc_library.bzl
+++ b/bison/rules/bison_cc_library.bzl
@@ -54,13 +54,14 @@ def _cc_library(ctx, bison_result):
**compile_kwargs
)
- (cc_linking_context, cc_linking_outputs) = cc_common.create_linking_context_from_compilation_outputs(
- name = ctx.attr.name,
+ cc_linking_outputs = cc_common.link(
actions = ctx.actions,
feature_configuration = cc_feature_configuration,
cc_toolchain = cc_toolchain,
- compilation_outputs = cc_compilation_outputs,
linking_contexts = [cc_deps.linking_context],
+ compilation_outputs = cc_compilation_outputs,
+ name = ctx.label.name,
+ output_type = "dynamic_library",
)
outs = []
@@ -69,6 +70,13 @@ def _cc_library(ctx, bison_result):
if cc_linking_outputs.library_to_link.dynamic_library:
outs.append(cc_linking_outputs.library_to_link.dynamic_library)
+ cc_linking_context = cc_common.create_linking_context(
+ linker_inputs = depset([cc_common.create_linker_input(
+ owner = ctx.label,
+ libraries = depset([cc_linking_outputs.library_to_link]),
+ )]),
+ )
+
return struct(
outs = depset(direct = outs),
cc_info = CcInfo(
Curious why this works on linux but no other platforms.
Reproducible by running
bazel build //tests:hello_c
on the following platforms:Windows
MacOS