Merge pull request #1039 from napi-rs/musl-zig-cross

Musl zig cross
This commit is contained in:
LongYinan 2022-01-18 14:12:19 +08:00 committed by GitHub
commit d85cbfd926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View file

@ -49,6 +49,14 @@ jobs:
push: true
tags: ghcr.io/${{ github.repository }}/nodejs-rust:lts-debian-zig
- name: Build and push alpine with zig
uses: docker/build-push-action@v2
with:
file: alpine-zig.Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository }}/nodejs-rust:lts-alpine-zig
build_image_arm:
name: Build Node.js arm images
strategy:

11
alpine-zig.Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
ARG ZIG_VERSION=0.9.0
RUN apk add xz && \
rustup target add x86_64-unknown-linux-gnu && \
wget https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz && \
tar -xvf zig-linux-x86_64-${ZIG_VERSION}.tar.xz && \
mv zig-linux-x86_64-${ZIG_VERSION} /usr/local/zig && \
ln -sf /usr/local/zig/zig /usr/local/bin/zig && \
rm zig-linux-x86_64-${ZIG_VERSION}.tar.xz

View file

@ -250,7 +250,7 @@ export class BuildCommand extends Command {
const forwardArgs = process.platform === 'win32' ? '%*' : '$@'
await writeFileAsync(
linkerWrapperShell,
`node ${linkerWrapper} ${forwardArgs}`,
`#!/bin/sh\nnode ${linkerWrapper} ${forwardArgs}`,
{
mode: '777',
},