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

apple_common.multi_arch_split should transition on platforms instead of crosstool #767

Open
steeve opened this issue Apr 21, 2020 · 5 comments

Comments

@steeve
Copy link
Contributor

steeve commented Apr 21, 2020

Description of the problem / feature request:

Let apple_common.multi_arch_split transition on platforms/constraints instead of crosstool_top/cpu.

Feature requests: what underlying problem are you trying to solve with this feature?

According to osx_archs.bzl, Apple toolchains are already constraint aware and thus can be selected by specifying a platform.

However, according to AppleCrosstoolTransition, apple_common.multi_arch_split is still implemented by transiting crosstool_top and cpu instead of platforms.

This creates weird cases for downstream rules which have to transition on crosstool_top/cpu instead of letting the constraints apply directly to their toolchains as well.
For instance, rules could expose CcInfo and thus be used as dependencies of a rule using multi_arch_split.
See bazel-contrib/rules_go#2451.

Looking at rules_apple, I see the starlark transitions are are implemented but apple_common.multi_arch_split is still used.

What operating system are you running Bazel on?

macOS

What's the output of bazel info release?

release 3.0.0

Any other information, logs, or outputs that you want to share?

  1. Add automatic platform detection from inbound crosstool_top and cpu bazel-contrib/rules_go#2451
@aiuto
Copy link

aiuto commented Apr 22, 2020

cc: @katre maybe we should track this too?

@jmmv
Copy link

jmmv commented Apr 23, 2020

This looks like an incomplete dup of bazelbuild/bazel#11181. Am I reading things wrong? If yes, the differences are very subtle...

@steeve
Copy link
Contributor Author

steeve commented Apr 23, 2020

@jmmv github's been having issues for the last 3 days, and I think it created the ticket twice when I was updating it. I'll close bazelbuild/bazel#11181 and update this one. Sorry for the noise.

(or maybe the issue was the chair-keyboard interface of my computer)

@katre
Copy link
Member

katre commented Apr 23, 2020

The work here is larger than just multi_arch_split: almost all of the Apple rules need to switch away from using --cpu and --crosstool_top and to using --platforms.

@jmmv jmmv transferred this issue from bazelbuild/bazel May 7, 2020
@UebelAndre
Copy link

Any updates here?

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

No branches or pull requests

5 participants