build: workaround for GLIBC pthread_key_create bug (#2494)

This commit is contained in:
LongYinan 2025-03-03 12:22:40 +08:00 committed by GitHub
parent 27dd31b039
commit 02205ddbeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

6
.cargo/config.toml Normal file
View File

@ -0,0 +1,6 @@
# https://sourceware.org/bugzilla/show_bug.cgi?id=21032
# https://sourceware.org/bugzilla/show_bug.cgi?id=21031
# https://github.com/rust-lang/rust/issues/134820
# pthread_key_create() destructors and segfault after a DSO unloading
[target.'cfg(all(target_env = "gnu", not(target_os = "windows")))']
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]

View File

@ -175,6 +175,8 @@ jobs:
- name: Unit tests
if: matrix.settings.test
env:
NODE_OPTIONS: '--max-old-space-size=6000'
run: ${{ matrix.settings.test }}
- name: Electron tests
@ -478,6 +480,8 @@ jobs:
run: |
node -e "console.info('docker-image=${{ matrix.settings.image }}'.replace('{:version}', ${{ matrix.node }}))" >> "$GITHUB_OUTPUT"
- name: Run test
# Node.js on qemu randomly segfaults on powerpc64le
continue-on-error: ${{ matrix.settings.target == 'powerpc64le-unknown-linux-gnu' }}
run: docker run --rm ${{ matrix.settings.args }} -v ${{ github.workspace }}:/build -w /build ${{ steps.image-name.outputs.docker-image }} sh -c "NODE_OPTIONS=--max-old-space-size=6000 DISABLE_V8_COMPILE_CACHE=1 yarn workspace @examples/napi test -s"
build-and-test-linux-armv7:
@ -600,6 +604,7 @@ jobs:
RUSTUP_HOME: /home/runner/rustup
CARGO_HOME: /home/runner/cargo
RUSTUP_IO_THREADS: 1
NODE_OPTIONS: '--max-old-space-size=6000'
with:
operating_system: freebsd
version: '14.2'