Skip to content

Commit 3a16a7a

Browse files
committed
Add Windows version of --trim tests
1 parent 23c189d commit 3a16a7a

File tree

4 files changed

+92
-10
lines changed

4 files changed

+92
-10
lines changed

pipelines/main/launch_unsigned_jobs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ steps:
8484
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/doctest.yml
8585
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/pdf_docs/build_pdf_docs.yml
8686
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/embedding.yml
87-
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/trimming.yml
87+
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/trimming_linux.yml
88+
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/trimming_windows.yml
8889
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/llvmpasses.yml
8990
# buildkite-agent pipeline upload .buildkite/pipelines/main/misc/whitespace.yml # Currently runs in GitHub Actions instead of Buildkite
9091

pipelines/main/misc/trimming.yml renamed to pipelines/main/misc/trimming_linux.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
steps:
22
- group: "Check"
33
steps:
4-
- label: "trimming"
5-
key: "trimming"
4+
- label: ":linux: trimming"
5+
key: "trimming_x86_64-linux-gnu"
66
depends_on:
77
- "build_x86_64-linux-gnu"
88
plugins:
@@ -24,13 +24,7 @@ steps:
2424
if: | # We only run the `trimming` job on Julia 1.12 and later.
2525
(pipeline.slug != "julia-release-1-dot-10") && (pipeline.slug != "julia-release-1-dot-11")
2626
commands: |
27-
# Download pre-built julia, extract into `usr/`
28-
buildkite-agent artifact download --step "build_x86_64-linux-gnu" 'julia-*-linux-x86_64.tar.gz' .
29-
mkdir -p usr
30-
tar -C usr --strip-components=1 -zxf julia-*-linux-x86_64.tar.gz
31-
rm -f julia-*-linux-x86_64.tar.gz
32-
33-
make --output-sync -j$${JULIA_CPU_THREADS:?} -C test/trimming check JULIA="$$(pwd)/usr/bin/julia" BIN="$$(pwd)/usr/bin"
27+
bash .buildkite/utilities/test_trimming.sh
3428
timeout_in_minutes: 60
3529
agents:
3630
queue: "julia"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
steps:
2+
- group: "Check"
3+
steps:
4+
- label: ":windows: trimming"
5+
key: "trimming_x86_64-w64-mingw32"
6+
depends_on:
7+
- "build_x86_64-w64-mingw32"
8+
plugins:
9+
- JuliaCI/external-buildkite#v1:
10+
version: "./.buildkite-external-version"
11+
repo_url: "https://github.com/JuliaCI/julia-buildkite"
12+
- docker#v3.13.0:
13+
image: "juliapackaging/package-windows-x86_64:v7.10"
14+
always-pull: true
15+
command: ["bash", ".buildkite/utilities/test_trimming.sh"]
16+
propagate-environment: true
17+
volumes:
18+
# Mount buildkite-agent as well
19+
- "C:\\buildkite-agent\\bin:C:\\buildkite-agent\\bin"
20+
environment:
21+
# We have to list this here, because buildkite doesn't automatically
22+
# include environment-hook-set variables in a way that the docker
23+
# plugin finds. It's annoying, but at least we have a workaround.
24+
- "JULIA_CPU_THREADS"
25+
# Have to include this for `buildkite-agent` to work:
26+
- "BUILDKITE_AGENT_ACCESS_TOKEN"
27+
if: | # We only run the `trimming` job on Julia 1.12 and later.
28+
(pipeline.slug != "julia-release-1-dot-10") && (pipeline.slug != "julia-release-1-dot-11")
29+
timeout_in_minutes: 60
30+
agents:
31+
queue: "julia"
32+
os: "windows"
33+
arch: "x86_64"
34+
env:
35+
JULIA_SHELL: "/bin/bash"
36+
TRIPLET: "x86_64-w64-mingw32"

utilities/test_trimming.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
3+
# This script performs the basic steps needed to test Julia previously
4+
# built and uploaded as a `.tar.gz`.
5+
# It requires the following environment variables to be defined:
6+
# - TRIPLET
7+
# - USE_RR
8+
set -euo pipefail
9+
10+
# First, get things like `SHORT_COMMIT`, `JULIA_CPU_TARGET`, `UPLOAD_TARGETS`, etc...
11+
# shellcheck source=SCRIPTDIR/build_envs.sh
12+
source .buildkite/utilities/build_envs.sh
13+
14+
echo "--- Print kernel version"
15+
uname -a
16+
17+
# Usually, we download the build artifacts. However, if we're running inside of the
18+
# `bughunt` tool, for instance, we may already have a Julia unpacked for us.
19+
if [[ ! -d "${JULIA_INSTALL_DIR}/bin" ]]; then
20+
# Note that we pass `--step` to prevent ambiguities between downloading the artifacts
21+
# uploaded by the `build_*` steps vs. the `upload_*` steps. Normally, testing must occur
22+
# first, however in the event of a soft-fail test, we can re-run a test after a successful
23+
# upload has occured.
24+
echo "--- Download build artifacts"
25+
buildkite-agent artifact download --step "build_${TRIPLET}" "${UPLOAD_FILENAME}.tar.gz" .
26+
27+
echo "--- Extract build artifacts"
28+
tar xzf "${UPLOAD_FILENAME}.tar.gz" "${JULIA_INSTALL_DIR}/"
29+
fi
30+
31+
# If we're on macOS, we need to re-sign the downloaded tarball so it will
32+
# execute on this machine
33+
if [[ "${OS}" == "macos" ]]; then
34+
echo "--- [mac] Codesigning"
35+
.buildkite/utilities/macos/codesign.sh "${JULIA_INSTALL_DIR}"
36+
echo "--- [mac] Update checksums for stdlib cachefiles after codesigning"
37+
JULIA_DEBUG=all "${JULIA_INSTALL_DIR}/bin/julia" .buildkite/utilities/update_stdlib_pkgimage_checksums.jl
38+
fi
39+
40+
echo "--- Print Julia version info"
41+
${JULIA_BINARY} -e 'using InteractiveUtils; InteractiveUtils.versioninfo()'
42+
43+
echo "--- Set some environment variables"
44+
# Prevent OpenBLAS from spinning up a large number of threads on our big machines
45+
export OPENBLAS_NUM_THREADS="${JULIA_CPU_THREADS}"
46+
export JULIA_TEST_IS_BASE_CI="true"
47+
unset JULIA_DEPOT_PATH
48+
unset JULIA_PKG_SERVER
49+
50+
echo "--- Run trimming tests"
51+
${MAKE} --output-sync -j"${JULIA_CPU_THREADS:?}" -C test/trimming check JULIA="${JULIA_BINARY:?}" BIN="$(dirname "${JULIA_BINARY:?}")"

0 commit comments

Comments
 (0)