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 support for external_includes #267

Closed
wants to merge 6 commits into from
Closed

Conversation

layus
Copy link

@layus layus commented Aug 13, 2024

With this PR I get a strange error about forbidden internal API.

Fixes #266

@cloudhan
Copy link
Collaborator

Seems comming from here https://togithub.com/bazelbuild/bazel/blob/3324f06cbd55ffadd497ca21e94ddb30a7675898/src/main/starlark/builtins_bzl/common/cc/cc_common.bzl#L454

@cloudhan
Copy link
Collaborator

cloudhan commented Aug 14, 2024

There is a chain of something like external_includes != _UNBOUND or \, and the external_includes triggers the forbidden internal API..., looking into the _PRIVATE_STARLARKIFICATION_ALLOWLIST and you will notice that they are doing really dumb things and violate the open–closed principle by hardcoding the rule name... 🤦

@layus
Copy link
Author

layus commented Aug 14, 2024

So it seems that external_includes are part of the internal API, and we are not supposed to use them. Maybe there is a way to merge compilation contexts without tearing it apart and recreating it like we do here ?

For now, I found a simple hotfix:

cuda_library(
    ...
    features = ["-external_include_paths"],
)

@layus layus closed this Aug 14, 2024
@cloudhan
Copy link
Collaborator

I think it is workaroundable, you might just want to consume the external_includes (direct on the target or from deps), but dont propagate it forward by the cc_info.

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.

rules_cuda ignores external_includes field in compilation context
2 participants