Skip to content

Commit 246d006

Browse files
committed
ci: opt the consumer test into running node-libcurl's install scripts
pnpm v10 no longer runs dependency install scripts by default — every package that needs preinstall/install/postinstall now has to be on the consumer's allow-list. The windows-consumer-install workflow saw the exact symptom: `pnpm add` reported "Ignored build scripts: node-libcurl" and the install "succeeded", but vcpkg never ran, so the curl.exe sanity check threw "vcpkg curl.exe was not found after install". Opt in two ways so both invocations and any followup script behave the same: the consumer package.json now declares `pnpm.onlyBuiltDependencies = ["node-libcurl"]`, and the `pnpm add` command also passes `--allow-build node-libcurl` (belt-and-braces for the one-shot install). This is the same hoop a real pnpm-v10 user has to jump through — so keeping the workaround in the workflow rather than hiding it behind a custom action means the CI continues to reflect what consumers actually experience.
1 parent 785f589 commit 246d006

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/windows-consumer-install.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,25 @@ jobs:
6464
6565
New-Item -ItemType Directory -Force -Path $consumerRoot
6666
Set-Location $consumerRoot
67-
Set-Content -Path package.json -Value '{"private":true,"type":"commonjs"}'
67+
# pnpm v10 blocks dependency install scripts by default. The consumer
68+
# has to opt in for any package that needs its preinstall/install/
69+
# postinstall to run — and node-libcurl needs all three to run the
70+
# vcpkg setup and build the native addon. Without this approval the
71+
# install completes "successfully" but leaves the package non-
72+
# functional (no vcpkg-installed curl.exe, no native binding).
73+
# This is the exact failure mode real pnpm-v10 consumers hit, so we
74+
# encode the workaround here rather than masking it.
75+
Set-Content -Path package.json -Value (@'
76+
{
77+
"private": true,
78+
"type": "commonjs",
79+
"pnpm": {
80+
"onlyBuiltDependencies": ["node-libcurl"]
81+
}
82+
}
83+
'@)
6884
69-
pnpm add $package.FullName --fetch-timeout 300000
85+
pnpm add $package.FullName --allow-build node-libcurl --fetch-timeout 300000
7086
7187
$curlExe = Get-ChildItem `
7288
-Path (Join-Path $consumerRoot 'node_modules/node-libcurl') `

0 commit comments

Comments
 (0)