Open krytarowski opened 4 years ago
Not sure if this is the real problem, but looking at your stack trace, it seems that node v13 resources cannot be found. That version of node was retired, and you should absolutely be using v14
$ yarn deps:shared
yarn run v1.22.4
$ cd src/shared && yarn && cd ../..
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "netbsd" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "realm > deprecated-react-native-listview@0.0.6" has unmet peer dependency "react-native@*".
[4/4] Building fresh packages...
[1/6] ⠈ core-js
[-/6] ⠈ waiting...
[-/6] ⠈ waiting...
[5/6] ⠈ realm
error /home/kamil/trinity-wallet/src/shared/node_modules/realm: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build -j 8
Arguments:
Directory: /home/kamil/trinity-wallet/src/shared/node_modules/realm
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.14.0
node-pre-gyp info using node@14.3.0 | netbsd | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/home/kamil/trinity-wallet/src/shared/node_modules/realm/compiled/node-v83_netbsd_x64/realm.node" (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-netbsd-x64.tar.gz
node-pre-gyp http 404 https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-netbsd-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-netbsd-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for realm@5.0.5 and node@14.3.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-netbsd-x64.tar.gz
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/kamil/trinity-wallet/src/shared/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
node-pre-gyp ERR! stack at onErrorNT (internal/child_process.js:468:16)
node-pre-gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:84:21)
node-pre-gyp ERR! System NetBSD 9.99.67
node-pre-gyp ERR! command "/usr/pkg/bin/node" "/home/kamil/trinity-wallet/src/shared/node_modules/realm/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "-j" "8"
node-pre-gyp ERR! cwd /home/kamil/trinity-wallet/src/shared/node_modules/realm
node-pre-gyp ERR! node -v v14.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I was able to reproduce the issue in FreeBSD too.
$ yarn deps:shared
yarn run v1.22.4
$ cd src/shared && yarn && cd ../..
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "freebsd" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "realm > deprecated-react-native-listview@0.0.6" has unmet peer dependency "react-native@*".
[4/4] Building fresh packages...
[-/6] ⠁ waiting...
[-/6] ⠂ waiting...
[3/6] ⠂ core-js
[5/6] ⠂ realm
error /usr/home/fox/projects/trinity-wallet/src/shared/node_modules/realm: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build -j 8
Arguments:
Directory: /usr/home/fox/projects/trinity-wallet/src/shared/node_modules/realm
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.14.0
node-pre-gyp info using node@14.5.0 | freebsd | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/usr/home/fox/projects/trinity-wallet/src/shared/node_modules/realm/compiled/node-v83_freebsd_x64/realm.node" (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-freebsd-x64.tar.gz
node-pre-gyp http 404 https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-freebsd-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-freebsd-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for realm@5.0.5 and node@14.5.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v83-freebsd-x64.tar.gz
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/home/fox/projects/trinity-wallet/src/shared/node_modules/node-pre-gyp/lib/util/compile.js:77:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
node-pre-gyp ERR! stack at onErrorNT (internal/child_process.js:468:16)
node-pre-gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
node-pre-gyp ERR! System FreeBSD 12.1-RELEASE-p7
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/home/fox/projects/trinity-wallet/src/shared/node_modules/realm/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "-j" "8"
node-pre-gyp ERR! cwd /usr/home/fox/projects/trinity-wallet/src/shared/node_modules/realm
node-pre-gyp ERR! node -v v14.5.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Realm doesn't support NetBSD/FreeBSD (only Android, iOS, MacOS, Windows and Linux). We have some binary components in Realm (currently in the process of open sourcing it), The URL https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v79-netbsd-x64.tar.gz does not exist (substitute netbsd with linux if possible).
Once https://github.com/realm/realm-core/pull/3714 is merged, we will update https://github.com/realm/realm-js and you should be able to build everything from source.
@kneth what's ETA? Should we port realm-core to NetBSD meanwhile? Is there another IOTA wallet without this dependency?
The Linux executable does not work.
167 kamil@chieftec /tmp/node-v79_linux_x64 $ file ./realm.node
./realm.node: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=649cea06c6d00d48eedb4f0a1f4f85bab8f55175, not stripped
168 kamil@chieftec /tmp/node-v79_linux_x64 $ ./realm.node
Memory fault (core dumped)
169 kamil@chieftec /tmp/node-v79_linux_x64 $ ktruss -i ./realm.node
28499 28499 ktruss fcntl(0x4, 0x3, 0) = 4194305
28499 28499 ktruss emul(netbsd)
28499 28499 ktruss fcntl(0x4, 0x4, 0x400001) = 0
28499 28499 realm.node execve("/tmp/node-v79_linux_x64/./realm.node", 0x7f7fffffe768, 0x7f7fffffe778) JUSTRETURN
28499 28499 realm.node emul(linux)
GDB:
$ gdb ./realm.node
GNU gdb (GDB) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./realm.node...
(No debugging symbols found in ./realm.node)
(gdb) r
Starting program: /tmp/node-v79_linux_x64/realm.node
Program received signal SIGSEGV, Segmentation fault.
0x00000000001c122c in realm::node::copy_object(Napi::Env, Napi::Value const&, Napi::Error const&) ()
(gdb) bt
#0 0x00000000001c122c in realm::node::copy_object(Napi::Env, Napi::Value const&, Napi::Error const&)
()
#1 0x0000000000000001 in ?? ()
#2 0x00007f7fffffecf0 in ?? ()
#3 0x0000000000000000 in ?? ()
@kneth OK, I have got realm-core ported in pkgsrc, how can I proceed now?
@krytarowski Due to summer vacation, I can't give you an ETA for https://github.com/realm/realm-core/pull/3714.
The Linux executable does not work.
I hope you mean "It doesn't work on NetBSB" :smile:
Please notice that realm.node
is the shared object used by Realm JavaScript (a big part but not the only part). It is not an executable.
Hey @krytarowski Realm doesn't have support for building on NetBSD but as Kenneth mentioned it may be possible once we open source our components allowing you to build from source. We are hoping to release this in the next quarter or so.
If you are interested in getting NetBSD added as a supported platform for Realm then please make a feature request here: https://feedback.mongodb.com/ And we can review it during quarterly planning.
Please notice that
realm.node
is the shared object used by Realm JavaScript (a big part but not the only part). It is not an executable.
OK, so we cannot do anything with that file then. We cannot link it into native executable...
@nothingismagick can we remove realm from the trinity-wallet repo? At least for the time being as it is closed-source proprietary code and conflicting with the Open-Source user freedoms. Also the wallet for iota cannot be trusted with such dependencies.
@ianpward
If you are interested in getting NetBSD added as a supported platform for Realm then please make a feature request here: https://feedback.mongodb.com/ And we can review it during quarterly planning.
I can just port it myself without any forms and quarterly planning from your side, but I need access to the source code.
@krytarowski we do not use the closed-source component of Realm. From their FAQ:
Realm’s internal C++ storage engine and the language SDKs over it are entirely open source and licensed under Apache 2.0. Realm also optionally includes a closed-source synchronization component, but that is not required to use Realm as an embedded database.
We do not use the synchronization component
@rajivshah3 Can trinity-wallet be switched to the realm version with source code and avoid binary blob? Even if there exists somewhere a full open-source version, a binary blob changes the whole deliverable into non-free and would be rejected from e.g. Debian repositories.
Meanwhile, I've ported realm-core. With the switch, I could reuse the wallet on other platforms (including BSDs).
Bug description
NetBSD 9.0 amd64 build is broken.
Version
Hardware specification
$ uname -a
NetBSD dell 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Mobile or Desktop: Laptop (Desktop)
Device: amd64
OS and version: NetBSD 9.0
RAM (Desktop only): 3GB RAM
Number of cores (Desktop only): 2
Node Settings (delete if not relevant)
What are your node settings? Are you using automatic node management?
None.
Steps To reproduce the bug
Explain how the maintainer can reproduce the bug.
Expected behaviour
Build successful.
Actual behaviour
Build broken.
Errors