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

Set target_cpu in toolchain #327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

keith
Copy link
Member

@keith keith commented Jan 28, 2025

This is currently usable in select statements (which is deprecated but
won't be flipped for 1 year) and also is used internally by bazel for
some paths like _solib_k8. We can derive this from platform configs

This is currently usable in select statements (which is deprecated but
won't be flipped for 1 year) and also is used internally by bazel for
some paths like `_solib_k8`. We can derive this from platform configs
@armandomontanez
Copy link
Collaborator

I'd really prefer we don't carry this one forward, and instead fix any instances that rely on target_cpu to ensure they're controlled through a more future-looking mechanism.

@keith
Copy link
Member Author

keith commented Jan 28, 2025

I agree with that in theory. But given bazel's long deprecation timelines it seems to me that the cost of us carrying it along for a while with a change like this, is very much worth it compared to the migration cost to make sure your transitive closure avoids needing this.

In our moderately sized C++ project at least grpc: grpc/grpc#38319

protobuf: https://github.com/protocolbuffers/protobuf/blob/71c259485c2a40105144c4f0f0d1910a6ae0d169/build_defs/BUILD.bazel#L35-L38

and abseil: https://github.com/abseil/abseil-cpp/pull/1797/files

all use this mechanism. So my thinking is that even if we snapped our fingers and fixed all of today's deprecated uses, it's non-trivial to upgrade these dependencies in any projects that potentially want to use this API.

I'm also quite worried about moving bazel off of this API, here are a few places I found that have been using it forever:

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