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 : |
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 : |
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
0 commit comments