Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user archiver flags into C++ toolchains #22862

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Fil-Den
Copy link

@Fil-Den Fil-Den commented Jun 23, 2024

Closes: #22861.

@github-actions github-actions bot added team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Jun 23, 2024
@keith
Copy link
Member

keith commented Jun 23, 2024

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

@Fil-Den
Copy link
Author

Fil-Den commented Jun 24, 2024

@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
    },
)

@keith
Copy link
Member

keith commented Jun 24, 2024

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

@Fil-Den
Copy link
Author

Fil-Den commented Jun 26, 2024

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

@keith
Copy link
Member

keith commented Jun 26, 2024

Yea probably @pzembrod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++] Custom user flags to archiver call
2 participants