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

[node] Cannot build from source #6015

Merged
merged 1 commit into from
Aug 31, 2016
Merged

[node] Cannot build from source #6015

merged 1 commit into from
Aug 31, 2016

Conversation

kkaefer
Copy link
Contributor

@kkaefer kkaefer commented Aug 31, 2016

Platform: node
Mapbox SDK version: master

Steps to trigger behavior

  1. git clone mapbox-gl-native...
  2. cd mapbo-gl-native
  3. npm install --build-from-source

Expected behavior

Building node-mapbox-gl-native

Actual behavior

Errors on gyp:

bobby mapbox-gl-native (master) $ npm install --build-from-source

> mapbox-gl-native@3.3.2 preinstall /path/mapbox-gl-native
> npm install node-pre-gyp

node-pre-gyp@0.6.29 node_modules/node-pre-gyp
├── semver@5.2.0
├── nopt@3.0.6 (abbrev@1.0.9)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── tar@2.2.1 (block-stream@0.0.9, inherits@2.0.1, fstream@1.0.10)
├── rc@1.1.6 (ini@1.3.4, deep-extend@0.4.1, strip-json-comments@1.0.4, minimist@1.2.0)
├── tar-pack@3.1.4 (uid-number@0.0.6, once@1.3.3, readable-stream@2.1.4, fstream@1.0.10, debug@2.2.0, fstream-ignore@1.0.5)
├── rimraf@2.5.4 (glob@7.0.5)
├── npmlog@3.1.2 (set-blocking@2.0.0, console-control-strings@1.1.0, are-we-there-yet@1.1.2, gauge@2.6.0)
└── request@2.74.0 (tunnel-agent@0.4.3, aws-sign2@0.6.0, forever-agent@0.6.1, oauth-sign@0.8.2, is-typedarray@1.0.0, caseless@0.11.0, stringstream@0.0.5, aws4@1.4.1, isstream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, tough-cookie@2.3.1, qs@6.2.1, node-uuid@1.4.7, combined-stream@1.0.5, mime-types@2.1.11, form-data@1.0.0-rc4, bl@1.1.2, hawk@3.1.3, http-signature@1.1.1, har-validator@2.0.6)
-
> mapbox-gl-native@3.3.2 install /path/mapbox-gl-native
> node-pre-gyp install --fallback-to-build=false || make node

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp: binding.gyp not found (cwd: /path/mapbox-gl-native) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/path/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/path/.nvm/versions/node/v4.4.7/bin/node" "/path/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build=false" "--module=/path/mapbox-gl-native/lib/mapbox-gl-native.node" "--module_name=mapbox-gl-native" "--module_path=/path/mapbox-gl-native/lib"
gyp ERR! cwd /path/mapbox-gl-native
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/path/.nvm/versions/node/v4.4.7/bin/node /path/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build=false --module=/path/mapbox-gl-native/lib/mapbox-gl-native.node --module_name=mapbox-gl-native --module_path=/path/mapbox-gl-native/lib' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/path/mapbox-gl-native/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 16.0.0
node-pre-gyp ERR! command "/path/.nvm/versions/node/v4.4.7/bin/node" "/path/mapbox-gl-native/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build=false"
node-pre-gyp ERR! cwd /path/mapbox-gl-native
node-pre-gyp ERR! node -v v4.4.7
node-pre-gyp ERR! node-pre-gyp -v v0.6.29
node-pre-gyp ERR! not ok
Failed to execute '/path/.nvm/versions/node/v4.4.7/bin/node /path/.nvm/versions/node/v4.4.7/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build=false --module=/path/mapbox-gl-native/lib/mapbox-gl-native.node --module_name=mapbox-gl-native --module_path=/path/mapbox-gl-native/lib' (1)
git submodule update --init

... continues on with normal build

/cc @mikemorris @springmeyer @kkaefer

