ReviewOS

also looking at this

pantry-pm/pantry

fix: preserve sources when removing linked workspace directories

#247
Merged chris wants to merge codex/preserve-linked-workspace-sources into main
4 files +98 -46

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

.github/workflows/ci.ymlmodified+8-20
Changes to .github/workflows/ci.yml
@@ -153,7 +153,10 @@ jobs:
153153 run: bun .github/scripts/linux-native-tools.ts
154154
155155 - name: Cross-compile the source CLI for native Windows qualification
156 run: cd packages/zig && zig build -Dtarget=x86_64-windows-gnu -Doptimize=Debug -j2 --prefix ../../artifacts/windows-source-cli
156 run: |
157 cd packages/zig
158 zig build -Dtarget=x86_64-windows-gnu -Doptimize=Debug -j2 --prefix ../../artifacts/windows-source-cli
159 zig test src/io_helper.zig -lc -target x86_64-windows-gnu --test-no-exec --test-filter deleteTree -femit-bin=../../artifacts/windows-source-cli/bin/file-tree-tests.exe
157160
158161 - name: Retain the source Windows CLI and Action
159162 uses: actions/upload-artifact@v4
@@ -161,6 +164,7 @@ jobs:
161164 name: windows-source-runtime
162165 path: |
163166 artifacts/windows-source-cli/bin/pantry.exe
167 artifacts/windows-source-cli/bin/file-tree-tests.exe
164168 packages/action/dist/index.js
165169 packages/action/dist/post.js
166170 if-no-files-found: error
@@ -405,7 +409,7 @@ jobs:
405409 if-no-files-found: error
406410
407411 continuous-release:
408 needs: [lint, typecheck, test, action-redis-service, action-native-services, action-native-tools, native-browser, windows-native-runtime, windows-file-tree]
412 needs: [lint, typecheck, test, action-redis-service, action-native-services, action-native-tools, native-browser, windows-native-runtime]
409413 runs-on: ubuntu-latest
410414 timeout-minutes: 15
411415 # Best-effort commit-preview publishing. Don't fail the whole workflow
@@ -465,24 +469,6 @@ jobs:
465469 ]
466470 webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
467471
468 windows-file-tree:
469 name: Windows linked workspace cleanup
470 runs-on: windows-latest
471 timeout-minutes: 10
472 steps:
473 - uses: actions/checkout@v6
474 - name: Install the pinned compiler and runtime
475 uses: pantry-pm/pantry/packages/action@ae59a7b7fc5f4e6f7b8041a75e6b5772680bebdf # v0.11.101
476 with:
477 version: '0.11.101'
478 install: 'false'
479 packages: bun.com@1.4.3 ziglang.org@0.17.0
480 - name: Test source preservation through directory and nested links
481 # Keep the compiler's own adjacent standard library when invoking a
482 # managed binary through the package's executable link.
483 run: |
484 bun -e 'const zig = require("node:fs").realpathSync(Bun.which("zig")); process.exit(Bun.spawnSync([zig, "test", "packages/zig/src/io_helper.zig", "-lc", "--test-filter", "deleteTree"], { stdout: "inherit", stderr: "inherit" }).exitCode)'
485
486472 windows-native-runtime:
487473 needs: test
488474 runs-on: windows-latest
@@ -500,6 +486,8 @@ jobs:
500486 with:
501487 name: windows-source-runtime
502488 path: artifacts/windows-source-runtime
489 - name: Test source preservation through directory and nested links
490 run: '& ./artifacts/windows-source-runtime/artifacts/windows-source-cli/bin/file-tree-tests.exe'
503491 - name: Verify the actual source installer and required workspace failures
504492 env:
505493 PANTRY_TEST_CLI: artifacts/windows-source-runtime/artifacts/windows-source-cli/bin/pantry.exe