sandstorm-io / sandstorm

Sandstorm is a self-hostable web productivity suite. It's implemented as a security-hardened web app package manager.
https://sandstorm.io
Other
6.7k stars 704 forks source link

Build Error: installing from source on ubuntu #3360

Open kumavis opened 4 years ago

kumavis commented 4 years ago

error from make on fresh digital ocean ubuntu box

uname -a

Linux sandstorm2 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

prep

sudo apt-get update
sudo apt-get install build-essential libcap-dev xz-utils zip \
    unzip strace curl discount git python zlib1g-dev \
    golang-go cmake
curl https://install.meteor.com/?release=1.8.2 | sh

error message

✘ install: node-capnp/node-capnp.ekam-manifest
    node-capnp/capnp.node: not found
✘ jstest: node-capnp/capnp-test.js
    full log: tmp/node-capnp/capnp-test.js.log
✘ compile: node-capnp/capnp.cc
    /ekam-provider/canonical/node-capnp/capnp.cc:29:10: fatal error: 'node.h' file not found
    #include <node.h>
             ^~~~~~~~
    PLEASE submit a bug report to https://crbug.com and run tools/clang/scripts/process_crashreports.
      py (only works inside Google) which will upload a report and include the crash backtrace, 
      preprocessed source, and associated run script.
    Stack dump:
    0.  Program arguments: /root/sandstorm/deps/llvm-build/Release+Asserts/bin/clang++ -I/ekam-
      provider/c++header -std=c++1z -Wall -Wextra -Wglobal-constructors -Wno-sign-compare -Wno-unused
      -parameter -O2 -Wall -g -DSANDSTORM_BUILD=0 -DKJ_HAS_OPENSSL -DKJ_HAS_ZLIB -DKJ_HAS_LIBDL -
      pthread -fPIC -I/include/node -DKJ_STD_COMPAT -c /ekam-provider/canonical/node-capnp/capnp.cc -
      o node-capnp/capnp.o 
    1.  /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:88:
      5: current parser token '{'
    2.  /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:36:
      1: parsing namespace 'std'
    3.  /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:48:
      1: parsing namespace 'std::__detail'
    4.  /usr/lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:86:
      5: parsing struct/union/class body 'std::__detail::__is_noexcept_hash'
    #0 0x000000000239ac78 (/root/sandstorm/deps/llvm-build/Release+Asserts/bin/clang+++0x239ac78)
    clang: error: clang frontend command failed due to signal (use -v to see invocation)
    clang version 11.0.0 (https://github.com/llvm/llvm-project/ 4e0d9925d6a3561449bdd8def27fd3f3f1b3f
      b9f)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /root/sandstorm/deps/llvm-build/Release+Asserts/bin
    clang: note: diagnostic msg: Error generating preprocessed source(s).
Makefile:265: recipe for target 'tmp/.ekam-run' failed
make: *** [tmp/.ekam-run] Error 1
kumavis commented 4 years ago

error is same as https://github.com/capnproto/node-capnp/issues/18 https://github.com/sandstorm-io/sandstorm/issues/2897

kumavis commented 4 years ago

ok so i was root and needed to run METEOR_ALLOW_SUPERUSER=1 make

may be a bug in the build system as it did not abort on the failed call to meteor

ocdtrekkie commented 4 years ago

Glad you figured it out! Let's leave this issue open for now, since we definitely do not want people hitting mysterious failures building Sandstorm.

zenhack commented 4 years ago

I opened #3361, which fixes this.

Per the commit message, it looks like the issue is that you ran the meteor install as a regular user, but then tried to build as root, so root's ~/.meteor directory hadn't been populated yet, and our Makefile didn't correctly require the bundle to be present before starting the node-capnp build. With that patch, when running as root you should get a descriptive error from meteor about running as root, rather than a mysterious build failure for node-capnp.