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

Skylark support for multi-arch ("fat") binaries #5575

Closed
gregestren opened this issue Jul 11, 2018 · 8 comments
Closed

Skylark support for multi-arch ("fat") binaries #5575

gregestren opened this issue Jul 11, 2018 · 8 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Configurability Issues for Configurability team

Comments

@gregestren
Copy link
Contributor

gregestren commented Jul 11, 2018

Part of the Skylark build configuration project.

This is a tracking issue for the ability of Skylark writers to design fat binaries, such as fat Android APKs.

This will eventually replace ad hoc flags like --fat_apk_cpu. In particular, it will make it possible for any rule to create multi-arch dependencies with specific compilation / bundling logic of its choosing.

This complements the Bazel Configurability Roadmap. Write questions / comments / status updates here. See there for the bigger picture.

@jin
Copy link
Member

jin commented Jul 11, 2018

/sub

@gregestren
Copy link
Contributor Author

gregestren commented Jan 28, 2019

2018 EOY update:

This feature is essentially done.

Since we're just easing in this support now in such a tentative way, I'll keep the issue open for now. Interested users / experimenters should ping this thread.

@ixdy
Copy link
Contributor

ixdy commented Feb 3, 2019

multi-arch docker manifest lists are a strong use case for this. bazelbuild/rules_docker#300

@Pensu
Copy link

Pensu commented Aug 7, 2019

Making multi-arch binaries for kubernetes/test-infra repo is also a use case for this. @gregestren Just to get the clarity, according to #5575 (comment), we can use bazel to build multi-arch binaries now? Thanks.

@gregestren
Copy link
Contributor Author

Sorry I missed this last comment.

Yes, bazel can build multi-arch binaries now, with caveats. Specifically you can apply the split but the API for a consuming rule to filter its deps by how they were split (e.g. "give me all the deps that were built for ARM" ) is still incomplete

Check out https://docs.bazel.build/versions/master/skylark/config.html#defining-12-transitions for an example.

@Pensu
Copy link

Pensu commented Oct 12, 2019

Thanks @gregestren. Will try these out.

@buchgr
Copy link
Contributor

buchgr commented Oct 31, 2019

@gregestren I am curious what exactly is missing from the API. There seems to be ctx.split_attr. Is this not sufficient?

Ahh ctx.split_attr ... it doesn't work for split transitions created via Starlark yet.

@gregestren
Copy link
Contributor Author

I think it'll still work if you're splitting just on --cpu. Generalizing that is the main challenge.

juliexxia added a commit to bazelbuild/examples that referenced this issue May 15, 2020
Documentation for bazelbuild/bazel#5575

Note - this logic isn't actually released in bazel yet but I think it's fine to document it prematurely.
@katre katre closed this as completed Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Configurability Issues for Configurability team
Projects
None yet
Development

No branches or pull requests

8 participants