bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Add user archiver flags into C++ toolchains

Open Fil-Den opened this issue 1 year ago • 5 comments

Closes: #22861.

Fil-Den avatar Jun 23 '24 09:06 Fil-Den

how are these set? I don't see user_archiver_flags referenced anywhere else?

keith avatar Jun 23 '24 22:06 keith

@keith, I can use it by calling create_linking_context_from_compilation_outputs with the variables_extension argument. Code will looks like:

(linking_context, linking_outputs) = cc_common.create_linking_context_from_compilation_outputs(
    name = output_name,
    actions = ctx.actions,
    feature_configuration = feature_configuration,
    cc_toolchain = cc_toolchain,
    language = "c++",
    compilation_outputs = compilation_outputs,
    linking_contexts = [compilation_cc_info.linking_context],
    disallow_dynamic_library = True,
    variables_extension = {
        "user_archiver_flags": user_link_flags
    },
)

Fil-Den avatar Jun 24 '24 06:06 Fil-Den

ah cool. I think the google folks will have to look at this. they might ask for a test here, or a general way for folks to pass this who aren't calling that function directly

keith avatar Jun 24 '24 17:06 keith

@keith, do we wait for someone else to review this PR?

Fil-Den avatar Jun 26 '24 15:06 Fil-Den

Yea probably @pzembrod

keith avatar Jun 26 '24 15:06 keith

@pzembrod, can you take a look at the PR?

Fil-Den avatar Jul 04 '24 14:07 Fil-Den