Skip to content

Commit b9ac8bc

Browse files
committed
fix(github-actions): use stable TMPDIR for rules_sass compiler compilation
Forcing a stable temporary directory prevents the Dart compiler on macOS from embedding random absolute paths into the compiled binaries. Previously, the random temp paths (e.g., /var/folders/.../random_hash/snapshot.aot) caused the binaries to differ on every build run even when the source code was identical. Using a workspace-relative TMPDIR ensures deterministic binary output.
1 parent f719348 commit b9ac8bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/rules_sass-compiler-updates.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ jobs:
2929
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c # v1
3030
- run: dart pub get --enforce-lockfile
3131
- run: mkdir -p src/compiler/built/
32-
- run: dart compile exe src/compiler/bin/x_sass.dart -o src/compiler/built/${{ matrix.bin_name }}
32+
33+
# To fix the non-deterministic build problem on macOS, force the Dart compiler to use a stable,
34+
# non-random temporary directory during compilation. By default, macOS uses a random subfolder in /var/folders/...,
35+
# but we can override this by setting the TMPDIR environment variable to a fixed path within the workspace.
36+
- run: |
37+
mkdir -p .dart_tmp
38+
export TMPDIR="$(pwd)/.dart_tmp"
39+
dart compile exe src/compiler/bin/x_sass.dart -o src/compiler/built/${{ matrix.bin_name }}
3340
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
3441
with:
3542
name: ${{ matrix.bin_name }}

0 commit comments

Comments
 (0)