Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error: installing from source on ubuntu #3360

Open
kumavis opened this issue Jun 8, 2020 · 4 comments · May be fixed by #3385
Open

Build Error: installing from source on ubuntu #3360

kumavis opened this issue Jun 8, 2020 · 4 comments · May be fixed by #3385
Labels
install-config Installation/configuration issues sandstorm-dev Issues hacking on Sandstorm

Comments

@kumavis
Copy link

kumavis commented Jun 8, 2020

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
Copy link
Author

kumavis commented Jun 8, 2020

error is same as
capnproto/node-capnp#18
#2897

@ocdtrekkie ocdtrekkie added install-config Installation/configuration issues sandstorm-dev Issues hacking on Sandstorm labels Jun 8, 2020
@kumavis
Copy link
Author

kumavis commented Jun 8, 2020

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
Copy link
Collaborator

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 added a commit to zenhack/sandstorm that referenced this issue Jun 8, 2020
Otherwise building node-capnp fails if the user has never run `meteor`,
due to not being able to find the development headers. This doesn't
trigger if the build is run as the same user that ran meteor's
`curl ... | sh` installer, which is why we haven't previously noticed
it.

Note that if the bundle is not present ./find-meteor-dev-bundle.sh will
pull it in, but although we define a variable in terms of this at the
top of the Makefile, its value is computed lazily, so it will not be run
until it is actually needed.

It might work to just use := instead of = when assigning the variable,
but conceptually having the build process depend on node seems like the
right thing (and it should also ensure a rebuild if the version of
node/the bundle is updated).

Fixes sandstorm-io#3360
@zenhack
Copy link
Collaborator

zenhack commented Jun 8, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install-config Installation/configuration issues sandstorm-dev Issues hacking on Sandstorm
Projects
None yet
3 participants