Skip to content

Conversation

@jhance
Copy link

@jhance jhance commented Apr 17, 2025

This mirrors behavior of rules_cc enabling things like -I$(GENDIR)/external/foo for when you need to reference a generated header.

This mirrors behavior of rules_cc enabling things like
`-I$(GENDIR)/external/foo` for when you need to reference a generated
header.
@cloudhan
Copy link
Collaborator

Could you please also add a testcase? See https://github.com/bazel-contrib/rules_cuda/blob/main/tests/flag/BUILD.bazel

@jhance
Copy link
Author

jhance commented Apr 18, 2025

Sure, but the nature of this means that I would have to hardcode an expansion that is dependent on the configuration you are running the test, right?

@cloudhan
Copy link
Collaborator

hardcode an expansion

Yes. You can control the TARGET_CPU and COMPILATION_MODE to construct a test case. see https://github.com/bazel-contrib/rules_cuda/blob/main/tests/flag/flag_validation_test.bzl on how to control them.

Also, expand_make_variables is marked as deprecated, it there any modern alternative?

@jhance
Copy link
Author

jhance commented May 10, 2025

Upstream deprecated it without replacement, see bazelbuild/bazel#5859. I am confused as to why it is deprecated.

It looks like rules_cc implemented a tokenizer in starlark to avoid this? That's hardly reasonable/better.

The alternative would be to use {} and .format() but then the way you specify the strings would be different between cuda and cc library

@cloudhan
Copy link
Collaborator

Can you fix the CI failures, seems everyone is relying on the deprecated feature, as long as it is not removed.

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.

2 participants