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
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[env]
JEMALLOC_SYS_WITH_MALLOC_CONF = "dirty_decay_ms:1000,muzzy_decay_ms:0"

[build]
target-dir = 'dist/target'

Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
bash -c "
set -e
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
apk add --no-cache curl xz openjdk21
apk add --no-cache curl xz openjdk21 build-base lld

# Set up Java 21
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
Expand All @@ -194,6 +194,10 @@ jobs:
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version

# Help clang find GCC runtime (crtbeginS.o, libgcc) and use lld for jemalloc build
GCC_DIR=\$(dirname \$(find /usr/lib/gcc -name crtbeginS.o | head -1))
export CFLAGS=\"\${CFLAGS} -fuse-ld=lld --gcc-install-dir=\${GCC_DIR}\"

# Install deps and run native build
pnpm install --frozen-lockfile
rustup target add x86_64-unknown-linux-musl
Expand Down Expand Up @@ -230,6 +234,9 @@ jobs:
node --version
npm --version

# Help clang find GCC runtime (crtbeginS.o, libgcc) and use lld for jemalloc build
export CFLAGS="${CFLAGS} -fuse-ld=lld --gcc-toolchain=/usr/aarch64-unknown-linux-gnu"

npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version

Expand Down Expand Up @@ -260,7 +267,7 @@ jobs:
bash -c "
set -e
echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
apk add --no-cache curl xz openjdk21
apk add --no-cache curl xz openjdk21 build-base lld

# Set up Java 21
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk
Expand All @@ -280,6 +287,10 @@ jobs:
npm i -g pnpm@${PNPM_VERSION} --force
pnpm --version

# Help clang find GCC runtime (crtbeginS.o, libgcc) and use lld for jemalloc build
GCC_DIR=\$(dirname \$(find /aarch64-linux-musl-cross/lib/gcc -name crtbeginS.o | head -1))
export CFLAGS=\"\${CFLAGS} -fuse-ld=lld --gcc-install-dir=\${GCC_DIR}\"

# Install deps and run native build
pnpm install --frozen-lockfile
rustup target add aarch64-unknown-linux-musl
Expand Down
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/nx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ winapi = { version = "0.3", features = ["fileapi", "psapi"] }
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"

# Windows excluded: tikv-jemalloc-sys fails to build with MSVC (spaces in cl.exe path break configure).
# Track https://github.com/tikv/jemallocator/pull/99 for upstream fix.
[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies]
tikv-jemallocator = { version = "0.6", features = ["disable_initial_exec_tls"] }

[target.'cfg(all(not(windows), not(target_family = "wasm")))'.dependencies]
mio = "1.0"
nix = { version = "0.30.0", features = ["process", "signal"] }
Expand Down
6 changes: 6 additions & 0 deletions packages/nx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
#[macro_use]
extern crate napi_derive;

// Windows excluded: tikv-jemalloc-sys fails to build with MSVC.
// Track https://github.com/tikv/jemallocator/pull/99
#[cfg(any(target_os = "linux", target_os = "macos"))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

pub mod native;
Loading