@bsudekum bsudekum added the Node.js node-mapbox-gl-native label Aug 15, 2016
@mikemorris
Copy link
Contributor

mikemorris commented Aug 15, 2016

Have you tried make distclean && npm install --build-from-source? This looks like old build files are still floating around somewhere, because we no longer use gyp to build since switching to CMake.

I tested the Node.js build previously during this pull request and it was building properly at that time.

@bsudekum
Copy link
Author

bsudekum commented Aug 15, 2016

@mikemorris this is from a completely fresh clone and install. Followed these steps exactly:

  1. git clone mapbox-gl-native...
  2. cd mapbox-gl-native
  3. npm install --build-from-source

@bsudekum
Copy link
Author

Running make distclean && npm install --build-from-source results in the same error

@mikemorris
Copy link
Contributor

In ... continues on with normal build, does the build complete successfully with a new mapbox-gl-native.node binary in ./lib?

@bsudekum
Copy link
Author

@mikemorris it does, however when requiring and starting a project containing the build, I get the following error:

dyld: Symbol not found: _CGLChoosePixelFormat
  Referenced from: /path/mapbox-gl-native/lib/mapbox-gl-native.node
  Expected in: flat namespace

@mikemorris
Copy link
Contributor

mikemorris commented Aug 15, 2016

dyld: Symbol not found: _CGLChoosePixelFormat

Ugh, this looks like it's not linking -lGL properly on your machine, which is likely because we previously relied on pkg-config to find it.

@kkaefer
Copy link
Contributor

kkaefer commented Aug 16, 2016

@bsudekum just tried to reproduce this. The failing node-pre-gyp error is an expected part of the workflow. The build continues afterwards and the exit code should be 0.

I couldn't reproduce the dyld: Symbol not found: _CGLChoosePixelFormat error. What system and Xcode version are you using?

@bsudekum
Copy link
Author

@kkaefer yeah, this could be a dev environment issue as I am running OSX Sierra and Xcode 8. I do however have access to xcode 7.

@bsudekum
Copy link
Author

bsudekum commented Aug 26, 2016

Was able to get it build by commenting out

CGLError error = CGLChoosePixelFormat(attributes, &pixelFormat, &num);

¯_(ツ)_/¯

@mikemorris
Copy link
Contributor

mikemorris commented Aug 26, 2016

Um, I'd be kinda surprised if it was able to actually render anything without selecting a pixel format, unless this symbol was simply removed in OSX Sierra or something? What was the compiler error on that line @bsudekum? Oh, nvm, it was a linking error...

@kkaefer
Copy link
Contributor

kkaefer commented Aug 30, 2016

@bsudekum are you still running into this issue?

@bsudekum
Copy link
Author

@kkaefer @mikemorris retracting that previous statement. Although I was able to build and start my node project with that commented out, after making a request to the local server, I ran into similar errors.

@kkaefer So yes, still running into this error.

@kkaefer
Copy link
Contributor

kkaefer commented Aug 31, 2016

@bsudekum I managed to reproduce this error on macOS Sierra only. Starting to investigate now.

@kkaefer
Copy link
Contributor

kkaefer commented Aug 31, 2016

@bsudekum note that GLFW is currently broken on macOS Sierra

@kkaefer kkaefer merged commit 1e21892 into master Aug 31, 2016
@kkaefer kkaefer deleted the 6015-node-link-opengl branch August 31, 2016 14:43
@kkaefer
Copy link
Contributor

kkaefer commented Aug 31, 2016

@bsudekum please note that node-pre-gyp errors are expected and normal. However, as you indicated, the build continues and should now produce a properly linked library. I ran both the node tests, as well as the rendering test suite and got no errors.

@mikemorris mikemorris added the macOS Mapbox Maps SDK for macOS label Aug 31, 2016
@bsudekum
Copy link
Author

@kkaefer you rock.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build macOS Mapbox Maps SDK for macOS Node.js node-mapbox-gl-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants