mapbox / node-or-tools

Node.js bindings for or-tools vehicle routing problems
MIT License
146 stars 48 forks source link

Building from source fails because src folder doesn't exist #34

Closed jariz closed 7 years ago

jariz commented 7 years ago

The src folder exists in the repo but not in the npm package (it seems).
It's explicitly ignored in .npmignore, why?

Environment
OSX/Linux (tried both)

Reproducible by run npm install node_or_tools --build-from-source

Expectation Building from source succeeds.

Logs
OSX: (full)

  TOUCH Release/obj.target/action_before_build.stamp
  SOLINK_MODULE(target) node_modules/node_or_tools/lib/binding/node_or_tools.node
clang: error: no such file or directory: 'Release/obj.target/node_or_tools/src/main.o'
clang: error: no such file or directory: 'Release/obj.target/node_or_tools/src/tsp.o'
clang: error: no such file or directory: 'Release/obj.target/node_or_tools/src/vrp.o'
make: *** [node_modules/node_or_tools/lib/binding/node_or_tools.node] Error 1

Linux: (full)

  TOUCH Release/obj.target/action_before_build.stamp
  SOLINK_MODULE(target) /usr/src/app/node_modules/node_or_tools/lib/binding/node_or_tools.node
g++: error: Release/obj.target/node_or_tools/src/main.o: No such file or directory
g++: error: Release/obj.target/node_or_tools/src/tsp.o: No such file or directory
g++: error: Release/obj.target/node_or_tools/src/vrp.o: No such file or directory
make: *** [/usr/src/app/node_modules/node_or_tools/lib/binding/node_or_tools.node] Error 1
node_or_tools.target.mk:156: recipe for target '/usr/src/app/node_modules/node_or_tools/lib/binding/node_or_tools.node' failed
jariz commented 7 years ago

Cloning this repo and then running npm i --build-from-source does, in fact work.
But when using node_or_tools as a dependency, compilation will fail.

daniel-j-h commented 7 years ago

Probably an oversight because we use the pre-built binaries for node 4 and node 6 (lts versions). Feel free to make a pr adding the source directory to the npmignore whitelist (and the deps file in the scripts directory, too).

jariz commented 7 years ago

Fixed by #36

daniel-j-h commented 7 years ago

Just published v1.0.5 including the changes.

Sorry for the regression based on https://github.com/mapbox/node-or-tools/issues/32#issuecomment-320662762.

jariz commented 7 years ago

Thanks dude!