diff --git a/.github/workflows/build-and-test-callable.yaml b/.github/workflows/build-and-test-callable.yaml index 94ecd8586..4dfec16f0 100644 --- a/.github/workflows/build-and-test-callable.yaml +++ b/.github/workflows/build-and-test-callable.yaml @@ -266,6 +266,8 @@ jobs: shell: bash run: | set -euxo pipefail + # Prevent stale extraction dirs from previous runs from persisting + rm -rf "$GITHUB_WORKSPACE/install" "$GITHUB_WORKSPACE/dxc-dist" cd $GITHUB_WORKSPACE/llvm-project/build ninja install-distribution install-offload-tools install-offload-test-suite # Stage DXC into a portable bin/+lib/ tree at dxc-dist. @@ -358,6 +360,7 @@ jobs: run: | set -euxo pipefail cd $GITHUB_WORKSPACE + rm -rf install dxc-dist mkdir -p install dxc-dist # Pipe the archive in via stdin and use a relative -C path so # tar doesn't try to parse the Windows drive letter or treat diff --git a/docs/offload-distribution.md b/docs/offload-distribution.md index 6c30cd714..d2859adb3 100644 --- a/docs/offload-distribution.md +++ b/docs/offload-distribution.md @@ -131,6 +131,7 @@ Extract both prefixes, then run the configure script with `--dxc-path` pointing at the DXC binary in its prefix: ``` +rm -rf install dxc-dist mkdir install dxc-dist tar xf llvm-prefix.tar -C install tar xf dxc-prefix.tar -C dxc-dist @@ -141,6 +142,13 @@ python configure-test-suite.py \ --dxc-path ../../../dxc-dist/bin/dxc[.exe] ``` +> **Always extract into freshly-cleaned prefixes.** `tar xf` overlays files +> onto whatever already exists and never removes orphans, so on a reused +> working directory (e.g. a persistent self-hosted runner) stale `.test` +> files from a previous build would survive and be run by lit. The `rm -rf` +> above guarantees lit sees only the tests in this tarball. The build runner +> likewise wipes its `install`/`dxc-dist` prefixes before installing. + This emits a fully-substituted `run/test//lit.site.cfg.py`. `dxc[.exe]` finds its runtime libraries automatically: on Windows the