[ARVADOS] created: 2.1.0-455-gab42005d9

Git user git at public.arvados.org
Fri Feb 19 22:39:22 UTC 2021


        at  ab42005d9a8a4bbfae9d96ce320662a958decfcc (commit)


commit ab42005d9a8a4bbfae9d96ce320662a958decfcc
Author: Ward Vandewege <ward at curii.com>
Date:   Fri Feb 19 17:38:24 2021 -0500

    17417: Add arm64 packages for our Golang components.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/build/run-library.sh b/build/run-library.sh
index 513e8624e..c51dfdf27 100755
--- a/build/run-library.sh
+++ b/build/run-library.sh
@@ -137,6 +137,19 @@ package_go_binary() {
     local description="$1"; shift
     local license_file="${1:-agpl-3.0.txt}"; shift
 
+    for arch in 'amd64' 'arm64'; do
+      package_go_binary_worker "$src_path" "$prog" "$description" "$arch" "$license_file"
+    done
+}
+
+# Usage: package_go_binary services/foo arvados-foo "Compute foo to arbitrary precision" [amd64/arm64] [apache-2.0.txt]
+package_go_binary_worker() {
+    local src_path="$1"; shift
+    local prog="$1"; shift
+    local description="$1"; shift
+    local arch="${1:-amd64}"; shift
+    local license_file="${1:-agpl-3.0.txt}"; shift
+
     if [[ -n "$ONLY_BUILD" ]] && [[ "$prog" != "$ONLY_BUILD" ]]; then
       # arvados-workbench depends on arvados-server at build time, so even when
       # only arvados-workbench is being built, we need to build arvados-server too
@@ -157,9 +170,17 @@ package_go_binary() {
       return 1
     fi
 
-    go get -ldflags "-X git.arvados.org/arvados.git/lib/cmd.version=${go_package_version} -X main.version=${go_package_version}" "git.arvados.org/arvados.git/$src_path"
+    echo "BUILDING ${arch}"
+    GOARCH=${arch} go get -ldflags "-X git.arvados.org/arvados.git/lib/cmd.version=${go_package_version} -X main.version=${go_package_version}" "git.arvados.org/arvados.git/$src_path"
 
     local -a switches=()
+
+    binpath=$GOPATH/bin/${basename}
+    if [[ "${arch}" != "amd64" ]]; then
+      switches+=("-a${arch}")
+      binpath="$GOPATH/bin/linux_${arch}/${basename}"
+    fi
+
     systemd_unit="$WORKSPACE/${src_path}/${prog}.service"
     if [[ -e "${systemd_unit}" ]]; then
         switches+=(
@@ -169,7 +190,7 @@ package_go_binary() {
     fi
     switches+=("$WORKSPACE/${license_file}=/usr/share/doc/$prog/${license_file}")
 
-    fpm_build "${WORKSPACE}/${src_path}" "$GOPATH/bin/${basename}=/usr/bin/${prog}" "${prog}" dir "${go_package_version}" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=${description}" "${switches[@]}"
+    fpm_build "${WORKSPACE}/${src_path}" "$binpath=/usr/bin/${prog}" "${prog}" dir "${go_package_version}" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=${description}" "${switches[@]}"
 }
 
 # Usage: package_go_so lib/foo arvados_foo.so arvados-foo "Arvados foo library"

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list