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

gzweb7 Build Fails: node-gyp error #84

Closed
Kukanani opened this issue Oct 1, 2017 · 5 comments
Closed

gzweb7 Build Fails: node-gyp error #84

Kukanani opened this issue Oct 1, 2017 · 5 comments

Comments

@Kukanani
Copy link

Kukanani commented Oct 1, 2017

Hi,

I'm trying to build the gzweb7 docker, but it fails with the following output:

...
[100%] Building CXX object tools/CMakeFiles/gzcoarse.dir/gzcoarse.cc.o
Linking CXX executable gzcoarse
[100%] Built target gzcoarse
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@0.10.25 | linux | x64

/root/gzweb/node_modules/node-gyp/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require('hoek');
^^^^^
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack SyntaxError: Use of const in strict mode.
gyp ERR! stack     at Module._compile (module.js:439:25)
gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
gyp ERR! stack     at Module.load (module.js:356:32)
gyp ERR! stack     at Function.Module._load (module.js:312:12)
gyp ERR! stack     at Module.require (module.js:364:17)
gyp ERR! stack     at require (module.js:380:17)
gyp ERR! stack     at Object.<anonymous> (/root/gzweb/node_modules/node-gyp/node_modules/request/node_modules/hawk/lib/index.js:5:33)
gyp ERR! stack     at Module._compile (module.js:456:26)
gyp ERR! stack     at Object.Module._extensions..js (module.js:474:10)
gyp ERR! stack     at Module.load (module.js:356:32)
gyp ERR! System Linux 4.4.0-96-generic
gyp ERR! command "node" "/root/gzweb/node_modules/.bin/node-gyp" "configure"
gyp ERR! cwd /root/gzweb/gzbridge
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v3.6.2
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@0.10.25 | linux | x64
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack     at /root/gzweb/node_modules/node-gyp/lib/build.js:49:20
gyp ERR! stack     at /root/gzweb/node_modules/node-gyp/node_modules/graceful-fs/graceful-fs.js:78:16
gyp ERR! stack     at fs.js:207:20
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Linux 4.4.0-96-generic
gyp ERR! command "node" "/root/gzweb/node_modules/.bin/node-gyp" "build" "-d"
gyp ERR! cwd /root/gzweb/gzbridge
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
There are node-gyp build errors, exiting.
The command '/bin/sh -c cd ~/gzweb     && hg up default     && xvfb-run -s "-screen 0 1280x1024x24" ./deploy.sh -m' returned a non-zero code: 1

I can also provide the full output if desired.

It appears to have to do with the version of node-gyp used, see this node-gyp issue. I suspect that this has ties to this issue reported on gzweb.

@ruffsl
Copy link
Member

ruffsl commented Oct 2, 2017

The unofficial gzweb7 tag is tracking the default branch for gzweb, so Its not too surprising that the master might diverge from building on previous releases. That said, gzweb8 still seem to be building fine as of 3 days ago, and nothing recent has been committed to it.

  • amd64 Docker Build Statu

If you find a resolution for older build, I can try and re enable the building the the older v7 tag.

@iche033
Copy link

iche033 commented Oct 3, 2017

we've been making a few changes recently to the default branch of gzweb. It now builds against the version of nodejs that comes with xenial so it fails here on trustry.

I worked around it by installing a more recent version nodejs. Tested with this patch:

diff --git a/gazebo/gazebo7/gzweb7/Dockerfile b/gazebo/gazebo7/gzweb7/Dockerfile
index 639157d..e120983 100644
--- a/gazebo/gazebo7/gzweb7/Dockerfile
+++ b/gazebo/gazebo7/gzweb7/Dockerfile
@@ -12,9 +12,6 @@ RUN apt-get update && apt-get install -q -y \
     libjansson-dev \
     libtinyxml-dev \
     mercurial \
-    nodejs \
-    nodejs-legacy \
-    npm \
     pkg-config \
     psmisc \
     xvfb\
@@ -28,14 +25,23 @@ RUN apt-get update && apt-get install -q -y \
 # clone gzweb
 RUN hg clone https://bitbucket.org/osrf/gzweb ~/gzweb
 
+# install nvm and node
+RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
+ENV NVM_DIR /root/.nvm
+ENV NODE_VERSION 6.1.0
+RUN . /root/.nvm/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION
+ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
+ENV PATH      $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
+
 # build gzweb
 RUN cd ~/gzweb \
     && hg up default \
-    && xvfb-run -s "-screen 0 1280x1024x24" ./deploy.sh -m
+    && npm run deploy
 
 # setup environment
 EXPOSE 8080
 EXPOSE 7681
 
 # run gzserver and gzweb
-CMD ./root/gzweb/start_gzweb.sh && gzserver
+CMD cd /root/gzweb && npm start &
+CMD gzserver

Note that by defailt we no longer build thumbnails so the deploy process should complete fast. I can create a pull request if that helps

@Kukanani
Copy link
Author

Kukanani commented Oct 3, 2017

Looks like it's working, thanks! I think a PR would be a good idea for future users.

@ruffsl
Copy link
Member

ruffsl commented Oct 23, 2017

Is this still an issue now that gazebo7 dockerfiles build from xenial, and no longer trusty?

@iche033
Copy link

iche033 commented Oct 23, 2017

I think it should work now and we no longer need pull request #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants