Version
System:
OS: Microsoft Windows 10 Pro N 10.0.19045 (64-bit)
Node: v24.14.1
pnpm: 11.24.0
Rstest repository: 95172d0ac0266025d9f03926ad2834a54e585c22 (main)
Details
The VS Code package's preinstall script uses the POSIX expression [ -f icon.png ] as its existence guard. pnpm runs that script through cmd.exe on Windows, where [ is not a command. The failed guard therefore reaches the curl fallback and downloads the 28,214-byte icon on every install, even when packages/vscode/icon.png already exists.
Expected behavior: an existing icon should make the preinstall step a no-op.
Actual output includes:
packages/vscode preinstall: '[' is not recognized as an internal or external command,
packages/vscode preinstall: operable program or batch file.
packages/vscode preinstall: 100 28214 100 28214
This creates an unnecessary CDN dependency for normal Windows workspace installation.
Reproduce link
|
"preinstall": "[ -f icon.png ] || curl https://assets.rspack.rs/rstest/rstest-logo-512x512.png --output icon.png", |
Reproduce Steps
- Clone the repository on Windows and check out
main.
- Ensure
packages/vscode/icon.png exists (a prior install creates it).
- Run
pnpm install --frozen-lockfile.
- Observe that the POSIX guard fails and
curl downloads the icon again.
Version
Details
The VS Code package's
preinstallscript uses the POSIX expression[ -f icon.png ]as its existence guard. pnpm runs that script throughcmd.exeon Windows, where[is not a command. The failed guard therefore reaches thecurlfallback and downloads the 28,214-byte icon on every install, even whenpackages/vscode/icon.pngalready exists.Expected behavior: an existing icon should make the preinstall step a no-op.
Actual output includes:
This creates an unnecessary CDN dependency for normal Windows workspace installation.
Reproduce link
rstest/packages/vscode/package.json
Line 21 in 95172d0
Reproduce Steps
main.packages/vscode/icon.pngexists (a prior install creates it).pnpm install --frozen-lockfile.curldownloads the icon again.