Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions .github/workflows/release_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,23 @@ jobs:
target: powerpc64le-unknown-linux-gnu
build: pnpm run build-napi-release --target powerpc64le-unknown-linux-gnu --use-napi-cross

- os: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
build: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
export TARGET_CC=riscv64-linux-gnu-gcc
export CXX=riscv64-linux-gnu-g++
pnpm run build-napi-release --target riscv64gc-unknown-linux-gnu

- os: ubuntu-latest
target: riscv64gc-unknown-linux-musl
build: pnpm run build-napi-release --target riscv64gc-unknown-linux-musl -x

- os: ubuntu-latest
target: s390x-unknown-linux-gnu
build: export CFLAGS="-fuse-ld=lld" && pnpm run build-napi-release --target s390x-unknown-linux-gnu --use-napi-cross

name: Build Oxlint ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -141,9 +158,15 @@ jobs:
run: ${{ matrix.build }}

- name: Build Rust binary
if: ${{ !contains(matrix.target, 'wasm') && !contains(matrix.target, 'android') && !contains(matrix.target, 'ohos') }}
if: ${{ !contains(matrix.target, 'wasm') && !contains(matrix.target, 'android') && !contains(matrix.target, 'ohos') && !contains(matrix.target, 'riscv64gc-unknown-linux-musl') }}
run: cross build --release -p oxlint --features allocator --target=${{ matrix.target }}

- name: Build Rust binary (zigbuild)
if: ${{ contains(matrix.target, 'riscv64gc-unknown-linux-musl') }}
run: |
pip3 install cargo-zigbuild
cargo zigbuild --release -p oxlint --features allocator --target=${{ matrix.target }}

- name: Upload NAPI artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
Expand Down Expand Up @@ -357,6 +380,23 @@ jobs:
target: powerpc64le-unknown-linux-gnu
build: pnpm run build-napi-release --target powerpc64le-unknown-linux-gnu --use-napi-cross

- os: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
build: |
sudo apt-get update
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
export TARGET_CC=riscv64-linux-gnu-gcc
export CXX=riscv64-linux-gnu-g++
pnpm run build-napi-release --target riscv64gc-unknown-linux-gnu

- os: ubuntu-latest
target: riscv64gc-unknown-linux-musl
build: pnpm run build-napi-release --target riscv64gc-unknown-linux-musl -x

- os: ubuntu-latest
target: s390x-unknown-linux-gnu
build: export CFLAGS="-fuse-ld=lld" && pnpm run build-napi-release --target s390x-unknown-linux-gnu --use-napi-cross

name: Build Oxfmt ${{ matrix.target }}
runs-on: ${{ matrix.os }}
env:
Expand Down Expand Up @@ -394,9 +434,15 @@ jobs:
run: ${{ matrix.build }}

- name: Build Rust binary
if: ${{ !contains(matrix.target, 'wasm') && !contains(matrix.target, 'android') && !contains(matrix.target, 'ohos') }}
if: ${{ !contains(matrix.target, 'wasm') && !contains(matrix.target, 'android') && !contains(matrix.target, 'ohos') && !contains(matrix.target, 'riscv64gc-unknown-linux-musl') }}
run: cross build --release -p oxfmt --no-default-features --features allocator --target=${{ matrix.target }}

- name: Build Rust binary (zigbuild)
if: ${{ contains(matrix.target, 'riscv64gc-unknown-linux-musl') }}
run: |
pip3 install cargo-zigbuild
cargo zigbuild --release -p oxfmt --no-default-features --features allocator --target=${{ matrix.target }}

- name: Upload NAPI artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
Expand Down
4 changes: 2 additions & 2 deletions apps/oxfmt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ napi-build = { workspace = true }

[dev-dependencies]

[target.'cfg(not(any(target_os = "linux", target_os = "freebsd", target_arch = "arm", target_family = "wasm")))'.dependencies]
[target.'cfg(not(any(target_os = "linux", target_os = "freebsd", target_arch = "arm", target_arch = "riscv64", target_family = "wasm")))'.dependencies]
mimalloc-safe = { workspace = true, optional = true, features = ["skip_collect_on_exit"] }

[target.'cfg(all(target_os = "linux", not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies]
[target.'cfg(all(target_os = "linux", not(target_arch = "arm"), not(target_arch = "aarch64"), not(target_arch = "riscv64")))'.dependencies]
mimalloc-safe = { workspace = true, optional = true, features = [
"skip_collect_on_exit",
"local_dynamic_tls",
Expand Down
8 changes: 7 additions & 1 deletion apps/oxfmt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ pub use main_napi::*;

#[cfg(all(
feature = "allocator",
not(any(target_arch = "arm", miri, target_os = "freebsd", target_family = "wasm"))
not(any(
target_arch = "arm",
target_arch = "riscv64",
miri,
target_os = "freebsd",
target_family = "wasm"
))
))]
#[global_allocator]
static GLOBAL: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;
4 changes: 2 additions & 2 deletions apps/oxlint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
tracing-subscriber = { workspace = true, features = [] } # Omit the `regex` feature
tower-lsp-server = { workspace = true, features = ["proposed"] }

[target.'cfg(not(any(target_os = "linux", target_os = "freebsd", target_arch = "arm", target_family = "wasm")))'.dependencies]
[target.'cfg(not(any(target_os = "linux", target_os = "freebsd", target_arch = "arm", target_arch = "riscv64", target_family = "wasm")))'.dependencies]
mimalloc-safe = { workspace = true, optional = true, features = ["skip_collect_on_exit"] }

[target.'cfg(all(target_os = "linux", not(target_arch = "arm"), not(target_arch = "aarch64")))'.dependencies]
[target.'cfg(all(target_os = "linux", not(target_arch = "arm"), not(target_arch = "aarch64"), not(target_arch = "riscv64")))'.dependencies]
mimalloc-safe = { workspace = true, optional = true, features = [
"skip_collect_on_exit",
"local_dynamic_tls",
Expand Down
8 changes: 7 additions & 1 deletion apps/oxlint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ mod js_plugins;
// `--features allocator` is only used in release builds.
#[cfg(all(
feature = "allocator",
not(any(target_arch = "arm", miri, target_os = "freebsd", target_family = "wasm"))
not(any(
target_arch = "arm",
target_arch = "riscv64",
miri,
target_os = "freebsd",
target_family = "wasm"
))
))]
#[global_allocator]
static GLOBAL: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;
Expand Down
Loading