Open ShankarWarang opened 1 year ago
Interesting, if you execute pulsar --package rebuild
does this error go away?
Basically, node-pty-prebuilt-multiarch
is supposed to take some information from your machine (architecture, and os) and use that to check for proper electron headers to download/rebuild node-pty
which is used to emulate the terminal
However, it looks like your device picked darwin
for your OS (correct) and x64
for your architecture (incorrect)
I tried pulsar --package rebuild
and arch -arm64 pulsar --package rebuild
. Both the time facing the same issue.
Alright, can you do this for me:
os = require('os')
, hit enteros.arch()
, hit enteros.platform()
, hit enterI'm trying to figure out if it's one of the scripts included in node-pty-prebuilt-multiarch
having a problem determining what architecture you're on, or if it's a problem of ppm.
Sure, here it is:
os = require('os')
{arch: ƒ, cpus: ƒ, endianness: ƒ, freemem: ƒ, getPriority: ƒ, …}
os.arch()
"arm64"
os.platform()
"darwin"
Thanks.
As you mentioned, looks like ppm is missing something while ported from apm? If so, should I open an issue on Pulsar's github?
Hmm, not yet
Can you do pulsar --package install x-terminal-reloaded --verbose
, I reverted an incompatible version of a package a short while ago, and so there's a new version 14.1.5 out
The verbose piece is the most important part of the command, because that should tell me what header version node-pty-prebuilt-multiarch
is trying to use
Looks like it is using a wrong prebuild despite node using the right OS and architecture:
prebuild-install info begin Prebuild-install version 6.1.4
prebuild-install info looking for local prebuild @ prebuilds/node-pty-prebuilt-multiarch-v0.10.0-electron-v87-darwin-x64.tar.gz
prebuild-install info looking for cached prebuild @ /Users/1/.pulsar/.apm/_prebuilds/673d55-node-pty-prebuilt-multiarch-v0.10.0-electron-v87-darwin-x64.tar.gz
prebuild-install http request GET https://github.com/oznu/node-pty-prebuilt-multiarch/releases/download/v0.10.0/node-pty-prebuilt-multiarch-v0.10.0-electron-v87-darwin-x64.tar.gz
prebuild-install http 404 https://github.com/oznu/node-pty-prebuilt-multiarch/releases/download/v0.10.0/node-pty-prebuilt-multiarch-v0.10.0-electron-v87-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=12.2.3 runtime=electron arch=x64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/Applications/Pulsar.app/Contents/Resources/app/ppm/bin/node',
gyp verb cli '/Applications/Pulsar.app/Contents/Resources/app/ppm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild'
gyp verb cli ]
gyp info using node-gyp@5.1.0
gyp info using node@16.0.0 | darwin | arm64
Do you need any specific/full log?
Also for all the releases from v0.10.0
onwards, only v0.10.1-pre.5
has node-pty-prebuilt-multiarch
binary available for electron-v87
.
Also for all the releases from
v0.10.0
onwards, onlyv0.10.1-pre.5
hasnode-pty-prebuilt-multiarch
binary available forelectron-v87
.
Yeah, I'm in the process of trying to make the CI pass properly on the https://github.com/Spiker985/x-terminal-reloaded/tree/feature-bundle-node-pty-prebuilt-multiarch branch
The problem is that the CI is doing the even weirder thing of detecting that the proper version is 93 on mac and linux - and is failing to even find the windows version, so it's building it from scratch.
You may be able to navigate to ~/.pulsar/packages/x-terminal-reloaded
, open the package.json, change the dependency to 0.10.1-pre.5
, save it, and then run pulsar -p rebuild --verbose
and see if it will oblige the change in dependency - it should, since as far as I know it doesn't validate the package data, it simply rebuilds native modules
After updating the dependency version in package.json and rebuilding packages, it was still returning the same error. So I used npm i node-pty-prebuilt-multiarch@0.10.1-pre.5
command to update the dependency after deleting the node-pty-prebuilt-multiarch
folder under the node_modules
and then rebuilt packages.
Now the package is failing at activation stage:
Failed to activate the x-terminal-reloaded package
At Cannot find module '../build/Release/pty.node'
Require stack:
- /Users/1/.pulsar/packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/prebuild-loader.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/unixTerminal.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/index.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/src/element.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/src/x-terminal.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/module-utils.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/package.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/package-manager.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/atom-environment.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/initialize-application-window.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/static/index.html
Error: Cannot find module '../build/Release/pty.node'
Require stack:
- /Users/1/.pulsar/packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/prebuild-loader.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/unixTerminal.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/index.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/src/element.js
- /Users/1/.pulsar/packages/x-terminal-reloaded/src/x-terminal.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/module-utils.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/package.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/package-manager.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/atom-environment.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/src/initialize-application-window.js
- /Applications/Pulsar.app/Contents/Resources/app.asar/static/index.html
at Module._resolveFilename (internal/modules/cjs/loader.js:887:15)
at o._resolveFilename (electron/js2c/renderer_init.js:33:1118)
at Function.Module._resolveFilename (/app.asar/src/module-cache.js:317:28)
at Module._load (internal/modules/cjs/loader.js:732:27)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.o._load (electron/js2c/renderer_init.js:33:379)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (/app.asar/src/native-compile-cache.js:67:27)
at /packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/prebuild-loader.js:6:11)
at /packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/prebuild-loader.js:20:3)
at Module._compile (/app.asar/src/native-compile-cache.js:120:30)
at /app.asar/src/compile-cache.js:252:23)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.o._load (electron/js2c/renderer_init.js:33:379)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (/app.asar/src/native-compile-cache.js:67:27)
at /packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/unixTerminal.js:25:25)
at /packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/unixTerminal.js:266:3)
at Module._compile (/app.asar/src/native-compile-cache.js:120:30)
at /app.asar/src/compile-cache.js:252:23)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.o._load (electron/js2c/renderer_init.js:33:379)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (/app.asar/src/native-compile-cache.js:67:27)
at /packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/index.js:14:20)
at /packages/x-terminal-reloaded/node_modules/node-pty-prebuilt-multiarch/lib/index.js:52:3)
at Module._compile (/app.asar/src/native-compile-cache.js:120:30)
at /app.asar/src/compile-cache.js:252:23)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Function.o._load (electron/js2c/renderer_init.js:33:379)
Exact same issue here.
This is probably the same problem that it happens with this code: https://github.com/pulsar-edit/pulsar/issues/359
Part of the fix is here: https://github.com/pulsar-edit/pulsar/pull/493. TL;DR; - we inherited some code from Atom that checks if a package rebuild failed previously when we tried to compile it inside the editor so that's why sometimes rebuilding doesn't work;
Second part is that we're trying to make rebuild better - I have a proof-of-concept in "userspace" (meaning - it's a Pulsar package) that is currently trying to replace the way we install dependencies and compile them. Let's see if that works, and if it does, we can integrate it into the editor itself
I've been struggling on the same issue on an M2 chip.
Obviously node-pty-prebuilt-multiarch
was not detecting the architecture correctly, so I had to do the job. After downloading the correct prebuild pty.node
from the repo (in my case it was electron-v87-darwin-arm64
) I got it to work.
This is what I did:
cd ~/.pulsar/packages/x-terminal-reloaded
node-pty-prebuilt-multiarch
dependency from 0.10.0
to ^0.10.1-pre5
in package.json
as suggestedpulsar -p rebuild --verbose
node-pty-prebuilt-multiarch-v0.10.1-pre.5-electron-v87-darwin-arm64.tar.gz
The important part is electron-v87
)node_modules/node-pty-prebuilt-multiarch/build/Release/pty.node
with the downlaoded one.pty.node
=> quit pulsarpty.node
in system security settings@mcguffin That worked for me on a mac m1, thanks a lot!
I just switched my installation to use @homebridge/node-pty-prebuilt-multiarch
(v0.11.13) instead of the original (there appears to have been a change in ownership, since the repository link for the original now redirects to the homebridge version), and it started working without problem. v0.11.14 ups the minimum supported Electron version to 16, so that doesn't work with the current default Electron.
Description
The package installs but crashes upon trying open the terminal every time on M1, supposedly on all ARM64 chips.
Versions
Atom: 1.102.0 arm64 Electron: 12.2.3 OS: macOS 13.2.1 Thrown From: x-terminal-reloaded package 14.1.4
Stack Trace
Failed to activate the x-terminal-reloaded package
Non-Core Packages installed
Thank you!