- if [[ -n "$ONLY_ARCH" ]]; then
- package_go_binary_worker "$src_path" "$prog" "$description" "$ONLY_ARCH" "$license_file"
+ 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
+ if [[ "$prog" != "arvados-server" ]] || [[ "$ONLY_BUILD" != "arvados-workbench" ]]; then
+ return 0
+ fi
+ fi
+
+ native_arch="amd64"
+ if [[ "$HOSTTYPE" == "aarch64" ]]; then
+ native_arch="arm64"
+ fi
+
+ if [[ -n "$ARCH" ]]; then
+ if [[ "$native_arch" == "amd64" ]] || [[ "$native_arch" == "$ARCH" ]]; then
+ package_go_binary_worker "$src_path" "$prog" "$description" "$native_arch" "$ARCH" "$license_file"
+ else
+ echo "Error: no cross compilation support for Go on $native_arch yet, can not build $prog for $ARCH"
+ fi