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

find_cc_toolchain: Don't fail on missing toolchain if mandatory = False #298

Closed
wants to merge 1 commit into from

Conversation

Yannic
Copy link
Contributor

@Yannic Yannic commented Jan 2, 2025

find_cc_toolchain is sometimes used by helper functions that may not have knowledge of the rule calling them. Making the function not fail if the calling rule did not use use_cc_toolchain() allows callers to avoid checking if CC_TOOLCHAIN_TYPE is in ctx.toolchains before calling find_cc_toolchain.

…False`

`find_cc_toolchain` is sometimes used by helper functions that may not have
knowledge of the rule calling them. Making the function not fail if the calling
rule did not use `use_cc_toolchain()` allows callers to avoid checking if
`CC_TOOLCHAIN_TYPE` is in `ctx.toolchains` before calling `find_cc_toolchain`.
@Yannic
Copy link
Contributor Author

Yannic commented Jan 2, 2025

The test failure looks unrelated

@Yannic
Copy link
Contributor Author

Yannic commented Feb 7, 2025

friendly ping?

@comius
Copy link
Collaborator

comius commented Feb 7, 2025

cc @katre

I don't think mandatory = False should ever work on rules that don't declare C++ toolchains.

@katre
Copy link
Member

katre commented Feb 7, 2025

I agree: mandatory is about whether a toolchain was found to match the platform, not about whether the toolchain type was requested or not.

@comius comius closed this Feb 7, 2025
@Yannic Yannic deleted the fcctc-no-fail-on-missing-decl branch February 7, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants