ReviewOS

also looking at this

craft-native/craft

fix(ci): stop evaluating `pantry env`, which sometimes re-installs JS deps mid-job

#107
Merged glennmichael123 wants to merge fix/ci-drop-pantry-env into main
6 files +16 -17
.github/CONTRIBUTING.mdmodified+1-1
Changes to .github/CONTRIBUTING.md
@@ -6,7 +6,7 @@ Thank you for your interest in contributing to Craft! This document provides gui
66
77### Prerequisites
88
9- **Pantry-managed stable Zig**: run `eval "$(pantry env | sed -n '/^export /,$p')"`, then invoke `zig`
9- **Pantry-managed stable Zig**: run `eval "$(pantry env | sed -n '/^export /,$p')"`, then invoke `zig` (locally only — CI does not: the pantry action already puts `zig` on PATH, and `pantry env` runs a workspace setup that re-installs JS deps with its own `--linker`, rewriting `node_modules` mid-job)
1010- **Bun**: Install from [bun.sh](https://bun.sh)
1111
1212#### Platform-specific Dependencies
.github/workflows/benchmarks.ymlmodified+1-1
Changes to .github/workflows/benchmarks.yml
@@ -82,7 +82,7 @@ jobs:
8282 - name: Build binary
8383 working-directory: packages/zig
8484 run: |
85 eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseFast
85 zig build -Doptimize=ReleaseFast
8686 mkdir -p "$RUNNER_TEMP/bench"
8787 cp zig-out/bin/craft "$RUNNER_TEMP/bench/craft-head"
8888
.github/workflows/binary-size.ymlmodified+2-2
Changes to .github/workflows/binary-size.yml
@@ -71,7 +71,7 @@ jobs:
7171 - name: Build release binary
7272 working-directory: packages/zig
7373 run: |
74 eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe
74 zig build -Doptimize=ReleaseSafe
7575
7676 - name: Measure binary size
7777 id: size
@@ -123,7 +123,7 @@ jobs:
123123 git checkout origin/main -- packages/zig
124124
125125 cd packages/zig
126 eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe
126 zig build -Doptimize=ReleaseSafe
127127
128128 if [ -f "zig-out/bin/craft" ]; then
129129 BASELINE=$(wc -c < "zig-out/bin/craft" | tr -d ' ')
.github/workflows/ci.ymlmodified+5-5
Changes to .github/workflows/ci.yml
@@ -35,7 +35,7 @@ jobs:
3535 uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64
3636
3737 - name: Verify Zig installation
38 run: eval "$(pantry env | sed -n '/^export /,$p')" && zig version
38 run: zig version
3939
4040 - name: Cache Zig artifacts
4141 uses: actions/cache@v5
@@ -58,14 +58,14 @@ jobs:
5858
5959 - name: Build Zig core
6060 working-directory: packages/zig
61 run: eval "$(pantry env | sed -n '/^export /,$p')" && zig build
61 run: zig build
6262
6363 - name: First-party Zig dependencies
6464 uses: ./.github/actions/first-party-zig-deps
6565
6666 - name: Test Zig core
6767 working-directory: packages/zig
68 run: eval "$(pantry env | sed -n '/^export /,$p')" && zig build test
68 run: zig build test
6969
7070 - name: Check binary size
7171 if: runner.os == 'Linux'
@@ -163,7 +163,7 @@ jobs:
163163
164164 - name: Check Zig formatting
165165 working-directory: packages/zig
166 run: eval "$(pantry env | sed -n '/^export /,$p')" && zig fmt --check src/ build.zig
166 run: zig fmt --check src/ build.zig
167167
168168 - name: Audit Zig C imports
169169 run: bun run verify:cimports
@@ -194,7 +194,7 @@ jobs:
194194
195195 - name: Build Zig core
196196 working-directory: packages/zig
197 run: eval "$(pantry env | sed -n '/^export /,$p')" && zig build
197 run: zig build
198198
199199 - name: Build TypeScript SDK
200200 working-directory: packages/typescript
.github/workflows/mobile-e2e.ymlmodified+4-4
Changes to .github/workflows/mobile-e2e.yml
@@ -74,7 +74,7 @@ jobs:
7474 run: |
7575 # Build iOS simulator static libraries using dedicated build step
7676 # (not the default target which builds macOS executables)
77 eval "$(pantry env | sed -n '/^export /,$p')" && zig build build-ios-simulator -Doptimize=ReleaseSafe -Dmacos-sdk="$(xcrun --sdk iphonesimulator --show-sdk-path)"
77 zig build build-ios-simulator -Doptimize=ReleaseSafe -Dmacos-sdk="$(xcrun --sdk iphonesimulator --show-sdk-path)"
7878
7979 - name: First-party Zig dependencies
8080 uses: ./.github/actions/first-party-zig-deps
@@ -85,7 +85,7 @@ jobs:
8585 # `zig build test` reports through its exit code. The old form piped
8686 # it to a file and grepped for "mobile"/"ios", which fails under
8787 # `set -e` whenever the run is clean and the file is therefore empty.
88 eval "$(pantry env | sed -n '/^export /,$p')" && zig build test
88 zig build test
8989
9090 - name: Build iOS test app
9191 if: hashFiles('packages/ios/TestApp/TestApp.xcodeproj') != ''
@@ -176,7 +176,7 @@ jobs:
176176 # builds the desktop binaries — and since an android triple reports
177177 # os_tag == .linux, that links GTK3/WebKit2GTK against a sysroot that
178178 # does not exist for Android.
179 eval "$(pantry env | sed -n '/^export /,$p')" && zig build build-android -Doptimize=ReleaseSafe
179 zig build build-android -Doptimize=ReleaseSafe
180180
181181 - name: First-party Zig dependencies
182182 uses: ./.github/actions/first-party-zig-deps
@@ -187,7 +187,7 @@ jobs:
187187 # `zig build test` reports through its exit code. The old form piped
188188 # it to a file and grepped for "mobile"/"android", which fails under
189189 # `set -e` whenever the run is clean and the file is therefore empty.
190 eval "$(pantry env | sed -n '/^export /,$p')" && zig build test
190 zig build test
191191
192192 - name: Enable KVM
193193 run: |
.github/workflows/release.ymlmodified+3-4
Changes to .github/workflows/release.yml
@@ -74,7 +74,7 @@ jobs:
7474 mkdir -p zig-out/cross
7575
7676 echo "::group::Cross-compile darwin-x64"
77 eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$X64_TARGET" -Dmacos-sdk="$SDK_PATH"
77 zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$X64_TARGET" -Dmacos-sdk="$SDK_PATH"
7878 mkdir -p zig-out/cross/darwin-x64 && cp zig-out/bin/craft zig-out/cross/darwin-x64/craft
7979 echo "::endgroup::"
8080
@@ -87,7 +87,7 @@ jobs:
8787 # cross-compilation mode, where it stops looking for the system SDK
8888 # on its own and every `-framework Cocoa` fails to resolve.
8989 rm -rf zig-out/bin
90 eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$ARM64_TARGET" -Dmacos-sdk="$SDK_PATH"
90 zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$ARM64_TARGET" -Dmacos-sdk="$SDK_PATH"
9191
9292 # AppKit decides how it draws a window's controls from the SDK recorded
9393 # in LC_BUILD_VERSION, so that it can restyle them without restyling
@@ -144,7 +144,6 @@ jobs:
144144 "x86_64-windows:windows-x64:craft.exe"; do
145145 IFS=: read -r zig_target dir_name bin_name <<< "$target_spec"
146146 echo "::group::Cross-compile $dir_name"
147 eval "$(pantry env | sed -n '/^export /,$p')"
148147 zig build -Doptimize=ReleaseSafe -Dversion="$VERSION" -Dtarget="$zig_target"
149148 mkdir -p "zig-out/cross/$dir_name" && cp "zig-out/bin/$bin_name" "zig-out/cross/$dir_name/$bin_name"
150149 echo "Built $dir_name"
@@ -157,7 +156,7 @@ jobs:
157156 # so craft-linux-x64.zip shipped a Windows PE binary alongside the
158157 # Linux one.
159158 rm -rf zig-out/bin
160 eval "$(pantry env | sed -n '/^export /,$p')" && zig build -Doptimize=ReleaseSafe -Dversion="$VERSION"
159 zig build -Doptimize=ReleaseSafe -Dversion="$VERSION"
161160
162161 # ── macOS Code Signing & Notarization ──────────────────────────
163162 # The signing credentials live encrypted in `.env.production`, not as