镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Commit 4ab844f

Browse files
committed
fix: consume native lock replay from published Pantry
Require Pantry 0.11.184 consistently in SDK dependencies, CI actions and bootstrap. Remove metadata-only native pin restoration so releases retain the actual installer graph. The published CLI preserves all 26 committed native entries through normal and frozen regeneration. Declaration guards and failed-release rollback remain intact. Refs pantry-pm/pantry#295 Refs #3223 Refs stacksjs/ts-cloud#210 Refs stacksjs/hq.training#346
1 parent 22aeb78 commit 4ab844f

11 files changed

Lines changed: 49 additions & 116 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ jobs:
142142
- name: Checkout
143143
uses: actions/checkout@v6
144144
- name: Set up the pinned dependency tools
145-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5
145+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a
146146
with:
147-
version: '0.11.169'
147+
version: '0.11.184'
148148
install: 'false'
149149
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
150150
- name: Generate the candidate Bun lock with the normal installer
@@ -184,9 +184,9 @@ jobs:
184184
fetch-depth: 0
185185

186186
- name: Setup Pantry
187-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
187+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
188188
with:
189-
version: '0.11.169'
189+
version: '0.11.184'
190190
install: 'false'
191191
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
192192

@@ -233,9 +233,9 @@ jobs:
233233
uses: actions/checkout@v6
234234

235235
- name: Setup Pantry
236-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
236+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
237237
with:
238-
version: '0.11.169'
238+
version: '0.11.184'
239239
install: 'false'
240240
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
241241

@@ -345,9 +345,9 @@ jobs:
345345
uses: actions/checkout@v6
346346

347347
- name: Setup Pantry
348-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
348+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
349349
with:
350-
version: '0.11.169'
350+
version: '0.11.184'
351351
install: 'false'
352352
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org ffmpeg.org@9.0.2'
353353
services: postgres@17.11 mysql@26.7.0 redis@8.8.0 dynamodb@3.3.0
@@ -454,9 +454,9 @@ jobs:
454454
uses: actions/checkout@v6
455455

456456
- name: Setup Pantry
457-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
457+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
458458
with:
459-
version: '0.11.169'
459+
version: '0.11.184'
460460
install: 'false'
461461
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
462462

@@ -536,9 +536,9 @@ jobs:
536536
uses: actions/checkout@v6
537537

538538
- name: Setup Pantry
539-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
539+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
540540
with:
541-
version: '0.11.169'
541+
version: '0.11.184'
542542
install: 'false'
543543
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
544544

@@ -684,9 +684,9 @@ jobs:
684684
uses: actions/checkout@v6
685685

686686
- name: Setup Pantry
687-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
687+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
688688
with:
689-
version: '0.11.169'
689+
version: '0.11.184'
690690
install: 'false'
691691
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
692692

@@ -712,9 +712,9 @@ jobs:
712712
uses: actions/checkout@v6
713713

714714
- name: Setup Pantry
715-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
715+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
716716
with:
717-
version: '0.11.169'
717+
version: '0.11.184'
718718
install: 'false'
719719
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
720720

@@ -738,9 +738,9 @@ jobs:
738738
uses: actions/checkout@v6
739739

740740
- name: Setup Pantry
741-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
741+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
742742
with:
743-
version: '0.11.169'
743+
version: '0.11.184'
744744
install: 'false'
745745
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
746746

@@ -785,9 +785,9 @@ jobs:
785785
uses: actions/checkout@v6
786786

787787
- name: Setup Pantry
788-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
788+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
789789
with:
790-
version: '0.11.169'
790+
version: '0.11.184'
791791
install: 'false'
792792
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
793793

@@ -898,9 +898,9 @@ jobs:
898898
- uses: actions/checkout@v6
899899

