swc-project / swc

Rust-based platform for the Web

Home Page:https://swc.rs

Repository from Github https://github.comswc-project/swcRepository from Github https://github.comswc-project/swc

v1.13.19 fails to build on ARM

mustanggb opened this issue · comments

Describe the bug

The previous release v1.13.5 builds on both AMD64 and ARM64.

However the new release v1.13.19 builds on AMD64, but fails to build on ARM64.

Input code

Config

Link to the code that reproduces this issue

Not applicable

SWC Info output

No response

Expected behavior

Previous release works on ARM64.

# yarn add @swc/core@1.13.5
➤ YN0000: · Yarn 4.10.3
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @swc/core@npm:1.13.5, @swc/core-darwin-arm64@npm:1.13.5, @swc/core-darwin-x64@npm:1.13.5, and 9 more.
➤ YN0000: └ Completed in 0s 460ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 3 packages were added to the project (+ 39.79 MiB).
➤ YN0000: └ Completed in 0s 980ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ @swc/core@npm:1.13.5 [89330] must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 0s 971ms
➤ YN0000: · Done with warnings in 2s 644ms

Actual behavior

New release fails on ARM64.

# yarn add @swc/core@1.13.19
➤ YN0000: · Yarn 4.10.3
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @swc/core@npm:1.13.19, @swc/core-darwin-arm64@npm:1.13.19, @swc/core-darwin-x64@npm:1.13.19, and 9 more.
➤ YN0000: └ Completed in 0s 486ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 3 packages were added to the project (+ 39.33 MiB).
➤ YN0000: └ Completed in 0s 955ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ @swc/core@npm:1.13.19 [89330] must be built because it never has been before or the last one failed
➤ YN0009: │ @swc/core@npm:1.13.19 [89330] couldn't be built successfully (exit code 129, logs can be found here: /tmp/xfs-56708825/build.log)
➤ YN0000: └ Completed in 2s 743ms
➤ YN0000: · Failed with errors in 4s 298ms

build.log

# This file contains the result of Yarn building a package (@swc/core@virtual:89330598b4331d00a5582adce1d8ee73be9a2882b577f43d7a976fd7250e3eaec26d0c4161dbd30caedfcf07a2aee7f328a717ea0bd55f08ad9927c8db05d9e6#npm:1.13.19)
# Script name: postinstall

Version

v1.13.19

Additional context

Yarn v4.10.3 with PnP

cc @Brooooooklyn Can you take a look?

the error comes from the postinstall script in @swc/core

cc @kwonoj Do you have any ideas?

commented

Patch-level update shouldn't break my build. Please fix. 🙏

This is breaking our build. Please take some actions

same for us - all builds failing in docker containers on ARM processors, but works fine on Mac ARM processor 🤔

We are experiencing a similar issue with npm, that happens with both 1.13.5 and 1.13.9. Some days ago, though, we were able to build without any problems.

#0 206.5 npm error path /opt/node_modules/@swc/core
#0 206.5 npm error command failed
#0 206.5 npm error signal SIGSEGV
#0 206.5 npm error command sh -c node postinstall.js

Can you just all wait? I’m already aware of the issue. Such comments disturbs issue resolution and does not help at all

I've been trying to work around this (@swc/core is a dependency in another project) - no luck for me (using yarn classic v1.22.22), because even though I have specified:

"resolutions": {
  "@swc/core": "1.13.5"   
}

in my project's package.json, yarn is still downloading 1.13.9 and then segfaulting.

If you're using npm you can add this to your package.json to try and ensure you're using the earlier version:

"overrides": {
  "@swc/core": "1.13.5"
}

I've also tried manually installing the earlier version of @swc/core and then setting SWC_BINARY_PATH to point at this:

# install earlier working binary 
cd /home/home
yarn add -D @swc/cli @swc/core@1.13.5
# use the path to this when yarn installing the main project
cd /opt
SWC_BINARY_PATH=/home/node/node_modules/.bin/swc yarn install

But that still fails for me, because yarn insists on using the 1.13.9 version regardless:

/home/node/.cache/yarn/v6/.tmp/7302a6af06fdb17a704be9c921a01ce2.682f190412b5977c7e7e8dcff146eacaa14c9aaf.prepare/node_modules/@swc/core

