Skip to content

Commit e72bfc2

Browse files
committed
fix(ci): use pnpm exec to run napi CLI from package context
The napi CLI is a devDependency, not globally available. Use `pnpm --filter=vite-plus exec napi` to run it from the package context.
1 parent c2e7fd7 commit e72bfc2

6 files changed

Lines changed: 42 additions & 38 deletions

File tree

.cargo/config.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ rustflags = ["--cfg", "tokio_unstable"] # also update .github/workflows/ci.yml
88
[target.'cfg(target_os = "linux")']
99
rustflags = ["--cfg", "tokio_unstable", "-C", "link-args=-Wl,--warn-unresolved-symbols"]
1010

11-
# Required for aarch64-linux-gnu-gcc linker on Ubuntu x86_64
12-
[target.aarch64-unknown-linux-gnu]
13-
linker = "aarch64-linux-gnu-gcc"
14-
1511
[unstable]
1612
bindeps = true
1713

.github/actions/build-upstream/action.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ runs:
5353
5454
# NAPI builds - only run on cache miss (slow, especially on Windows)
5555
# Must run before vite-plus/vite-plus-cli TypeScript builds which depend on the bindings
56-
- name: Build NAPI bindings
56+
- name: Build NAPI bindings (x86_64-linux)
5757
shell: bash
5858
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'x86_64-unknown-linux-gnu'
5959
run: |
@@ -63,7 +63,7 @@ runs:
6363
TARGET_CC: clang
6464
DEBUG: napi:*
6565

66-
- name: Build NAPI bindings
66+
- name: Build NAPI bindings (aarch64-linux)
6767
shell: bash
6868
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'aarch64-unknown-linux-gnu'
6969
run: |
@@ -73,7 +73,7 @@ runs:
7373
TARGET_CC: clang
7474
DEBUG: napi:*
7575

76-
- name: Build NAPI bindings
76+
- name: Build NAPI bindings (non-Linux targets)
7777
shell: bash
7878
if: steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux')
7979
run: |
@@ -82,32 +82,27 @@ runs:
8282
env:
8383
DEBUG: napi:*
8484

85-
- name: Build Rust CLI binary (Linux gnu targets)
86-
if: steps.cache-restore.outputs.cache-hit != 'true' && contains(inputs.target, 'linux-gnu')
85+
- name: Build Rust CLI binary (x86_64-linux)
86+
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'x86_64-unknown-linux-gnu'
8787
shell: bash
88-
run: pnpm napi build --use-napi-cross --bin vp --target ${{ inputs.target }} --release -p vite_global_cli
88+
run: |
89+
pnpm exec napi build --use-napi-cross --target ${{ inputs.target }} --release -p vite_global_cli
8990
env:
9091
TARGET_CC: clang
9192
DEBUG: napi:*
9293

93-
- name: Verify glibc version (x86_64-linux)
94-
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'x86_64-unknown-linux-gnu'
94+
- name: Build Rust CLI binary (aarch64-linux)
95+
if: steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'aarch64-unknown-linux-gnu'
9596
shell: bash
9697
run: |
97-
echo "Checking glibc version requirements for vp binary..."
98-
GLIBC_VERSIONS=$(objdump -T target/x86_64-unknown-linux-gnu/release/vp | grep GLIBC | sed 's/.*GLIBC_//' | cut -d' ' -f1 | sort -V | uniq)
99-
echo "Required glibc versions: $GLIBC_VERSIONS"
100-
# Verify no glibc version higher than 2.17 is required
101-
if echo "$GLIBC_VERSIONS" | grep -E '^2\.(1[8-9]|[2-9][0-9]|[0-9]{3,})$'; then
102-
echo "ERROR: Binary requires glibc > 2.17, which breaks compatibility with older Linux distributions"
103-
echo "Full glibc symbol list:"
104-
objdump -T target/x86_64-unknown-linux-gnu/release/vp | grep GLIBC
105-
exit 1
106-
fi
107-
echo "OK: Binary is compatible with glibc 2.17+"
98+
pnpm exec napi build --use-napi-cross --target ${{ inputs.target }} --release -p vite_global_cli
99+
env:
100+
TARGET_CC: clang
101+
TARGET_CFLAGS: "-D_BSD_SOURCE"
102+
DEBUG: napi:*
108103

