Issue with building XO from source on FreeBSD
-
Hi all,
So last week I gave it a round of building XO from source. One of the OS I chose was FreeBSD 12.
Following the documentation I cannot setup XO properly, as some modules appear to be missing.root@xo:/opt/xen-orchestra # node -v v12.18.4 root@xo:/opt/xen-orchestra # yarn --version 1.22.4
root@xo:/opt/xen-orchestra # yarn yarn install v1.22.4 [1/5] Validating package.json... [2/5] Resolving packages... [3/5] 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. info fsevents@1.2.13: The platform "freebsd" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... [5/5] Building fresh packages... [8/11] _ node-sass [7/11] _ vuepress [6/11] _ leveldown [4/11] _ nodemailer error /opt/xen-orchestra/node_modules/leveldown: Command failed. Exit code: 1 Command: node-gyp-build Arguments: Directory: /opt/xen-orchestra/node_modules/leveldown Output: gyp info it worked if it ends with ok gyp info using node-gyp@3.8.0 gyp info using node@12.18.4 | freebsd | x64 gyp ERR! configure error gyp ERR! stack Error: Command failed: /usr/local/bin/python3.7 -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "<string>", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:303:12) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) gyp ERR! System FreeBSD 12.1-RELEASE gyp ERR! command "/usr/local/bin/node" "/opt/xen-orchestra/node_modules/.bin/node-gyp" "rebuild" gyp ERR! cwd /opt/xen-orchestra/node_modules/leveldown warning Error running install script for optional dependency: "/opt/xen-orchestra/node_modules/argon2: Command failed. Exit code: 1 Command: node-pre-gyp install --fallback-to-build Arguments: Directory: /opt/xen-orchestra/node_modules/argon2 Output: node-pre-gyp info it worked if it ends with ok node-pre-gyp info using node-pre-gyp@0.13.0 node-pre-gyp info using node@12.18.4 | freebsd | x64 node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp info check checked for \"/opt/xen-orchestra/node_modules/argon2/lib/binding/argon2.node\" (not found) node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-freebsd-x64-unknown.tar.gz node-pre-gyp http 404 https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-freebsd-x64-unknown.tar.gz node-pre-gyp WARN Tried to download(404): https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-freebsd-x64-unknown.tar.gz node-pre-gyp WARN Pre-built binaries not found for argon2@0.25.1 and node@12.18.4 (node-v72 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp http 404 status code downloading tarball https://github.com/ranisalt/node-argon2/releases/download/v0.25.1/argon2-v0.25.1-node-v72-freebsd-x64-unknown.tar.gz gyp info it worked if it ends with ok gyp info using node-gyp@3.8.0 gyp info using node@12.18.4 | freebsd | x64 gyp info ok gyp info it worked if it ends with ok gyp info using node-gyp@3.8.0 gyp info using node@12.18.4 | freebsd | x64 gyp ERR! configure error gyp ERR! stack Error: Command failed: /usr/local/bin/python3.7 -c import sys; print \"%s.%s.%s\" % sys.version_info[:3]; gyp ERR! stack File \"<string>\", line 1 gyp ERR! stack import sys; print \"%s.%s.%s\" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:303:12) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) gyp ERR! System FreeBSD 12.1-RELEASE gyp ERR! command \"/usr/local/bin/node\" \"/opt/xen-orchestra/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/opt/xen-orchestra/node_modules/argon2/lib/binding/argon2.node\" \"--module_name=argon2\" \"--module_path=/opt/xen-orchestra/node_modules/argon2/lib/binding\" \"--napi_version=6\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v72\" \"--python=/usr/local/bin/python3.7\" gyp ERR! cwd /opt/xen-orchestra/node_modules/argon2 gyp ERR! node -v v12.18.4 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /opt/xen-orchestra/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/xen-orchestra/node_modules/argon2/lib/binding/argon2.node --module_name=argon2 --module_path=/opt/xen-orchestra/node_modules/argon2/lib/binding --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72 --python=/usr/local/bin/python3.7' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/opt/xen-orchestra/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:1021:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) node-pre-gyp ERR! System FreeBSD 12.1-RELEASE node-pre-gyp ERR! command \"/usr/local/bin/node\" \"/opt/xen-orchestra/node_modules/argon2/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\" node-pre-gyp ERR! cwd /opt/xen-orchestra/node_modules/argon2 node-pre-gyp ERR! node -v v12.18.4 node-pre-gyp ERR! node-pre-gyp -v v0.13.0 node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node /opt/xen-orchestra/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/xen-orchestra/node_modules/argon2/lib/binding/argon2.node --module_name=argon2 --module_path=/opt/xen-orchestra/node_modules/argon2/lib/binding --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72 --python=/usr/local/bin/python3.7' (1)" info This module is OPTIONAL, you can safely ignore this error
After doing yarn build and when I try to start the server, I get this error:
# yarn start yarn run v1.22.4 $ node bin/xo-server 2020-11-02T14:47:55.586Z xo:xo-server ERROR uncaught exception { error: Error: No native build was found for platform=freebsd arch=x64 runtime=node abi=72 uv=1 libc=glibc at Function.load.path (/opt/xen-orchestra/node_modules/node-gyp-build/index.js:56:9) at load (/opt/xen-orchestra/node_modules/node-gyp-build/index.js:20:30) at Object.<anonymous> (/opt/xen-orchestra/node_modules/leveldown/binding.js:1:43) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/opt/xen-orchestra/node_modules/leveldown/leveldown.js:3:17) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/opt/xen-orchestra/node_modules/level/level.js:1:44) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Module.require (internal/modules/cjs/loader.js:1025:19) } Done in 6.98s.
-
It seems related to leveldown dep build fails. It requires C++ (or C) make/compiler.
-
Following the instructions I added a symlink for g++ to clang++ before even pulling the repo.
root@xo:/usr/local/bin # ls -lad g* lrwxr-xr-x 1 root wheel 16 Oct 27 18:40 g++ -> /usr/bin/clang++
has been done since the start. I never get past the leveldown error
-
We tested on FreeBSD 11, not 12. So it might be why.
Can you just try on FreeBSD 11 and see the result?
If it works and not on 12, I suppose there's a problem on LevelDown library itselfβ¦
-
You might be not the only one: https://github.com/tagattie/FreeBSD-Atom/issues/2
They asked to test on Node 10 and try again.
-
I had several failed attempts until I supplemented the process with these directions:
https://sysadm.russerver.org/wiki/Install_Xen_Orchestra_on_FreeBSDBTW it also works on FreeBSD 13.
-
That would be great that instead people had their personal notes, to update our free to contribute documentation
Anyway, if it solves the OP issue, please anyone edit the XO FreeBSD doc so you'll help someone else next time
-
Seen this too late today but I will give it a whirl tomorrow! Will let know how it went.