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

Add correct busybox binary for arm64 architecture #960

Merged
merged 5 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions busybox_archives.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ def repositories():
urls = ["https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-armv7l"],
)

# To update arm64 busybox binary (#657)
# Get the latest commit hash from dist-arm64v8 branch of docker-library repo.
# Substitute it in the link: https://github.com/docker-library/busybox/raw/<latest-commit-hash>/stable/musl/busybox.tar.xz
# Update the sha256 value. Since github api doesn't give sha256 value, it can be obtained using sha256sum command.
http_file(
name = "busybox_arm64",
executable = True,
sha256 = "141adb1b625a6f44c4b114f76b4387b4ea4f7ab802b88eb40e0d2f6adcccb1c3",
urls = ["https://busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-armv8l"],
sha256 = "02033a50ef38a32a72b4b28183654116c42dae61ec9dccb349f9f63c6ae30f53",
urls = ["https://github.com/docker-library/busybox/raw/22bb23a2665eefb1520dc4c99d5ac9bdf87ae93b/stable/musl/busybox.tar.xz"],
)

http_file(
Expand Down
3 changes: 2 additions & 1 deletion experimental/busybox/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ load(":commands.bzl", "BUSYBOX_COMMANDS")

# This works for all architectures because it is just files.
# Ppc64le needs special case as there is no direct working binary file available.
# Like Ppc64le, Arm64 also uses busybox from https://github.com/docker-library/busybox to work around the arm64 compatibility problem of busybox-armv8l from busybox.net.
MrMYHuang marked this conversation as resolved.
Show resolved Hide resolved
[genrule(
name = "busybox_" + arch + "_tar",
srcs = ["@busybox_" + arch + "//file"],
outs = ["busybox_" + arch + ".tar"],
cmd = "mkdir busybox; cp $(<) busybox/busybox; cd busybox; \
if [[ $(<) == *ppc64le* ]]; then \
if [[ $(<) == *ppc64le* || $(<) == *arm64* ]]; then \
tar -xf busybox ./bin && mv -f ./bin/busybox . && rm -rf ./bin; \
fi; \
for cmd in %s; do \
Expand Down