109104
- name: Build Rust CLI binary (non-Linux targets)
110-
if: steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux-gnu')
105+
if: steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux')
111106
shell: bash
112107
run: cargo build --release --target ${{ inputs.target }} -p vite_global_cli
113108

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"prepare": "husky"
2222
},
2323
"devDependencies": {
24+
"@napi-rs/cli": "catalog:",
2425
"@oxc-node/cli": "catalog:",
2526
"@oxc-node/core": "catalog:",
2627
"@types/node": "catalog:",

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
"oxlint-tsgolint": "catalog:"
301301
},
302302
"devDependencies": {
303-
"@napi-rs/cli": "^3.4.1",
303+
"@napi-rs/cli": "catalog:",
304304
"@oxc-node/core": "^0.0.32",
305305
"@voidzero-dev/vite-plus-tools": "workspace:",
306306
"rolldown": "workspace:*",

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ packages:
55
- rolldown/packages/*
66
- rolldown-vite
77
- rolldown-vite/packages/*
8+
89
catalog:
910
'@babel/core': ^7.24.7
1011
'@babel/preset-env': ^7.24.7
@@ -14,13 +15,13 @@ catalog:
1415
'@napi-rs/wasm-runtime': ^1.0.0
1516
'@oxc-node/cli': ^0.0.35
1617
'@oxc-node/core': ^0.0.35
17-
'@oxc-project/runtime': =0.111.0
18-
'@oxc-project/types': =0.111.0
18+
'@oxc-project/runtime': '=0.111.0'
19+
'@oxc-project/types': '=0.111.0'
1920
'@pnpm/find-workspace-packages': ^6.0.9
2021
'@rollup/plugin-commonjs': ^29.0.0
2122
'@rollup/plugin-json': ^6.1.0
2223
'@rollup/plugin-node-resolve': ^16.0.0
23-
'@std/yaml': 'npm:@jsr/std__yaml@^1.0.10'
24+
'@std/yaml': npm:@jsr/std__yaml@^1.0.10
2425
'@types/babel__core': 7.20.5
2526
'@types/connect': ^3.4.38
2627
'@types/cross-spawn': ^6.0.6
@@ -75,9 +76,9 @@ catalog:
7576
mocha: ^11.7.5
7677
mri: ^1.2.0
7778
next: ^15.4.3
78-
oxc-minify: =0.111.0
79-
oxc-parser: =0.111.0
80-
oxc-transform: =0.111.0
79+
oxc-minify: '=0.111.0'
80+
oxc-parser: '=0.111.0'
81+
oxc-transform: '=0.111.0'
8182
oxfmt: ^0.27.0
8283
oxlint: ^1.42.0
8384
oxlint-tsgolint: ^0.11.3
@@ -117,9 +118,13 @@ catalog:
117118
yaml: ^2.8.1
118119
zod: ^4.3.5
119120
zx: ^8.1.2
121+
120122
catalogMode: prefer
123+
121124
ignoreScripts: true
125+
122126
minimumReleaseAge: 1440
127+
123128
minimumReleaseAgeExclude:
124129
- '@napi-rs/*'
125130
- '@oxc-project/*'
@@ -148,24 +153,28 @@ minimumReleaseAgeExclude:
148153
- vitepress
149154
- vitest
150155
- unrun
156+
151157
overrides:
152-
'@rolldown/pluginutils': 'workspace:@rolldown/pluginutils@*'
153-
rolldown: 'workspace:rolldown@*'
154-
vite: 'workspace:@voidzero-dev/vite-plus-core@*'
155-
vitest: 'workspace:@voidzero-dev/vite-plus-test@*'
156-
vitest-dev: 'npm:vitest@^4.0.18'
158+
'@rolldown/pluginutils': workspace:@rolldown/pluginutils@*
159+
rolldown: workspace:rolldown@*
160+
vite: workspace:@voidzero-dev/vite-plus-core@*
161+
vitest: workspace:@voidzero-dev/vite-plus-test@*
162+
vitest-dev: npm:vitest@^4.0.18
163+
157164
packageExtensions:
158165
sass-embedded:
159166
peerDependencies:
160167
source-map-js: '*'
161168
peerDependenciesMeta:
162169
source-map-js:
163170
optional: true
171+
164172
patchedDependencies:
165-
sirv@3.0.2: rolldown-vite/patches/sirv@3.0.2.patch
166173
chokidar@3.6.0: rolldown-vite/patches/chokidar@3.6.0.patch
167174
dotenv-expand@12.0.3: rolldown-vite/patches/dotenv-expand@12.0.3.patch
168175
http-proxy-3: rolldown-vite/patches/http-proxy-3.patch
176+
sirv@3.0.2: rolldown-vite/patches/sirv@3.0.2.patch
177+
169178
peerDependencyRules:
170179
allowAny:
171180
- vite

0 commit comments

Comments
 (0)