bazel icon indicating copy to clipboard operation
bazel copied to clipboard

TARGET_CPU values inconsistent on Linux, OS X

Open kayasoze opened this issue 11 years ago • 7 comments

x86-64-linux $ ./output/bazel info --show_make_env | grep TARGET_CPU TARGET_CPU: local

darwin $ ./output/bazel info --show_make_env | grep TARGET_CPU TARGET_CPU: darwin

I would have expected TARGET_CPU on x86-64 Linux to be 'k8'. I would like to use $(TARGET_CPU) to reference platform specific source directories, but 'local' is too generic for this purpose.

kayasoze avatar Apr 13 '15 23:04 kayasoze

If you use select(), you can name the directories however you like, and have the select map from the bazel name to the actual name. I'd expect a lot of people to use gnu triplets.

That said, what we currently use for 'cpu' is terrible, and we have plans to revamp this entirely.

On Tue, Apr 14, 2015 at 1:40 AM, kayasoze [email protected] wrote:

x86-64-linux $ ./output/bazel info --show_make_env | grep TARGET_CPU TARGET_CPU: local

darwin $ ./output/bazel info --show_make_env | grep TARGET_CPU TARGET_CPU: darwin

I would have expected TARGET_CPU on x86-64 Linux to be 'k8'. I would like to use $(TARGET_CPU) to reference platform specific source directories, but 'local' is too generic for this purpose.

— Reply to this email directly or view it on GitHub https://github.com/google/bazel/issues/119.

ulfbot avatar Apr 14 '15 06:04 ulfbot

@katre Will this still be an issue when platforms/toolchains are complete?

davidstanke avatar Mar 05 '18 15:03 davidstanke

In the very long term, as we remove uses for the --cpu flag, yes, but that's not going to be anytime soon.

katre avatar Mar 05 '18 15:03 katre

I am currently getting 'k8' on linux - is this complete?

riking avatar Aug 19 '19 03:08 riking

No, we still are not ready to deprecate the --cpu flag or the target_cpu value.

katre avatar Aug 19 '19 11:08 katre

Should we close this as obsolete because so much has changed?

aiuto avatar Jan 23 '22 01:01 aiuto

SGTM

katre avatar Jan 24 '22 14:01 katre