Skip to content

Commit 5798c1d

Browse files
authored
Merge branch 'main' into renovate/pnpm-package-manager
2 parents 82adc4b + c716b8e commit 5798c1d

10 files changed

Lines changed: 66 additions & 22 deletions

File tree

.github/actions/artifact/download/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
using: composite
1919
steps:
2020
- name: Download artifact from github
21-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
21+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
2222
if: ${{ inputs.force-use-github == 'true' || runner.environment == 'github-hosted' }}
2323
with:
2424
name: ${{ inputs.name }}

.github/actions/artifact/upload/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
using: composite
1919
steps:
2020
- name: Upload artifact to github
21-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
21+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
2222
if: ${{ inputs.force-use-github == 'true' || runner.environment == 'github-hosted' }}
2323
with:
2424
name: ${{ inputs.name }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Zigbuild
2+
3+
description: Build a musl target using cargo-zigbuild (avoids Docker with outdated Node.js)
4+
5+
inputs:
6+
target:
7+
required: true
8+
type: string
9+
profile:
10+
default: "release"
11+
required: false
12+
type: string
13+
zig-version:
14+
default: "0.14.1"
15+
required: false
16+
type: string
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Setup Rust Target
22+
shell: bash
23+
run: rustup target add ${{ inputs.target }}
24+
25+
- name: Setup Zig
26+
uses: mlugg/setup-zig@v2
27+
with:
28+
version: ${{ inputs.zig-version }}
29+
30+
- name: Install cargo-zigbuild
31+
uses: taiki-e/install-action@v2
32+
env:
33+
GITHUB_TOKEN: ${{ github.token }}
34+
with:
35+
tool: cargo-zigbuild
36+
37+
- name: Build ${{ inputs.target }}
38+
shell: bash
39+
run: RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }} -x

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
RUST_MIN_STACK: 8388608
3939

4040
- name: Upload Artifact
41-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
41+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
4242
with:
4343
name: codecov
4444
path: lcov.info
@@ -58,7 +58,7 @@ jobs:
5858

5959
- name: Download coverage file
6060
if: env.CODECOV_TOKEN
61-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
61+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
6262
with:
6363
name: codecov
6464

.github/workflows/release-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
uses: ./.github/actions/pnpm
9696

9797
- name: Download artifacts
98-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
98+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
9999
with:
100100
path: artifacts
101101

.github/workflows/reusable-build.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,21 @@ jobs:
8989
pre: |
9090
export CC_aarch64_unknown_linux_gnu=clang
9191
92-
- name: Build x86_64-unknown-linux-musl in Docker
92+
- name: Build x86_64-unknown-linux-musl with zigbuild
9393
if: ${{ inputs.target == 'x86_64-unknown-linux-musl' }}
94-
uses: ./.github/actions/docker-build
94+
uses: ./.github/actions/zigbuild
9595
with:
9696
target: ${{ inputs.target }}
97-
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
9897
profile: ${{ inputs.profile }}
99-
pre: |
100-
# musl will enable clang-sys static linking
101-
# https://github.com/KyleMayes/clang-sys?tab=readme-ov-file#static
10298

103-
- name: Build aarch64-unknown-linux-musl in Docker
99+
- name: Build aarch64-unknown-linux-musl with zigbuild
104100
if: ${{ inputs.target == 'aarch64-unknown-linux-musl' }}
105-
uses: ./.github/actions/docker-build
101+
uses: ./.github/actions/zigbuild
106102
with:
107103
target: ${{ inputs.target }}
108-
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
109104
profile: ${{ inputs.profile }}
110-
pre: |
111-
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc
112-
# musl will enable clang-sys static linking
113-
# https://github.com/KyleMayes/clang-sys?tab=readme-ov-file#static
114105

115-
# setup rust target for native runner
106+
# setup rust target for native runner (non-linux)
116107
- name: Setup Rust Target
117108
if: ${{ !contains(inputs.target, 'linux') }}
118109
run: rustup target add ${{ inputs.target }}

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ name = "rspack_resolver"
1515
readme = "README.md"
1616
repository = "https://github.com/rstackjs/rspack-resolver"
1717
rust-version = "1.70"
18-
version = "0.6.7"
18+
version = "0.6.8"
1919

2020
[lib]
2121
doctest = false

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rspack/resolver",
3-
"version": "0.2.6",
3+
"version": "0.2.8-alpha.0",
44
"description": "Rspack Resolver Node API",
55
"main": "index.js",
66
"browser": "browser.js",

scripts/prepublish.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ const UniArchsByPlatform = {
4343
* - `abi` = The ABI, for example `gnu`, `android`, `eabi`, etc.
4444
*/
4545
function parseTriple(rawTriple) {
46+
if (
47+
rawTriple === "wasm32-wasi" ||
48+
rawTriple === "wasm32-wasi-preview1-threads" ||
49+
rawTriple.startsWith("wasm32-wasip")
50+
) {
51+
return {
52+
raw: rawTriple,
53+
platformArchABI: "wasm32-wasi",
54+
platform: "wasi",
55+
arch: "wasm32",
56+
abi: "wasi"
57+
};
58+
}
59+
4660
const triple = rawTriple.endsWith("eabi")
4761
? `${rawTriple.slice(0, -4)}-eabi`
4862
: rawTriple;

0 commit comments

Comments
 (0)