Closed alextran1502 closed 4 years ago
Hi Alex,
ncc doesn't compile for a specific target, it bundles javascript from multiple js files into a single js file.
If you have native dependencies, you'll need to use npm install
or yarn install
with the correct target arch which it outside the scope of ncc.
See this answer: https://stackoverflow.com/a/45988975/266535
@alextran1502 did you find a solution for this? I'm currently stuck with serial-port
and the same issue as you. Running ncc build
in WSL and Github Actions seems to install the wrong binaries. If I build on the RPI, it works fine.
You will have to build it from the RPI or choose the correct machine architecture on github action to build it on. If i remember correctly it is arm64v7
On Tue, Mar 8, 2022 at 11:23 AM Dominik Kohler @.***> wrote:
@alextran1502 https://github.com/alextran1502 did you find a solution for this? I'm currently stuck with serial-port and the same issue as you. Running ncc build in WSL and Github Actions seems to install the wrong binaries. If I build on the RPI, it works fine.
— Reply to this email directly, view it on GitHub https://github.com/vercel/ncc/issues/576#issuecomment-1062019065, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGONL7VBMVPUBBTBO7JYNETU66EHZANCNFSM4P7DGBUQ . You are receiving this because you were mentioned.Message ID: @.***>
As far as I'm aware there's no native possibility to use arm architecture with github actions yet.
Therefore I used an action using QEMU.
name: Build for RPI
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: uraimo/run-on-arch-action@v2.1.1
with:
arch: aarch64
distro: bullseye
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y ca-certificates curl wget build-essential --no-install-recommends
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
run: |
npm ci --no-audit
npm run build
Hello,
There are some libraries such as
serial-port
ornode-usb
that needed to be built on the target platform to generate the correct binary. How do I cross build a project for Raspberry Pi if I am on Mac/Linux?Thanks, Alex