900900
- name: Setup Pantry
901-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
901+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
902902
with:
903-
version: '0.11.169'
903+
version: '0.11.184'
904904
install: 'false'
905905
packages: 'bun.com@${{ env.BUN_VERSION }} git-scm.org curl.se sqlite.org'
906906

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ jobs:
137137
uses: actions/checkout@v6
138138

139139
- name: Setup Pantry
140-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
140+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
141141
with:
142-
version: '0.11.169'
142+
version: '0.11.184'
143143
install: 'false'
144144
packages: bun.com@1.4.4 git-scm.org
145145

@@ -203,9 +203,9 @@ jobs:
203203
fetch-depth: 0
204204

205205
- name: Setup Pantry
206-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
206+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
207207
with:
208-
version: '0.11.169'
208+
version: '0.11.184'
209209
install: 'false'
210210
packages: bun.com@1.4.4 git-scm.org
211211

@@ -462,9 +462,9 @@ jobs:
462462
bun run zip:all
463463
464464
- name: Create GitHub Release
465-
uses: pantry-pm/pantry/packages/action@c1ef80f71239e7f3626e3ed0ef3eb960d61ae5b5 # v0.11.169
465+
uses: pantry-pm/pantry/packages/action@624cd6674f8c5c2d4e4204c11ece62a00d7fac0a # v0.11.184
466466
with:
467-
version: '0.11.169'
467+
version: '0.11.184'
468468
install: 'false'
469469
release: 'true'
470470
release-tag: ${{ steps.get_version.outputs.version }}

‎bun.lock‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pantry.lock‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
"version": "0.75.512",
303303
"dependencies": {
304304
"bun-plugin-stx": "0.2.807",
305-
"ts-pantry": "^0.11.161"
305+
"ts-pantry": "^0.11.184"
306306
},
307307
"devDependencies": {
308308
"better-dx": "^0.2.24"
@@ -378,7 +378,7 @@
378378
"ajv": "^8.20.0",
379379
"ajv-formats": "^3.0.1",
380380
"bun-plugin-stx": "0.2.807",
381-
"ts-pantry": "^0.11.164"
381+
"ts-pantry": "^0.11.184"
382382
},
383383
"devDependencies": {
384384
"better-dx": "^0.2.24"
@@ -558,7 +558,7 @@
558558
"@stacksjs/features": "workspace:*",
559559
"@stacksjs/path": "workspace:*",
560560
"@stacksjs/tunnel": "workspace:*",
561-
"ts-pantry": "^0.11.161"
561+
"ts-pantry": "^0.11.184"
562562
},
563563
"devDependencies": {
564564
"@stacksjs/alias": "workspace:*",

‎storage/framework/core/actions/src/bump.ts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { path as p } from '@stacksjs/path'
44
import { incrementVersion, isReleaseType, isValidVersion, versionBump } from '@stacksjs/bumpx'
55
import { isCalendarBump, nextCalendarVersion } from './calendar-version'
66
import { describeGitHubRelease, publishGitHubRelease } from './github-release'
7-
import { pantryLockViolations, preservePantrySystemPins } from './pantry-lock'
7+
import { pantryLockViolations } from './pantry-lock'
88
import { resolvePantryToolchain } from './pantry-toolchain'
99
import { releasePushTarget } from './release-push-target'
1010
import { generateChangelog, loadLogsmithConfig } from '@stacksjs/logsmith'
@@ -307,11 +307,6 @@ async function refreshPantryLock(): Promise<void> {
307307
})
308308
if (!existsSync(lockPath))
309309
throw new Error('Pantry completed without writing pantry.lock')
310-
if (isFrameworkRelease) {
311-
// Refresh JS workspace versions, retaining CI's native graph when no
312-
// system declaration changed. Pantry's platform resolution can differ.
313-
writeFileSync(lockPath, preservePantrySystemPins(readFileSync(lockPath, 'utf8'), previousLock.toString('utf8')))
314-
}
315310
}
316311
catch (error) {
317312
writeFileSync(lockPath, previousLock)
@@ -321,8 +316,8 @@ async function refreshPantryLock(): Promise<void> {
321316
)
322317
}
323318

