Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

node-keytar doesn't load on Linux arm64 #318

Closed
1 task done
quanglam2807 opened this issue Oct 31, 2020 · 9 comments
Closed
1 task done

node-keytar doesn't load on Linux arm64 #318

quanglam2807 opened this issue Oct 31, 2020 · 9 comments

Comments

@quanglam2807
Copy link

Prerequisites

Description

require('keytar') would be stuck on Linux arm64 system, blocking the whole Node process.

Steps to Reproduce

app.on('ready', () => {
  console.log(1);
  const keytar = require('keytar');
  console.log(2);
});

Expected behavior:

Console would log 1 then log 2.

Actual behavior:

Console only log 1.

Reproduces how often:

Versions

node-keytar@7.0.0

Additional Information

I tested keytar on macOS, Windows, Linux x64. They all worked.

This only happens on Linux arm64.

@quanglam2807
Copy link
Author

Could it be because I compile keytar ARM64 on a X86-64 system? https://github.com/webcatalog/webcatalog-engine/blob/master/.github/workflows/linux-arm.yml

@shiftkey
Copy link
Contributor

shiftkey commented Nov 1, 2020

I've not tested anything related to NodeJS on Linux ARM64 so any sort of working code here would be down to sheer luck. We also don't ship any prebuilt binaries for Linux ARM64 currently so more context about how you're building things from source here would be helpful to learn more

@quanglam2807
Copy link
Author

Thank you, @shiftkey. I'm currently using electron-builder which rebuilds node-keytar when building the Electron app. I personally don't have an ARM device as well. But a user reported this bug and I managed to reproduce it on a AWS EC2 with ARM64 processor.

@shiftkey
Copy link
Contributor

shiftkey commented Nov 8, 2020

Based on #319 it looks like we can already generate builds using the existing prebuild toolchain, so hopefully the next release will address this. I'll close this out when it's ready to try.

@shiftkey
Copy link
Contributor

@quanglam2807 I've published v7.1.0 to NPM which contains prebuild support for Linux ARM64 - hopefully this helps out with your work!

@quanglam2807
Copy link
Author

It seems like the bug is not fixed (I tested on Raspberry Pi 400 / Ubuntu 20.10). Is there anything I can to assist with debugging?

@quanglam2807
Copy link
Author

quanglam2807 commented Nov 22, 2020

I just checked the log: https://github.com/webcatalog/webcatalog-engine/runs/1438066751?check_suite_focus=true

electron-builder uses the prebuilt binary so I think the bug must be somewhere else.

@quanglam2807
Copy link
Author

I attempted to set up my project on Raspberry Pi and No prebuilt binaries found error occurred. I'm not sure what happened exactly.

@quanglam2807
Copy link
Author

  • execute command  command=/opt/hostedtoolcache/node/12.19.0/x64/bin/node /home/runner/work/webcatalog-engine/webcatalog-engine/node_modules/prebuild-install/bin.js --platform=linux --arch=arm64 --target=10.1.5 --runtime=electron --verbose --force
                     workingDirectory=/home/runner/work/webcatalog-engine/webcatalog-engine/node_modules/keytar
  • command executed  executable=/opt/hostedtoolcache/node/12.19.0/x64/bin/node
                      errorOut=prebuild-install info begin Prebuild-install version 6.0.0
    prebuild-install info looking for cached prebuild @ /home/runner/.npm/_prebuilds/0e0657-keytar-v7.2.0-electron-v82-linux-arm64.tar.gz
    prebuild-install http request GET https://github.com/atom/node-keytar/releases/download/v7.2.0/keytar-v7.2.0-electron-v82-linux-arm64.tar.gz
    prebuild-install http 200 https://github.com/atom/node-keytar/releases/download/v7.2.0/keytar-v7.2.0-electron-v82-linux-arm64.tar.gz
    prebuild-install info downloading to @ /home/runner/.npm/_prebuilds/0e0657-keytar-v7.2.0-electron-v82-linux-arm64.tar.gz.3305-8adb79bde4c3c.tmp
    prebuild-install info renaming to @ /home/runner/.npm/_prebuilds/0e0657-keytar-v7.2.0-electron-v82-linux-arm64.tar.gz
    prebuild-install info unpacking @ /home/runner/.npm/_prebuilds/0e0657-keytar-v7.2.0-electron-v82-linux-arm64.tar.gz
    prebuild-install info unpack resolved to /home/runner/work/webcatalog-engine/webcatalog-engine/node_modules/keytar/build/Release/keytar.node
    prebuild-install info install Successfully installed prebuilt binary!

So indeed, electron-builder installs the correct binary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants