17417: fix bug to enable arm64 cross-compilation on amd64 for our go
authorWard Vandewege <ward@curii.com>
Wed, 5 Jan 2022 01:11:43 +0000 (20:11 -0500)
committerWard Vandewege <ward@curii.com>
Wed, 5 Jan 2022 18:55:24 +0000 (13:55 -0500)
       packages. Also make sure package testing works (at least for
       amd64).

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

build/run-build-packages-one-target.sh
build/run-library.sh

index f208963832444144a3bad57b502f53245be50359..0c474d00fde7bd935dc97492462e8fbc29829b9b 100755 (executable)
@@ -170,7 +170,7 @@ if [[ -n "$test_packages" ]]; then
     fi
     set -e
     (cd $WORKSPACE/packages/$TARGET
-      dpkg-scanpackages .  2> >(grep -v 'warning' 1>&2) | tee Packages | gzip -c > Packages.gz
+      dpkg-scanpackages --multiversion .  2> >(grep -v 'warning' 1>&2) | tee Packages | gzip -c > Packages.gz
       apt-ftparchive -o APT::FTPArchive::Release::Origin=Arvados release . > Release
     )
   fi
index ed3211c2a13e0aca82248e41821c731152bc0541..3434f1ae897b82bdd105e73570ae43ecd83e8b5a 100755 (executable)
@@ -183,12 +183,12 @@ package_go_binary() {
     # but only when building deb packages (centos does not have support for crosscompiling userspace).
     archs=($native_arch)
     if [[ "$native_arch" == "amd64" ]] && [[ "$package_format" == "deb" ]]; then
-      archs=('amd64' 'arm64')
+      archs+=("arm64")
     fi
-    for ta in $archs; do
+    for ta in ${archs[@]}; do
       package_go_binary_worker "$src_path" "$prog" "$package_format" "$description" "$native_arch" "$ta" "$license_file"
       retval=$?
-      if [[ "$retval" != 0 ]]; then
+      if [[ $retval -ne 0 ]]; then
         return $retval
       fi
     done
@@ -216,8 +216,8 @@ package_go_binary_worker() {
 
     cd $WORKSPACE/packages/$TARGET
     test_package_presence "$prog" "$go_package_version" "go" "" "$target_arch"
-    if [[ "$?" != "0" ]]; then
-      return 1
+    if [[ $? -ne 0 ]]; then
+      return 0
     fi
 
     echo "Building $package_format ($target_arch) package for $prog from $src_path"