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,17 +63,18 @@ 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 : |
70- TARGET_CFLAGS="-D_BSD_SOURCE" pnpm --filter=vite-plus build-native --target ${{ inputs.target }} --use-napi-cross
71- TARGET_CFLAGS="-D_BSD_SOURCE" pnpm --filter=vite-plus-cli build-native --target ${{ inputs.target }} --use-napi-cross
70+ pnpm --filter=vite-plus build-native --target ${{ inputs.target }} --use-napi-cross
71+ pnpm --filter=vite-plus-cli build-native --target ${{ inputs.target }} --use-napi-cross
7272 env :
7373 TARGET_CC : clang
74+ TARGET_CFLAGS : ' -D_BSD_SOURCE'
7475 DEBUG : napi:*
7576
76- - name : Build NAPI bindings
77+ - name : Build NAPI bindings (non-Linux targets)
7778 shell : bash
7879 if : steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux')
7980 run : |
@@ -82,32 +83,27 @@ runs:
8283 env :
8384 DEBUG : napi:*
8485
85- - name : Build Rust CLI binary (Linux gnu targets )
86- if : steps.cache-restore.outputs.cache-hit != 'true' && contains( inputs.target, ' linux-gnu')
86+ - name : Build Rust CLI binary (x86_64-linux )
87+ if : steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'x86_64-unknown- linux-gnu'
8788 shell : bash
88- run : pnpm napi build --use-napi-cross --bin vp --target ${{ inputs.target }} --release -p vite_global_cli
89+ run : |
90+ pnpm exec napi build --use-napi-cross --target ${{ inputs.target }} --release -p vite_global_cli
8991 env :
9092 TARGET_CC : clang
9193 DEBUG : napi:*
9294
93- - name : Verify glibc version (x86_64 -linux)
94- if : steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'x86_64 -unknown-linux-gnu'
95+ - name : Build Rust CLI binary (aarch64 -linux)
96+ if : steps.cache-restore.outputs.cache-hit != 'true' && inputs.target == 'aarch64 -unknown-linux-gnu'
9597 shell : bash
9698 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+"
99+ pnpm exec napi build --use-napi-cross --target ${{ inputs.target }} --release -p vite_global_cli
100+ env :
101+ TARGET_CC : clang
102+ TARGET_CFLAGS : ' -D_BSD_SOURCE'
103+ DEBUG : napi:*
108104
109105 - name : Build Rust CLI binary (non-Linux targets)
110- if : steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux-gnu ')
106+ if : steps.cache-restore.outputs.cache-hit != 'true' && !contains(inputs.target, 'linux')
111107 shell : bash
112108 run : cargo build --release --target ${{ inputs.target }} -p vite_global_cli
113109
0 commit comments