21392: Package build scripts require --target
authorBrett Smith <brett.smith@curii.com>
Mon, 29 Jan 2024 02:40:36 +0000 (21:40 -0500)
committerBrett Smith <brett.smith@curii.com>
Wed, 31 Jan 2024 22:22:25 +0000 (17:22 -0500)
Now that we no longer support debian10, it doesn't make sense as a
default. Rather than continue updating the default at arbitrary points
in time, remove it and require the user to specify their target.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>

build/README
build/run-build-packages-one-target.sh
build/run-build-packages.sh
build/run-build-test-packages-one-target.sh

index 66ca5095524665b1537e140d7f8d0c3cfd9842f0..e6d14cf66404009c8a6ec6f44606fb6e40f5d5d2 100644 (file)
@@ -11,15 +11,14 @@ In order to build packages, you will need:
 Quickstart
 ==========
 
-Build and test all the packages for debian10 on your architecture by
+Build and test all the packages for a distribution on your architecture by
 running:
 
-    ./run-build-test-packages-one-target.sh
+    ./run-build-test-packages-one-target.sh --target DISTRO
 
-This will build package build and test Docker images for debian10, build all
-packages in a build container, then test all packages in a test container.
-
-Use a different distro by adding the `--target TARGET` option.
+This will build package build and test Docker images for the named target
+distribution, build all packages in a build container, then test all
+packages in a test container.
 
 Limit the build to a single architecture by adding the `--arch ARCH`
 option. Supported architectures are amd64 and arm64. Note cross-compilation
index be97ef0d130e1c197bfbdf6d9cc4a2b79002998e..857e9c112dd91499339d19d481edf58ddff73d25 100755 (executable)
@@ -7,10 +7,10 @@ read -rd "\000" helpmessage <<EOF
 $(basename $0): Orchestrate run-build-packages.sh for one target
 
 Syntax:
-        WORKSPACE=/path/to/arvados $(basename $0) [options]
+        WORKSPACE=/path/to/arvados $(basename $0) --target <target> [options]
 
 --target <target>
-    Distribution to build packages for (default: debian10)
+    Distribution to build packages for
 --command
     Build command to execute (default: use built-in Docker image command)
 --test-packages
@@ -64,10 +64,10 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-TARGET=debian10
 FORCE_BUILD=0
 COMMAND=
 DEBUG=
+TARGET=
 
 eval set -- "$PARSEDOPTS"
 while [ $# -gt 0 ]; do
@@ -139,6 +139,14 @@ done
 set -e
 orig_umask="$(umask)"
 
+if [[ -z "$TARGET" ]]; then
+    echo "FATAL: --target must be specified" >&2
+    exit 2
+elif [[ ! -d "$WORKSPACE/build/package-build-dockerfiles/$TARGET" ]]; then
+    echo "FATAL: unknown build target '$TARGET'" >&2
+    exit 2
+fi
+
 if [[ -n "$ARVADOS_BUILDING_VERSION" ]]; then
     echo "build version='$ARVADOS_BUILDING_VERSION', package iteration='$ARVADOS_BUILDING_ITERATION'"
 fi
index df7031fca593393b733d4617d72180a6b30fdd1c..77ce054318eb24c1437a2eeeaacd1e7d793f51b1 100755 (executable)
@@ -9,7 +9,7 @@ read -rd "\000" helpmessage <<EOF
 $(basename "$0"): Build Arvados packages
 
 Syntax:
-        WORKSPACE=/path/to/arvados $(basename "$0") [options]
+        WORKSPACE=/path/to/arvados $(basename "$0") --target <target> [options]
 
 Options:
 
@@ -18,7 +18,7 @@ Options:
 --debug
     Output debug information (default: false)
 --target <target>
-    Distribution to build packages for (default: debian10)
+    Distribution to build packages for
 --only-build <package>
     Build only a specific package (or ONLY_BUILD from environment)
 --arch <arch>
@@ -47,8 +47,8 @@ VENDOR="The Arvados Project"
 DEBUG=${ARVADOS_DEBUG:-0}
 FORCE_BUILD=${FORCE_BUILD:-0}
 EXITCODE=0
-TARGET=debian10
 COMMAND=
+TARGET=
 
 PARSEDOPTS=$(getopt --name "$0" --longoptions \
     help,build-bundle-packages,debug,target:,only-build:,arch:,force-build \
@@ -93,6 +93,14 @@ while [ $# -gt 0 ]; do
     shift
 done
 
+if [[ -z "$TARGET" ]]; then
+    echo "FATAL: --target must be specified" >&2
+    exit 2
+elif [[ ! -d "$WORKSPACE/build/package-build-dockerfiles/$TARGET" ]]; then
+    echo "FATAL: unknown build target '$TARGET'" >&2
+    exit 2
+fi
+
 if [[ "$COMMAND" != "" ]]; then
   COMMAND="/usr/local/rvm/bin/rvm-exec default bash /jenkins/$COMMAND --target $TARGET"
 fi
index 9af95d13d34de9dba9658156762244e540a8a55f..d1217162e6109ad74bddb27ba8ea847092d074cb 100755 (executable)
@@ -7,10 +7,10 @@ read -rd "\000" helpmessage <<EOF
 $(basename $0): Build, test and (optionally) upload packages for one target
 
 Syntax:
-        WORKSPACE=/path/to/arvados $(basename $0) [options]
+        WORKSPACE=/path/to/arvados $(basename $0) --target <target> [options]
 
 --target <target>
-    Distribution to build packages for (default: debian10)
+    Distribution to build packages for
 --only-build <package>
     Build only a specific package (or ONLY_BUILD from environment)
 --arch <arch>
@@ -61,10 +61,10 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-TARGET=debian10
 UPLOAD=0
 RC=0
 DEBUG=
+TARGET=
 
 declare -a build_args=()
 
@@ -117,6 +117,14 @@ while [ $# -gt 0 ]; do
     shift
 done
 
+if [[ -z "$TARGET" ]]; then
+    echo "FATAL: --target must be specified" >&2
+    exit 2
+elif [[ ! -d "$WORKSPACE/build/package-build-dockerfiles/$TARGET" ]]; then
+    echo "FATAL: unknown build target '$TARGET'" >&2
+    exit 2
+fi
+
 build_args+=(--target "$TARGET")
 
 if [[ -n "$ONLY_BUILD" ]]; then