From 2541a470a403cfd298d4350d652c232fdf82d0fc Mon Sep 17 00:00:00 2001 From: Meng-Yuan Huang Date: Wed, 16 Feb 2022 09:29:11 +0800 Subject: [PATCH 1/4] Add correct busybox binary for arm64 architecture --- busybox_archives.bzl | 8 ++++++-- experimental/busybox/BUILD | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/busybox_archives.bzl b/busybox_archives.bzl index 10eb6c721..d1902e6da 100644 --- a/busybox_archives.bzl +++ b/busybox_archives.bzl @@ -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//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( diff --git a/experimental/busybox/BUILD b/experimental/busybox/BUILD index f2aba29c5..2f22817d0 100644 --- a/experimental/busybox/BUILD +++ b/experimental/busybox/BUILD @@ -10,7 +10,7 @@ load(":commands.bzl", "BUSYBOX_COMMANDS") 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 \ From 82b9a77c8b265919139108dc3f7fa1c000addc34 Mon Sep 17 00:00:00 2001 From: Meng-Yuan Huang Date: Wed, 16 Feb 2022 09:29:11 +0800 Subject: [PATCH 2/4] Add correct busybox binary for arm64 architecture --- busybox_archives.bzl | 8 ++++++-- experimental/busybox/BUILD | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/busybox_archives.bzl b/busybox_archives.bzl index 10eb6c721..d1902e6da 100644 --- a/busybox_archives.bzl +++ b/busybox_archives.bzl @@ -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//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( diff --git a/experimental/busybox/BUILD b/experimental/busybox/BUILD index f2aba29c5..11efae896 100644 --- a/experimental/busybox/BUILD +++ b/experimental/busybox/BUILD @@ -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. [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 \ From 8f7660e83132de4256d4d5c65fb551bd6996db6c Mon Sep 17 00:00:00 2001 From: Meng-Yuan Huang Date: Wed, 16 Feb 2022 22:41:50 +0800 Subject: [PATCH 3/4] * Fix Bazel styling. --- experimental/busybox/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/busybox/BUILD b/experimental/busybox/BUILD index 11efae896..ae5e5b95c 100644 --- a/experimental/busybox/BUILD +++ b/experimental/busybox/BUILD @@ -5,7 +5,7 @@ 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. +# 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. [genrule( name = "busybox_" + arch + "_tar", srcs = ["@busybox_" + arch + "//file"], From 30203445fd31694566604cfb52f06e5048fdff83 Mon Sep 17 00:00:00 2001 From: Meng-Yuan Huang Date: Wed, 16 Feb 2022 23:24:02 +0800 Subject: [PATCH 4/4] Update experimental/busybox/BUILD Co-authored-by: Appu --- experimental/busybox/BUILD | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/experimental/busybox/BUILD b/experimental/busybox/BUILD index ae5e5b95c..28691d566 100644 --- a/experimental/busybox/BUILD +++ b/experimental/busybox/BUILD @@ -4,8 +4,7 @@ load("//:checksums.bzl", "ARCHITECTURES") 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. +# Ppc64le/Arm64 needs special case as there is no direct working binary file available. [genrule( name = "busybox_" + arch + "_tar", srcs = ["@busybox_" + arch + "//file"],