324-
// `pantry install` is not reproducible across platforms today, and a release
325-
// runs it on whichever machine is cutting the release (stacksjs/stacks#2843).
319+
// Historical cross-platform installer defects made successful regeneration
320+
// insufficient evidence of a valid workspace lock (stacksjs/stacks#2843).
326321
// An install that succeeds is therefore not evidence that it produced a
327322
// lockfile this workspace can use: the same `craft-native` record was walked
328323
// back below its declared range by five consecutive releases, each of them

‎storage/framework/core/actions/src/pantry-lock.ts‎

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,12 @@
77
* bump that left it alone would commit a lock describing the previous release
88
* and CI's "the lockfiles still describe this workspace" step would reject it.
99
*
10-
* The problem is that the refresh runs wherever the release runs, and `pantry
11-
* install` is not reproducible across platforms today. On macOS it drops the
12-
* root `system` block, and with it the `bun.sh` toolchain pin that `Setup
13-
* Pantry` provisions before any job starts, and it has repeatedly walked
14-
* `craft-native` back to a version that does not satisfy the `>=` range the
15-
* workspace itself declares. Release commits are authored locally, so the
16-
* result is decided by whichever machine ran the release
17-
* (pantry-pm/pantry#231, #232, #233).
18-
*
19-
* That turned into a loop. The same record was corrected five times and
20-
* reverted by the next release each time, because nobody connects a red
21-
* `compile` to a release that happened hours earlier. A lock that violates its
22-
* own declared ranges is not a stale-but-valid pin: an install MUST re-resolve
23-
* it, which is exactly what CI reports.
24-
*
25-
* So this does not try to make `pantry install` reproducible, which is not
26-
* Stacks' file to fix. It makes the release refuse to commit a lock that is
27-
* self-inconsistent, turning a silently red main into a release that stops and
28-
* says why. Both checks are deliberately ones that cannot produce a false
29-
* positive: a range the lock itself records, and a block the previous lock
30-
* already had.
10+
* Historical installer defects dropped system pins and selected versions below
11+
* declared ranges (pantry-pm/pantry#231, #232, #233). A release must reject an
12+
* inconsistent result before committing it. Native resolution belongs to the
13+
* declared Pantry installer; this validator never rewrites its selected pins.
14+
* Current workspace declarations also come from Bun's freshly generated lock,
15+
* so a self-consistent but stale Pantry workspace cannot pass validation.
3116
*/
3217

3318
/** The manifest fields whose ranges a lockfile is expected to honour. */
@@ -49,25 +34,6 @@ interface PantryLock {
4934
packages?: Record<string, unknown>
5035
}
5136

52-
/** An SDK version bump must not re-resolve an unchanged native toolchain for the publisher's OS. */
53-
export function preservePantrySystemPins(lock: string, baseline: string): string {
54-
const next = JSON.parse(lock) as PantryLock
55-
const previous = JSON.parse(baseline) as PantryLock
56-
const systems = (value: PantryLock) => Object.entries(value.workspaces ?? {})
57-
.filter(([, workspace]) => workspace.system && typeof workspace.system === 'object')
58-
.map(([path, workspace]) => [path, Object.entries(workspace.system as Record<string, unknown>).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)])
59-
.sort(([a], [b]) => String(a) < String(b) ? -1 : String(a) > String(b) ? 1 : 0)
60-
const declared = systems(previous)
61-
if (!declared.length || JSON.stringify(declared) !== JSON.stringify(systems(next))) return lock
62-
const native = (value: unknown) => !!value && typeof value === 'object' && (value as { source?: string }).source === 'pantry'
63-
const pinned = Object.entries(previous.packages ?? {}).filter(([, value]) => native(value))
64-
if (!pinned.length) return lock
65-
const packages = Object.fromEntries(Object.entries(next.packages ?? {}).filter(([, value]) => !native(value)))
66-
for (const [name, value] of pinned) packages[name] = value
67-
next.packages = Object.fromEntries(Object.entries(packages).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0))
68-
return `${JSON.stringify(next, null, 2)}\n`
69-
}
70-
7137
/**
7238
* Split a `packages` key into its name and version.
7339
*

‎storage/framework/core/actions/tests/pantry-lock.test.ts‎

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from 'bun:test'
2-
import { pantryLockViolations, preservePantrySystemPins } from '../src/pantry-lock'
2+
import { pantryLockViolations } from '../src/pantry-lock'
33

44
/**
55
* The release guard for `pantry.lock` (stacksjs/stacks#2843).
@@ -38,34 +38,6 @@ const lockOf = (value: unknown) => JSON.stringify(value)
3838
const committed = lockOf(sound)
3939
const clone = () => JSON.parse(committed) as typeof sound
4040

41-
describe('release native toolchain pins', () => {
42-
const previous = { ...sound, packages: { ...sound.packages,
43-
'libexpat.github.io@2.10.0': { name: 'libexpat.github.io', version: '2.10.0', source: 'pantry' },
44-
} }
45-
const regenerated = { ...sound, packages: {
46-
'pickier@0.1.66': { name: 'pickier', version: '0.1.66' },
47-
'libexpat.github.io@2.9.0': { name: 'libexpat.github.io', version: '2.9.0', source: 'pantry' },
48-
} }
49-
50-
it('keeps the validated system graph while refreshing JS resolutions', () => {
51-
const result = JSON.parse(preservePantrySystemPins(lockOf(regenerated), lockOf(previous)))
52-
expect(result.packages['libexpat.github.io@2.10.0'].version).toBe('2.10.0')
53-
expect(result.packages['libexpat.github.io@2.9.0']).toBeUndefined()
54-
expect(result.packages['pickier@0.1.66'].version).toBe('0.1.66')
55-
expect(result.packages['pickier@0.1.65']).toBeUndefined()
56-
})
57-
58-
it('allows an intentional native toolchain declaration change', () => {
59-
const changed = JSON.parse(lockOf(regenerated))
60-
changed.workspaces[''].system['bun.sh'] = '1.4.3'
61-
expect(preservePantrySystemPins(lockOf(changed), lockOf(previous))).toBe(lockOf(changed))
62-
})
63-
64-
it('does not invent a system graph for projects that declared none', () => {
65-
expect(preservePantrySystemPins(lockOf(regenerated), '{"packages":{}}')).toBe(lockOf(regenerated))
66-
})
67-
})
68-
6941
describe('pantryLockViolations', () => {
7042
it('rejects a self-consistent lock that still records the previous release declarations', () => {
7143
const expected = clone().workspaces

‎storage/framework/core/browser-extension/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
"dependencies": {
6666
"bun-plugin-stx": "0.2.807",
67-
"ts-pantry": "^0.11.161"
67+
"ts-pantry": "^0.11.184"
6868
},
6969
"peerDependencies": {
7070
"web-ext": ">=10.7.0"

‎storage/framework/core/buddy/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"ajv": "^8.20.0",
162162
"ajv-formats": "^3.0.1",
163163
"bun-plugin-stx": "0.2.807",
164-
"ts-pantry": "^0.11.164"
164+
"ts-pantry": "^0.11.184"
165165
},
166166
"devDependencies": {
167167
"better-dx": "^0.2.24"

‎storage/framework/core/config/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@stacksjs/features": "workspace:*",
6060
"@stacksjs/path": "workspace:*",
6161
"@stacksjs/tunnel": "workspace:*",
62-
"ts-pantry": "^0.11.161"
62+
"ts-pantry": "^0.11.184"
6363
},
6464
"devDependencies": {
6565
"@stacksjs/alias": "workspace:*",

0 commit comments

Comments
 (0)