realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.72k stars 564 forks source link

Build from source fails in alpine linux #1806

Open andytompkins opened 6 years ago

andytompkins commented 6 years ago

Goals

Building from source for node in alpine linux

Expected Results

Expected package to compile

Actual Results

../src/node/node_class.hpp:232:5: warning: the address of 'static void realm::js::RealmClass<T>::constructor(realm::js::RealmClass<T>::ContextType, realm::js::RealmClass<T>::ObjectType, size_t, const ValueType*) [with T = realm::node::Types; realm::js::RealmClass<T>::ContextType = v8::Isolate*; realm::js::RealmClass<T>::ObjectType = v8::Local<v8::Object>; size_t = long unsigned int; realm::js::RealmClass<T>::ValueType = v8::Local<v8::Value>]' will always evaluate as 'true' [-Waddress]
     if (reinterpret_cast<void*>(s_class.constructor)) {
     ^~
  CXX(target) Release/obj.target/realm/src/node/platform.o
../src/node/platform.cpp: In function 'std::__cxx11::string realm::default_realm_file_directory()':
../src/node/platform.cpp:50:12: error: 'PATH_MAX' was not declared in this scope
   char buf[PATH_MAX];
            ^~~~~~~~
../src/node/platform.cpp:53:29: error: 'buf' was not declared in this scope
     size_t cwd_len = sizeof(buf);
                             ^~~
make: *** [realm.target.mk:122: Release/obj.target/realm/src/node/platform.o] Error 1
make: Leaving directory '/a/node_modules/realm/build'

Steps to Reproduce

docker run -it --rm mhart/alpine-node:8 /bin/ash npm install --build-from-source realm

Version of Realm and Tooling

It sounds like you need to include under alpine to get PATH_MAX.

kneth commented 6 years ago

To be honest, we haven't had Alpine Linux on our radar. We will happy to receive a pull request :-)

Dids commented 5 years ago

@andytompkins Any new developments on this?

fealebenpae commented 5 years ago

Unfortunately we need to add support for musl libc in core and sync - it’s not just a matter of rebuilding realm-js.

llimacruz commented 3 years ago

Hi everyone! Any new on this topic? I'm trying to run a Docker Container with a NodeJS project using realm-js and I'm getting the error: Fatal error in HandleScope::HandleScope Entering the V8 API without proper locking in place