From 0fe3ab155c30551b26f1e4b448e38371ad89f641 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:29:39 -0400 Subject: [PATCH] rebuild some problematic packages for arm64 node-gyp does not support cross compilation https://github.com/nodejs/node-gyp/issues/829 . prebuild-install properly detects that the current system is arm64 and there are not prebuilts available which causes the node-gyp rebuild to be executed in yarn. However since node-gyp does not support cross compilation is ends up building x86_64 binaries again. Additionally, the package.json of desktop-trampoline and desktop-notifications call the system install of node-gyp and not the version installed by node. The system install of node-gyp has an issue that causes linking to fail during cross compilation. Calling with npx results in using the node install of node-gyp and avoids this issue. --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26e8579904f..f05af552867 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,6 +78,18 @@ jobs: run: yarn env: npm_config_arch: ${{ matrix.arch }} + - name: Rebuild some native packages for arm64 + if: ${{ matrix.os == 'ubuntu-20.04' && matrix.arch == 'arm64' }} + env: + npm_config_arch: ${{ matrix.arch }} + run: | + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu + cd app/node_modules/desktop-trampoline + CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ npx node-gyp rebuild + cd ../../../ + cd app/node_modules/desktop-notifications + CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ npx node-gyp rebuild + cd ../../../ - name: Validate Electron version run: yarn run validate-electron-version - name: Lint