for the post-install step 🤷‍♂️ - hopefully might work for you if you're not using yarn classic?

UPDATE: switched our CI over to use npm added the overrides section to package.json and we're good again.

I just tried with creating an empty repo but couldn't repo. For the anyone seeing this issue, please

  • create a minimal reproducible repo and share gh link
  • share full logs for failure instead of yarn's output only
 ... (exit code 129, logs can be found here: /tmp/xfs-56708825/build.log) -> this

@kwonoj Just to clarify I did share the full build.log file output in the original post, granted there wasn't much in it.

Not quite a GitHub repo, but here are some minimal repro steps:

docker run --platform linux/arm64 -it --rm alpine:3.22 sh
apk add --no-cache nodejs-current
corepack enable
corepack prepare yarn@4.6.0 --activate
cd /opt/
yarn set version 4.10.3
yarn add @swc/core@1.13.5
yarn remove @swc/core
yarn add @swc/core@1.13.19

Here is the segfault when installed with npm:

0 verbose cli /usr/bin/node /usr/bin/npm
1 info using npm@11.3.0
2 info using node@v23.11.1
3 silly config load:file:/usr/lib/node_modules/npm/npmrc
4 silly config load:file:/opt/.npmrc
5 silly config load:file:/root/.npmrc
6 silly config load:file:/etc/npmrc
7 verbose title npm install @swc/core@1.13.19
8 verbose argv "install" "@swc/core@1.13.19"
9 verbose logfile logs-max:10 dir:/root/.npm/_logs/2025-09-26T21_31_51_226Z-
10 verbose logfile /root/.npm/_logs/2025-09-26T21_31_51_226Z-debug-0.log
11 silly logfile done cleaning log files
12 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
13 silly idealTree buildDeps
14 silly fetch manifest @swc/core@1.13.19
15 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore cache-miss
16 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore 189ms (cache miss)
17 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore set size:undefined disposed:false
18 silly fetch manifest @swc/helpers@>=0.5.17
19 silly packumentCache full:https://registry.npmjs.org/@swc%2fhelpers cache-miss
20 http fetch GET 200 https://registry.npmjs.org/@swc%2fhelpers 52ms (cache miss)
21 silly packumentCache full:https://registry.npmjs.org/@swc%2fhelpers set size:undefined disposed:false
22 silly placeDep ROOT @swc/core@1.13.19 OK for:  want: 1.13.19
23 silly fetch manifest @swc/types@^0.1.25
24 silly packumentCache full:https://registry.npmjs.org/@swc%2ftypes cache-miss
25 silly fetch manifest @swc/counter@^0.1.3
26 silly packumentCache full:https://registry.npmjs.org/@swc%2fcounter cache-miss
27 silly fetch manifest @swc/core-darwin-x64@1.13.19
28 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-darwin-x64 cache-miss
29 http fetch GET 200 https://registry.npmjs.org/@swc%2ftypes 41ms (cache miss)
30 silly packumentCache full:https://registry.npmjs.org/@swc%2ftypes set size:undefined disposed:false
31 silly fetch manifest @swc/core-darwin-arm64@1.13.19
32 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-darwin-arm64 cache-miss
33 http fetch GET 200 https://registry.npmjs.org/@swc%2fcounter 58ms (cache miss)
34 silly packumentCache full:https://registry.npmjs.org/@swc%2fcounter set size:undefined disposed:false
35 silly fetch manifest @swc/core-linux-x64-gnu@1.13.19
36 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-x64-gnu cache-miss
37 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-darwin-x64 127ms (cache miss)
38 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-darwin-x64 set size:undefined disposed:false
39 silly fetch manifest @swc/core-linux-x64-musl@1.13.19
40 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-x64-musl cache-miss
41 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-darwin-arm64 118ms (cache miss)
42 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-darwin-arm64 set size:undefined disposed:false
43 silly fetch manifest @swc/core-win32-x64-msvc@1.13.19
44 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-win32-x64-msvc cache-miss
45 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-linux-x64-gnu 141ms (cache miss)
46 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-x64-gnu set size:undefined disposed:false
47 silly fetch manifest @swc/core-linux-arm64-gnu@1.13.19
48 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-arm64-gnu cache-miss
49 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-linux-x64-musl 114ms (cache miss)
50 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-x64-musl set size:undefined disposed:false
51 silly fetch manifest @swc/core-win32-ia32-msvc@1.13.19
52 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-win32-ia32-msvc cache-miss
53 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-win32-x64-msvc 111ms (cache miss)
54 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-win32-x64-msvc set size:undefined disposed:false
55 silly fetch manifest @swc/core-linux-arm64-musl@1.13.19
56 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-arm64-musl cache-miss
57 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-linux-arm64-gnu 103ms (cache miss)
58 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-arm64-gnu set size:undefined disposed:false
59 silly fetch manifest @swc/core-win32-arm64-msvc@1.13.19
60 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-win32-arm64-msvc cache-miss
61 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-win32-ia32-msvc 106ms (cache miss)
62 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-win32-ia32-msvc set size:undefined disposed:false
63 silly fetch manifest @swc/core-linux-arm-gnueabihf@1.13.19
64 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-arm-gnueabihf cache-miss
65 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-linux-arm64-musl 114ms (cache miss)
66 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-arm64-musl set size:undefined disposed:false
67 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-win32-arm64-msvc 99ms (cache miss)
68 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-win32-arm64-msvc set size:undefined disposed:false
69 http fetch GET 200 https://registry.npmjs.org/@swc%2fcore-linux-arm-gnueabihf 79ms (cache miss)
70 silly packumentCache full:https://registry.npmjs.org/@swc%2fcore-linux-arm-gnueabihf set size:undefined disposed:false
71 silly placeDep ROOT @swc/core-darwin-arm64@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
72 silly placeDep ROOT @swc/core-darwin-x64@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
73 silly placeDep ROOT @swc/core-linux-arm-gnueabihf@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
74 silly placeDep ROOT @swc/core-linux-arm64-gnu@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
75 silly placeDep ROOT @swc/core-linux-arm64-musl@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
76 silly placeDep ROOT @swc/core-linux-x64-gnu@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
77 silly placeDep ROOT @swc/core-linux-x64-musl@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
78 silly placeDep ROOT @swc/core-win32-arm64-msvc@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
79 silly placeDep ROOT @swc/core-win32-ia32-msvc@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
80 silly placeDep ROOT @swc/core-win32-x64-msvc@1.13.19 OK for: @swc/core@1.13.19 want: 1.13.19
81 silly placeDep ROOT @swc/counter@0.1.3 OK for: @swc/core@1.13.19 want: ^0.1.3
82 silly placeDep ROOT @swc/types@0.1.25 OK for: @swc/core@1.13.19 want: ^0.1.25
83 silly reify moves {}
84 silly audit bulk request {
84 silly audit   '@swc/core': [ '1.13.19' ],
84 silly audit   '@swc/core-darwin-arm64': [ '1.13.19' ],
84 silly audit   '@swc/core-darwin-x64': [ '1.13.19' ],
84 silly audit   '@swc/core-linux-arm-gnueabihf': [ '1.13.19' ],
84 silly audit   '@swc/core-linux-arm64-gnu': [ '1.13.19' ],
84 silly audit   '@swc/core-linux-arm64-musl': [ '1.13.19' ],
84 silly audit   '@swc/core-linux-x64-gnu': [ '1.13.19' ],
84 silly audit   '@swc/core-linux-x64-musl': [ '1.13.19' ],
84 silly audit   '@swc/core-win32-arm64-msvc': [ '1.13.19' ],
84 silly audit   '@swc/core-win32-ia32-msvc': [ '1.13.19' ],
84 silly audit   '@swc/core-win32-x64-msvc': [ '1.13.19' ],
84 silly audit   '@swc/counter': [ '0.1.3' ],
84 silly audit   '@swc/types': [ '0.1.25' ]
84 silly audit }
85 verbose reify failed optional dependency /opt/node_modules/@swc/core-win32-x64-msvc
86 silly reify mark deleted [ '/opt/node_modules/@swc/core-win32-x64-msvc' ]
87 verbose reify failed optional dependency /opt/node_modules/@swc/core-win32-ia32-msvc
88 silly reify mark deleted [ '/opt/node_modules/@swc/core-win32-ia32-msvc' ]
89 verbose reify failed optional dependency /opt/node_modules/@swc/core-win32-arm64-msvc
90 silly reify mark deleted [ '/opt/node_modules/@swc/core-win32-arm64-msvc' ]
91 verbose reify failed optional dependency /opt/node_modules/@swc/core-linux-x64-musl
92 silly reify mark deleted [ '/opt/node_modules/@swc/core-linux-x64-musl' ]
93 verbose reify failed optional dependency /opt/node_modules/@swc/core-linux-x64-gnu
94 silly reify mark deleted [ '/opt/node_modules/@swc/core-linux-x64-gnu' ]
95 verbose reify failed optional dependency /opt/node_modules/@swc/core-linux-arm64-gnu
96 silly reify mark deleted [ '/opt/node_modules/@swc/core-linux-arm64-gnu' ]
97 verbose reify failed optional dependency /opt/node_modules/@swc/core-linux-arm-gnueabihf
98 silly reify mark deleted [ '/opt/node_modules/@swc/core-linux-arm-gnueabihf' ]
99 verbose reify failed optional dependency /opt/node_modules/@swc/core-darwin-x64
100 silly reify mark deleted [ '/opt/node_modules/@swc/core-darwin-x64' ]
101 verbose reify failed optional dependency /opt/node_modules/@swc/core-darwin-arm64
102 silly reify mark deleted [ '/opt/node_modules/@swc/core-darwin-arm64' ]
103 http cache @swc/types@https://registry.npmjs.org/@swc/types/-/types-0.1.25.tgz 0ms (cache hit)
104 http cache @swc/counter@https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz 0ms (cache hit)
105 http cache @swc/core-linux-arm64-musl@https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.13.19.tgz 0ms (cache hit)
106 http cache @swc/core@https://registry.npmjs.org/@swc/core/-/core-1.13.19.tgz 0ms (cache hit)
107 silly tarball no local data for @swc/types@https://registry.npmjs.org/@swc/types/-/types-0.1.25.tgz. Extracting by manifest.
108 silly tarball no local data for @swc/counter@https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz. Extracting by manifest.
109 silly tarball no local data for @swc/core-linux-arm64-musl@https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.13.19.tgz. Extracting by manifest.
110 silly tarball no local data for @swc/core@https://registry.npmjs.org/@swc/core/-/core-1.13.19.tgz. Extracting by manifest.
111 http fetch GET 200 https://registry.npmjs.org/@swc/types/-/types-0.1.25.tgz 71ms (cache miss)
112 http fetch GET 200 https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz 80ms (cache miss)
113 http fetch GET 200 https://registry.npmjs.org/@swc/core/-/core-1.13.19.tgz 174ms (cache miss)
114 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 194ms
115 silly audit report {}
116 http fetch GET 200 https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.13.19.tgz 803ms (cache miss)
117 info run @swc/core@1.13.19 postinstall node_modules/@swc/core node postinstall.js
118 info run @swc/core@1.13.19 postinstall { code: null, signal: 'SIGSEGV' }
119 verbose stack Error: command failed
119 verbose stack     at promiseSpawn (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
119 verbose stack     at spawnWithShell (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
119 verbose stack     at promiseSpawn (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
119 verbose stack     at runScriptPkg (/usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:79:13)
119 verbose stack     at runScript (/usr/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
119 verbose stack     at /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:331:17
119 verbose stack     at run (/usr/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:67:22)
119 verbose stack     at /usr/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:84:9
119 verbose stack     at new Promise (<anonymous>)
119 verbose stack     at callLimit (/usr/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:35:69)
120 verbose pkgid @swc/core@1.13.19
121 error path /opt/node_modules/@swc/core
122 error command failed
123 error signal SIGSEGV
124 error command sh -c node postinstall.js
125 silly unfinished npm timer reify 1758922311735
126 silly unfinished npm timer reify:build 1758922313428
127 silly unfinished npm timer build 1758922313428
128 silly unfinished npm timer build:deps 1758922313428
129 silly unfinished npm timer build:run:postinstall 1758922313430
130 silly unfinished npm timer build:run:postinstall:node_modules/@swc/core 1758922313430
131 verbose cwd /opt
132 verbose os Linux 6.8.0-1035-aws
133 verbose node v23.11.1
134 verbose npm  v11.3.0
135 verbose exit 1
136 verbose code 1
137 error A complete log of this run can be found in: /root/.npm/_logs/2025-09-26T21_31_51_226Z-debug-0.log