Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

NetBSD 9.0 build broken #2907

Open
krytarowski opened this issue Jul 14, 2020 · 14 comments
Open

NetBSD 9.0 build broken #2907

krytarowski opened this issue Jul 14, 2020 · 14 comments
Labels
C - Desktop P - Linux Platform - Specifically relates to Linux T - Bug Type - Bug: Something isn't working

Comments

@krytarowski
Copy link

Bug description

NetBSD 9.0 amd64 build is broken.

Version

$ git log -1
commit ddacc78c576ab8196134496d36f36c93d9b256f8 (HEAD -> develop, origin/develop, origin/HEAD)
Author: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Date:   Thu Jul 9 20:26:34 2020 +0000

    chore(deps-dev): Bump eslint-plugin-import from 2.21.2 to 2.22.0 (#2885)

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?

  • Node settings:

None.

Steps To reproduce the bug

Explain how the maintainer can reproduce the bug.

  1. git clone https://github.com/iotaledger/trinity-wallet.git
  2. cd trinity-wallet
  3. yarn && yarn deps:shared

Expected behaviour

Build successful.

Actual behaviour

Build broken.

Errors

$ 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...
[-/6] ⠄ waiting...
[-/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@13.11.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-v79_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-v79-netbsd-x64.tar.gz
node-pre-gyp http 404 https://static.realm.io/node-pre-gyp/5.0.5/realm-v5.0.5-node-v79-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-v79-netbsd-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for realm@5.0.5 and node@13.11.0 (node-v79 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-v79-netbsd-x64.tar.gz 
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.7
gyp info using node@13.11.0 | netbsd | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.7
gyp info using node@13.11.0 | netbsd | x64
gyp http GET https://nodejs.org/download/release/v13.11.0/node-v13.11.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v13.11.0/node-v13.11.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v13.11.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v13.11.0/SHASUMS256.txt
gyp info spawn /usr/pkg/bin/python3.7
gyp info spawn args [
gyp info spawn args   '/usr/pkg/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kamil/trinity-wallet/src/shared/node_modules/realm/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/pkg/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kamil/.cache/node-gyp/13.11.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/kamil/.cache/node-gyp/13.11.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/pkg/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/kamil/.cache/node-gyp/13.11.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/kamil/trinity-wallet/src/shared/node_modules/realm',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.7
gyp info using node@13.11.0 | netbsd | x64
gyp info spawn gmake
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 8 ]
gmake: Wejście do katalogu '/home/kamil/trinity-wallet/src/shared/node_modules/realm/build'
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  ACTION binding_gyp_vendored_realm_target_download_realm /home/kamil/trinity-wallet/src/shared/node_modules/realm/vendor/realm-netbsd-x64
  TOUCH Release/obj.target/scripts.stamp
  TOUCH Release/obj.target/OpenSSL.stamp
/home/kamil/trinity-wallet/src/shared/node_modules/realm/scripts/download-realm.js:196
            throw new Error(`Unsupported sync platform '${options.platform}'`);
            ^

Error: Unsupported sync platform 'netbsd'
    at getSyncRequirements (/home/kamil/trinity-wallet/src/shared/node_modules/realm/scripts/download-realm.js:196:19)
    at Object.<anonymous> (/home/kamil/trinity-wallet/src/shared/node_modules/realm/scripts/download-realm.js:260:80)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
gmake: *** [vendored-realm.target.mk:13: /home/kamil/trinity-wallet/src/shared/node_modules/realm/vendor/realm-netbsd-x64] Błąd 1
gmake: *** Oczekiwanie na niezakończone zadania....
gmake: Opuszczenie katalogu '/home/kamil/trinity-wallet/src/shared/node_modules/realm/build'
gyp ERR! build error 
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/pkg/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System NetBSD 9.0
gyp ERR! command "/usr/pkg/bin/node" "/usr/pkg/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--jobs=8" "--module=/home/kamil/trinity-wallet/src/shared/node_modules/realm/compiled/node-v79_netbsd_x64/realm.node" "--module_name=realm" "--module_path=/home/kamil/trinity-wallet/src/shared/node_modules/realm/compiled/node-v79_netbsd_x64" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
gyp ERR! cwd /home/kamil/trinity-wallet/src/shared/node_modules/realm
gyp ERR! node -v v13.11.0
gyp ERR! node-gyp -v v5.0.7
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/pkg/bin/node /usr/pkg/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --jobs=8 --module=/home/kamil/trinity-wallet/src/shared/node_modules/realm/compiled/node-v79_netbsd_x64/realm.node --module_name=realm --module_path=/home/kamil/trinity-wallet/src/shared/node_modules/realm/compiled/node-v79_netbsd_x64 --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/kamil/trinity-wallet/src/shared/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1026:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System NetBSD 9.0
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 v13.11.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/pkg/bin/node /usr/pkg/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallbac



error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
141 kamil@dell /home/kamil/trinity-wallet $ 
@nothingismagick
Copy link

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

@krytarowski
Copy link
Author

$ 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.

@fraggerfox
Copy link

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.

@kneth
Copy link

kneth commented Jul 14, 2020

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 realm/realm-core#3714 is merged, we will update https://github.com/realm/realm-js and you should be able to build everything from source.

@krytarowski
Copy link
Author

@kneth what's ETA? Should we port realm-core to NetBSD meanwhile? Is there another IOTA wallet without this dependency?

@krytarowski
Copy link
Author

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 ?? ()

@krytarowski
Copy link
Author

krytarowski commented Jul 14, 2020

@kneth OK, I have got realm-core ported in pkgsrc, how can I proceed now?

@kneth
Copy link

kneth commented Jul 15, 2020

@krytarowski Due to summer vacation, I can't give you an ETA for realm/realm-core#3714.

The Linux executable does not work.

I hope you mean "It doesn't work on NetBSB" 😄

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.

@ianpward
Copy link

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.

@krytarowski
Copy link
Author

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...

@krytarowski
Copy link
Author

krytarowski commented Jul 22, 2020

@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.

@krytarowski
Copy link
Author

krytarowski commented Jul 22, 2020

@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.

@rajivshah3
Copy link
Member

@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

@krytarowski
Copy link
Author

krytarowski commented Jul 22, 2020

@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).

@rajivshah3 rajivshah3 added C - Desktop P - Linux Platform - Specifically relates to Linux labels Aug 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C - Desktop P - Linux Platform - Specifically relates to Linux T - Bug Type - Bug: Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants