From 7ae562352a7811aa6440561c7b3a97c05671dc0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Mon, 8 Apr 2024 22:04:57 +0900 Subject: [PATCH] feat(cli): add support for armv7-unknown-linux-muslebihf (#2019) --- .github/workflows/test-release.yaml | 4 +-- .github/workflows/zig.yaml | 23 ++++++++++++++---- cli/src/api/templates/ci-template.ts | 3 +++ cli/src/api/templates/js-binding.ts | 6 ++++- .../__snapshots__/config.spec.ts.snap | Bin 790 -> 813 bytes .../__tests__/__snapshots__/target.spec.ts.md | 7 ++++++ .../__snapshots__/target.spec.ts.snap | Bin 1112 -> 1216 bytes .../__snapshots__/typegen.spec.ts.snap | Bin 4201 -> 4194 bytes .../__snapshots__/version.spec.ts.snap | Bin 411 -> 414 bytes cli/src/utils/ci.ts | 6 +++++ cli/src/utils/target.ts | 1 + examples/napi/index.cjs | 14 +++++++++++ package.json | 1 + 13 files changed, 57 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml index a9477221..b0eec774 100644 --- a/.github/workflows/test-release.yaml +++ b/.github/workflows/test-release.yaml @@ -376,7 +376,7 @@ jobs: ls -la ./cores build-and-test-linux-armv7: - name: stable - armv7-unknown-linux-gnu - node@18 + name: stable - armv7-unknown-linux-gnueabihf - node@20 runs-on: ubuntu-latest steps: @@ -401,7 +401,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: stable-linux-armv7-gnu-node@18-cargo-cache + key: stable-linux-armv7-gnueabihf-node@20-cargo-cache - name: Install dependencies run: | diff --git a/.github/workflows/zig.yaml b/.github/workflows/zig.yaml index 69af356a..4a90f216 100644 --- a/.github/workflows/zig.yaml +++ b/.github/workflows/zig.yaml @@ -26,6 +26,7 @@ jobs: 'x86_64-apple-darwin', 'x86_64-unknown-linux-musl', 'aarch64-unknown-linux-musl', + 'armv7-unknown-linux-musleabihf', ] steps: @@ -49,8 +50,6 @@ jobs: ~/.cargo/git target key: stable-zig-${{ matrix.target }}-cargo-cache - - name: Install aarch64 toolchain - run: rustup target add aarch64-unknown-linux-gnu - name: Install ziglang uses: goto-bus-stop/setup-zig@v2 with: @@ -94,6 +93,10 @@ jobs: target: x86_64-apple-darwin - host: ubuntu-latest target: aarch64-unknown-linux-musl + docker-platform: arm64 + - host: ubuntu-latest + target: armv7-unknown-linux-musleabihf + docker-platform: arm/v7 steps: - uses: actions/checkout@v4 @@ -105,7 +108,7 @@ jobs: - name: Install dependencies run: | yarn config set --json supportedArchitectures.libc '["current", "musl"]' - yarn config set --json supportedArchitectures.cpu '["current", "arm64"]' + yarn config set --json supportedArchitectures.cpu '["current", "arm64", "arm"]' yarn install --immutable --mode=skip-build - name: Download artifacts uses: actions/download-artifact@v4 @@ -130,13 +133,23 @@ jobs: if: matrix.settings.host == 'ubuntu-latest' - name: Test uses: addnab/docker-run-action@v3 - if: matrix.settings.target == 'aarch64-unknown-linux-musl' + if: matrix.settings.host == 'ubuntu-latest' && matrix.settings.target != 'x86_64-unknown-linux-musl' && matrix.settings.target != 'armv7-unknown-linux-musleabihf' with: image: node:lts-alpine - options: --platform linux/arm64 -v ${{ github.workspace }}:/build -w /build + options: --platform linux/${{ matrix.settings.docker-platform }} -v ${{ github.workspace }}:/build -w /build run: | set -e yarn test + - name: Test + uses: addnab/docker-run-action@v3 + if: matrix.settings.target == 'armv7-unknown-linux-musleabihf' + with: + # https://github.com/nodejs/docker-node/issues/1798 + image: node:18-alpine + options: --platform linux/${{ matrix.settings.docker-platform }} -v ${{ github.workspace }}:/build -w /build + run: | + set -e + yarn test:without-lerna - name: Test uses: addnab/docker-run-action@v3 if: matrix.settings.target == 'x86_64-unknown-linux-musl' diff --git a/cli/src/api/templates/ci-template.ts b/cli/src/api/templates/ci-template.ts index b04d3bc2..40a8fc96 100644 --- a/cli/src/api/templates/ci-template.ts +++ b/cli/src/api/templates/ci-template.ts @@ -58,6 +58,9 @@ jobs: - host: ubuntu-latest target: 'armv7-unknown-linux-gnueabihf' build: ${packageManager} build --platform --target armv7-unknown-linux-gnueabihf --use-napi-cross + - host: ubuntu-latest + target: 'armv7-unknown-linux-musleabihf' + build: ${packageManager} build --platform --target armv7-unknown-linux-musleabihf -x - host: ubuntu-latest target: 'aarch64-linux-android' build: ${packageManager} build --platform --target aarch64-linux-android diff --git a/cli/src/api/templates/js-binding.ts b/cli/src/api/templates/js-binding.ts index aeb141c1..1cb2ec3c 100644 --- a/cli/src/api/templates/js-binding.ts +++ b/cli/src/api/templates/js-binding.ts @@ -125,7 +125,11 @@ function requireNative() { ${requireTuple('linux-arm64-gnu')} } } else if (process.arch === 'arm') { - ${requireTuple('linux-arm-gnueabihf')} + if (isMusl()) { + ${requireTuple('linux-arm-musleabihf')} + } else { + ${requireTuple('linux-arm-gnueabihf')} + } } else if (process.arch === 'riscv64') { if (isMusl()) { ${requireTuple('linux-riscv64-musl')} diff --git a/cli/src/utils/__tests__/__snapshots__/config.spec.ts.snap b/cli/src/utils/__tests__/__snapshots__/config.spec.ts.snap index 38093d0501307b08a9f0ae9d12831b289c82ff6c..d542d762cc92ccd589dff434507cf7e3c945649e 100644 GIT binary patch literal 813 zcmV+|1Je9KRzVbRCTm-J{(*Ibk$iXqHGSL@c#U z`*)QLy&sDR00000000B+mA!A%Kp4iK*FHO;UrE)1kYI?A*y^@GsgNpF6uOiFh6f?dol_-;ApadU|m zt>MMM6?P!F7nIyESX(a?c*y7UJ1SC$ev~GC62LS70pJOMO#nOJ?E%vJNxzX_w9JsG zVP>;gP%lUWWiUX>AgLg&pStq4;Qs1$Ubd2@RA>dEEsB!oG2xZ3I<_UkWJMKT8PrGg z6+p7sU5B_9xI)U1Z0#Fo>wx90BtLJSJd+BwA%J zZJO9N0WS!6Nx<90U7PZKz8a;jS(!{GJ{nbOmx;E0e%jS1iyWjBsTIo)Y*!@zwb9|x z;ZaamT&^K8XF<^oLw;8a;fGsA4rJBM%GT;jXdNg2217j5Cu%>Uu9~;eoLHh6sMB!Ib1WmNktVjI z0Ux4|LkA}Gy-yL_^Ayz{hn}biI=KDVk*Mu)*8G%%8cnonr~|EvzPkN{>el}$RBpjK z5~{yKs4g<#CIjv=;8}a2dc%PC41fll(SR8Zxc3Kys>J|p9tqVy`J(?kipKr&uZHQV r!?a2*;SBPqnN|w*N(0_$K#vZb`;7|K`amUlYT4#D_<|LkRSf_DU+abe literal 790 zcmV+x1L^!hRzVXx4s5>iE=OBrCO5ULo; z#lEC&owH>-Z7RV~5DQ}CFK9Ow)U7j9CuSxPf{Fpb06P+&oj9}?w}~i-A8Mjce!lzO zd-t8+-CL`a9oJk89;~y_4jtAQ59ZyvW9en4)3U?#(A9lLE!}i^#jffV->vB$H5X}> zjV%N&w*yW+_=Lggnq|?D&T4mMDJw-k(nqvOJf{E-JOws@ZD5#aLqxk-USMWONZTwH zixL@-h$@i+IGGV5<7J5C$~LF|$_-j$$xt?AL1^=;z&yge+BL^!JWNJpj7VgVkZ;JF z4EDD~T!#iBLNc{8S@8;F+J+yDx3ePPDESdE8&bc@!XQ$u%wl2=cmk{wL2YKYTF|#Z zc?rA%-X(Okvh>xX-rC*uP#*+5vMGqo1_w&%2U9&cQl zm;sq$?`Exz$8jQ)Yu9Vz@uwyM@o@v0%a+iaa(|)q# zfrARtEb1d)kBV|lw$T|_P&3?8Lp=-{Ne-OkZB*pP=x}H_XWH(oNZEB2H7|#Jltk*` z>&HYwx^8Eam)UQjNv|61p;twxZm&jl`~PfIuEh=;)nC!5E&{iJd%*MVjp{8Z9{>sG z?-Vc%-2VfODy4un4ja`!d87Zl6qWk5Uo9rz5|b8MkTXJ~#iVtp*C@sJKpx%c>~HK) U=^HAvr_^PB2l#>&omCA003!r*fB*mh diff --git a/cli/src/utils/__tests__/__snapshots__/target.spec.ts.md b/cli/src/utils/__tests__/__snapshots__/target.spec.ts.md index ec16fbae..b022c3b5 100644 --- a/cli/src/utils/__tests__/__snapshots__/target.spec.ts.md +++ b/cli/src/utils/__tests__/__snapshots__/target.spec.ts.md @@ -93,6 +93,13 @@ Generated by [AVA](https://avajs.dev). platformArchABI: 'linux-arm-gnueabihf', triple: 'armv7-unknown-linux-gnueabihf', }, + { + abi: 'musleabihf', + arch: 'arm', + platform: 'linux', + platformArchABI: 'linux-arm-musleabihf', + triple: 'armv7-unknown-linux-musleabihf', + }, { abi: 'eabi', arch: 'arm', diff --git a/cli/src/utils/__tests__/__snapshots__/target.spec.ts.snap b/cli/src/utils/__tests__/__snapshots__/target.spec.ts.snap index 3dd9180326c3407b97de9b31bd84303e85ce8ee6..3d019842695219af1279439188fe92fca1cad7d8 100644 GIT binary patch literal 1216 zcmV;x1V8&hRzV<-O;5eP(f?TrD2+PrdHc-Fn$+@AH?djdE$aW_!LfUH9Bt z*_kd@JRl;Hstf|5Y6<${1BNe_^VKO0M@d!4bfJYM0PQd8|oWGL)kTE5K9Z16A zBs`pi<4Jh+O8zP-VQK_3G{|dE(BJ_L>KeSMNmwF+eXYT_8vL!n{uJDsf~QgvmW*KU zrQlo&)>80W3MO?ps!Ny_!JgLPIUU~7;ermo=x}RV!cr0Ji8L&x;baTkuW2I{hWcz8JIHRE)#4MR!s@Z zM6hp6xMTtrOj~fD1t%>DGb7mh7JO*ImlphG!7W*MEGuDF1baRUFJ|Ff7A|JtpDfJg zBrF@jyd1Q1@KO#w$ibxm$xB%7TFeNigh^hEjR#Xi$%>f0;D$M7NPmgjUU9kii(-2# zGl!&#WUXx17pvY%?*p}Ddo8yjm6^S=Ij^`pcjW%w=jl#$q2JPKXGZsa9k+vrnK@Lj zYqhdd=xuYoeG+!1ErWJ)^Q)X|xOL8*QZ&5x`t_X&fA z3(@T*uf095M&($g+NyN@LT-Rte5K)+|6@68qgC7D;8RArBrSCU26NC7HjYJ+(>ojMs#6GC*Pi(d3>ayG0ZUyBQ(+> zWjcq{9_olDx=tgV&=7-TD63IA%jmR5dzhhdV^``r%#2<4%3SptJTLb46&pM*cHUBn zMbB{-{9&&yy<0xGsU{?)^?i2QS8>;lw9L*L%j`5(u#87UtLQt-@vx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#HUD3iL?D7-5&!`3IV^Pm diff --git a/cli/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap b/cli/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap index cad503c8b92712e4730c9f59ff6d5c41943034ca..541f4d14f927a0dc2d686467a6e85dde86f9f9d1 100644 GIT binary patch literal 4194 zcmY+EcRUn;-^Z=XWmEQLB}s_G;fU+1cC43L&;WdAwJU5hy{kUR!c4W!rL^E@?J9sr5__+o7n=e+QC3^rH+7)7qgjRGFQTf{ zY%*z=pz$qa4&gVfb&#MKyn22pI*jz;|9gBlLERaBd1~JtBdQ??5J^nP8kN`O*huL0 z(4gvSL`vNIyH+IK#S(m~+}dzje>#!ddXf1u_;mWp&wFR!_i6oTprf5Qna^>WBN8aB zx8ldOq;PfmInGrv$Q3+zghoi7O{em~$~wUHieW$JKc?6LsPd3egC)gM_z*q_`c zsVP{72iIG!i^zcsb|&w_a%K>hBPnj$X<+f>-WUT@e3158GQ~aZxZ`y?_ zzR);j^cEi0S#7!1JbAwr@{{?FUe;E7p#POpfQoC(44vJf`GW+XUiJvQ8qB_=h*n@? zuorMvKI?~Q!HNufwlGDRkkfHJ;uxy5N9Nz@1?bTyB_NZite6`On0QFGuGE#0qo9KB z_-hPSRZXcwCaksQvN5E1?FLgGV(WRoenyW|qRzn%&Oqj5jip$6A0f+(2d4bErJ{Vb zwQz;>swDtA^$d6Nlmn!OsTp}Dq8?KFx2*>(QrcYLYZoY}BjowoQ$mse>vD;0fDY+$ zp2QGdn!M}4&O7W#s1pk%MdBi840T0E|80MvIWYKeZ9m%P)h}X+j9hQnxKu4$4~oBp zc&pNXaiCsZygM?%L;l3%i!Ju#x~ZC7YMZ>yQW}0WsQ@sn`6@^genf#4UeU{fnd&>v z#w!6z=ZQso199Qa-)O|1PR3EDEeX7}R@N=wg}qJ>G8c7NjPv_pM<__Gqkm#($}tjqC=i~iuI*$@7h)0-9}NC=b{bYWloDA9 zn|$e-k&{SgZP#c}Zm~4M9VAZImP1Y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;`W{H2)9vMOj$^v;V-_?!qeYZ)$e#4gj4a2uIJkwX z4DH1#Of_~eH_OdcM;&f!ABP{Lfg`!dC50IqnLq}a;a6{);aDygvcvYL~$sD&oD&2aHF7V1MVL(!4kI6sM6KEZw_J~-1=m#Ko6 zi?Y{TR!S`a=c+_5mu-Qwnxjlrb4ka1-qu7E6T?7gb>Y@SpV+UK@utgRSE)0q8(x=9 z=+$GMR&1p?RT7Qc+eGX!&mCK@u_WDu+@9trm@9<&6~Mj8UJS7n3o8YPw&H6O32ki* zrK*i}n%x?0P}vZ+W^vWxbDG7+0lwtSPrcSCRXljG?T4&*C zZAGnnT8EqC+1zBope?*95pJ;uKtbl83cZwqwqW7Me#hvlj*L9@H)86}!>MMXc7HOA z5)PhksP00{jqWvXQtD*owevm}D1-3_r6;Z52O^61XJ_w4(4aTNB#-%$>bl^QSbBE6 zfm*r&=6KLeOJCp|vk>dJwZ1S|FRab+HU;cu{G<$Gub7|;E zZ^`;5;#|5Lrd)l60L>KIU%dH+C_73quceaNN|;8-{DsyVMzY#uz>dvvhB zb1<@&jxzz%>l^oq<=f2KGQp2|8f4*?;qUI=X%U`j4%}#J4wQXaaUz?4lW;~1+AI8Zb94Ycin>k90; z0bcAc3pv8S76r_Xk_w%y8{0U&`v*ghjIV_bZ-ZW diff --git a/cli/src/utils/__tests__/__snapshots__/version.spec.ts.snap b/cli/src/utils/__tests__/__snapshots__/version.spec.ts.snap index a9b699be44fc7a19afd3edb6e71e25e7959be730..5a462fcb5c794bb1fcb538b1b88dc8e755d40165 100644 GIT binary patch literal 414 zcmV;P0b%|@RzVpK1;2~|dRS;er|Wa~Jh_+EJ|)X9l?Lfly|$7`G@p*xScNL~ zQ^kf+9IIipCywhO_ryK(wzXNa& z-~+%9fJ*`f1bh-sDmUq>?=hF# z++;o0Ws3#td#uaN&A%`+Aj~z%R3hzOZ(Ly>$ks90(6ZO}n9W6-OV(pfw$|lBY`}j_ zh-0~u&hhP(*q%fPy;^X0OQa?;@1JPDmHEzrFLxWTG_vx6@ZlQ%lO!Vx@8^;POHe%6j zNi^X?Jo^IP@KwC|3cid}+QHH$H2Ko*H}m~6vt8fc&F16BX!WJzAfD;hPV_Ke%qD!Q zLv8$6^YPpmJ&t+kKL=cg(;(E`=$A!c^pg(bAi@G>;%K#=O#Ij%S>F{_XUPK%Xx`xa z7WIMpL7f6)Bh)AA7uB&Cdq*8Ztqs*HWBfM&`f9aW44MoM8607U#ZI8YpxTDB%OURz zSJ?c55BPG)@jMXr<}B^Zkapr^Q2@%GZ?e)Zgq?k1i^4-Jxk7e@!e%e)MVj0g|1>oA z;3|X@X-TG=NJ-sN^ixNXqw@I!%6GE7SIDdF01jDB9#Aa+lwAgR1wc0ss1e{g12|>C zpae*^NUR=Ny*#tN!&E}4GQcYVi0P8$=9!J1o9=G`^rvv~baF+LD=F~m{s6H46*CwE F006PF#-#uN diff --git a/cli/src/utils/ci.ts b/cli/src/utils/ci.ts index d77148db..9e3af6b0 100644 --- a/cli/src/utils/ci.ts +++ b/cli/src/utils/ci.ts @@ -79,6 +79,12 @@ export const CIConfig: Partial< yarn_cpu: 'arm', test_image: 'ghcr.io/napi-rs/napi-rs/nodejs:armhf-${{ matrix.node }}', }, + 'armv7-unknown-linux-musleabihf': { + host: 'ubuntu-latest', + test: false, + yarn_cpu: 'arm', + yarn_libc: 'musl', + }, 'aarch64-linux-android': { host: 'ubuntu-latest', build_setup: [ diff --git a/cli/src/utils/target.ts b/cli/src/utils/target.ts index a44e7b01..9b4e7c96 100644 --- a/cli/src/utils/target.ts +++ b/cli/src/utils/target.ts @@ -19,6 +19,7 @@ export const AVAILABLE_TARGETS = [ 'x86_64-unknown-freebsd', 'i686-pc-windows-msvc', 'armv7-unknown-linux-gnueabihf', + 'armv7-unknown-linux-musleabihf', 'armv7-linux-androideabi', 'universal-apple-darwin', 'riscv64gc-unknown-linux-gnu', diff --git a/examples/napi/index.cjs b/examples/napi/index.cjs index 2cf9a4bd..20dd6cf6 100644 --- a/examples/napi/index.cjs +++ b/examples/napi/index.cjs @@ -246,7 +246,20 @@ function requireNative() { } } else if (process.arch === 'arm') { + if (isMusl()) { + try { + return require('./example.linux-arm-musleabihf.node') + } catch (e) { + loadErrors.push(e) + } try { + return require('@examples/napi-linux-arm-musleabihf') + } catch (e) { + loadErrors.push(e) + } + + } else { + try { return require('./example.linux-arm-gnueabihf.node') } catch (e) { loadErrors.push(e) @@ -257,6 +270,7 @@ function requireNative() { loadErrors.push(e) } + } } else if (process.arch === 'riscv64') { if (isMusl()) { try { diff --git a/package.json b/package.json index e81e24f8..f5beb2fd 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "format:toml": "taplo format", "lint": "eslint -c .eslintrc.yml .", "test": "lerna run test --concurrency=1 --ignore @napi-rs/cli", + "test:without-lerna": "yarn workspaces foreach -A --exclude \"{cli,napi-rs}\" run test", "test:bun": "bun test examples/napi/__tests__/values.spec.ts", "test:cli": "yarn workspace @napi-rs/cli test", "test:electron": "electron examples/napi/electron.cjs",