diff --git a/pipelines/main/platforms/package_linux.yml b/pipelines/main/platforms/package_linux.yml index 9abdcd16..60222f61 100644 --- a/pipelines/main/platforms/package_linux.yml +++ b/pipelines/main/platforms/package_linux.yml @@ -24,20 +24,11 @@ steps: - "/cache/repos:/cache/repos" timeout_in_minutes: ${TIMEOUT?} commands: | - echo "--- Print the full and short commit hashes" - SHORT_COMMIT_LENGTH=10 - LONG_COMMIT="$$(git rev-parse HEAD)" - SHORT_COMMIT=`echo $${LONG_COMMIT:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}` - ARTIFACT_FILENAME="julia-$${SHORT_COMMIT:?}-${PLATFORM?}${TAR_ARCH?}.tar.gz" - JULIA_BINARYDIST_FILENAME=`make print-JULIA_BINARYDIST_FILENAME ${MAKE_FLAGS?} | cut -c27- | tr -s ' '` - JULIA_BINARYDIST="$${JULIA_BINARYDIST_FILENAME:?}.tar.gz" - - echo "The full commit is: $${LONG_COMMIT:?}" - echo "The short commit is: $${SHORT_COMMIT:?}" - echo "The artifact filename will be: $${ARTIFACT_FILENAME:?}" + # First, get things like `LONG_COMMIT` and `SHORT_COMMIT`, etc... + TAR_ARCH=${TAR_ARCH?} PLATFORM=${PLATFORM?} MAKE_FLAGS=${MAKE_FLAGS?} source .buildkite/utilities/calc_version_envs.sh echo "--- Build Julia from source" - rm -rf $${ARTIFACT_FILENAME:?} + rm -rf $${ARTIFACT_FILENAME} make --output-sync -j 8 ${MAKE_FLAGS?} echo "--- Check that the working directory is clean" @@ -55,10 +46,11 @@ steps: echo "--- Create build artifacts" make --output-sync -j 8 binary-dist ${MAKE_FLAGS?} - ls -l $${JULIA_BINARYDIST:?} - if [[ "$${JULIA_BINARYDIST:?}" != "$${ARTIFACT_FILENAME:?}" ]]; then - mv $${JULIA_BINARYDIST:?} $${ARTIFACT_FILENAME:?} + + # Rename the build artifact in case we want to name it differently, as is the case on `musl`. + if [[ "$${JULIA_BINARYDIST}" != "$${ARTIFACT_FILENAME}" ]]; then + mv $${JULIA_BINARYDIST} $${ARTIFACT_FILENAME} fi - ls -l $${ARTIFACT_FILENAME:?} + echo "--- Upload build artifacts" - buildkite-agent artifact upload $${ARTIFACT_FILENAME:?} + buildkite-agent artifact upload $${ARTIFACT_FILENAME} diff --git a/pipelines/main/platforms/tester_linux.yml b/pipelines/main/platforms/tester_linux.yml index d9e8e5f0..2fd33c9a 100644 --- a/pipelines/main/platforms/tester_linux.yml +++ b/pipelines/main/platforms/tester_linux.yml @@ -30,31 +30,19 @@ steps: timeout_in_minutes: ${TIMEOUT_BK?} soft_fail: ${ALLOW_FAIL?} commands: | - echo "--- Print the full and short commit hashes" - SHORT_COMMIT_LENGTH=10 - LONG_COMMIT="$$(git rev-parse HEAD)" - SHORT_COMMIT=`echo $${LONG_COMMIT:?} | cut -c1-$${SHORT_COMMIT_LENGTH:?}` - JULIA_DIR="julia-$${SHORT_COMMIT:?}" - JULIA_BINARY="$${JULIA_DIR:?}/bin/julia" - ARTIFACT_FILENAME="julia-$${SHORT_COMMIT:?}-${PLATFORM?}${TAR_ARCH?}.tar.gz" - echo "The full commit is: $${LONG_COMMIT:?}" - echo "The short commit is: $${SHORT_COMMIT:?}" - echo "The artifact filename will be: $${ARTIFACT_FILENAME:?}" - echo "The Julia directory name will be: $${JULIA_DIR:?}" - echo "The Julia binary will be: $${JULIA_BINARY:?}" + # First, get things like `LONG_COMMIT` and `SHORT_COMMIT`, etc... + TAR_ARCH=${TAR_ARCH?} PLATFORM=${PLATFORM?} MAKE_FLAGS=${MAKE_FLAGS?} source .buildkite/utilities/calc_version_envs.sh echo "--- Download build artifacts" - rm -rf $${ARTIFACT_FILENAME:?} - buildkite-agent artifact download $${ARTIFACT_FILENAME:?} . + buildkite-agent artifact download $${ARTIFACT_FILENAME} . echo "--- Extract build artifacts" - rm -rf $${JULIA_DIR:?}/ - tar xzf $${ARTIFACT_FILENAME:?} $${JULIA_DIR:?}/ + tar xzf $${ARTIFACT_FILENAME} $${JULIA_INSTALL_DIR}/ echo "--- Print Julia version info" - $${JULIA_BINARY:?} -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' - echo "JULIA_CPU_THREADS is: $${JULIA_CPU_THREADS:?}" - $${JULIA_BINARY:?} -e '@info "" Sys.CPU_THREADS' + $${JULIA_BINARY} -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' + echo "JULIA_CPU_THREADS is: $${JULIA_CPU_THREADS}" + $${JULIA_BINARY} -e '@info "" Sys.CPU_THREADS' echo "--- Set some environment variables" export OPENBLAS_NUM_THREADS=8 @@ -64,7 +52,7 @@ steps: # Make sure that temp files and temp directories are created in a location that is # backed by real storage. export TMPDIR="$(pwd)/tmp" - mkdir -p $${TMPDIR:?} + mkdir -p $${TMPDIR} # By default, run all tests. export TESTS="all LibGit2/online --ci" @@ -72,11 +60,11 @@ steps: # If we're running inside of `rr`, limit the number of threads if [[ "${IS_RR?}" == "yes" ]]; then - export JULIA_CMD_FOR_TESTS="$${JULIA_BINARY:?} .buildkite/utilities/rr/rr_capture.jl $${JULIA_BINARY:?}" + export JULIA_CMD_FOR_TESTS="$${JULIA_BINARY} .buildkite/utilities/rr/rr_capture.jl $${JULIA_BINARY}" export NCORES_FOR_TESTS="parse(Int, ENV[\"JULIA_RRCAPTURE_NUM_CORES\"])" export JULIA_NUM_THREADS=1 else - export JULIA_CMD_FOR_TESTS="$${JULIA_BINARY:?}" + export JULIA_CMD_FOR_TESTS="$${JULIA_BINARY}" export NCORES_FOR_TESTS="Sys.CPU_THREADS" export JULIA_NUM_THREADS=16 fi diff --git a/utilities/calc_version_envs.sh b/utilities/calc_version_envs.sh new file mode 100755 index 00000000..d9dd6dd2 --- /dev/null +++ b/utilities/calc_version_envs.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "--- Print the full and short commit hashes" +SHORT_COMMIT_LENGTH=10 +LONG_COMMIT="$(git rev-parse HEAD)" +SHORT_COMMIT="$(echo ${LONG_COMMIT} | cut -c1-${SHORT_COMMIT_LENGTH})" +ARTIFACT_FILENAME="julia-${SHORT_COMMIT}-${PLATFORM?}${TAR_ARCH?}.tar.gz" +JULIA_BINARYDIST="$(make print-JULIA_BINARYDIST_FILENAME ${MAKE_FLAGS?} | cut -c27- | tr -s ' ').tar.gz" +JULIA_INSTALL_DIR="julia-${SHORT_COMMIT}" +JULIA_BINARY="${JULIA_INSTALL_DIR}/bin/julia" + +echo "The full commit is: ${LONG_COMMIT}" +echo "The short commit is: ${SHORT_COMMIT}" +echo "The artifact filename will be: ${ARTIFACT_FILENAME}" +echo "Julia will be installed to: ${JULIA_BINARY}"