Skip to content

Expose algorithms option in node bindings and integrate new toolchain#3834

Merged
TheMarex merged 7 commits intomasterfrom
feature/algorithmsjs
Mar 30, 2017
Merged

Expose algorithms option in node bindings and integrate new toolchain#3834
TheMarex merged 7 commits intomasterfrom
feature/algorithmsjs

Conversation

@TheMarex
Copy link
Copy Markdown
Member

@TheMarex TheMarex commented Mar 17, 2017

Issue

Integrates algorithm flags into node bindings and bundles the new toolchain for MLD. This addresses #3846.

Tasklist

Requirements / Relations

Based on #3768.

@TheMarex TheMarex force-pushed the feature/algorithmsjs branch from 76b6626 to 598219b Compare March 17, 2017 16:54
@TheMarex TheMarex mentioned this pull request Mar 21, 2017
8 tasks
@TheMarex TheMarex force-pushed the feature/algorithmsjs branch 3 times, most recently from c850d90 to 24781e7 Compare March 28, 2017 14:25
@TheMarex TheMarex force-pushed the feature/algorithmsjs branch from 24781e7 to ce5afb7 Compare March 29, 2017 14:47
@TheMarex TheMarex force-pushed the feature/algorithmsjs branch from fdfe32b to abaa474 Compare March 29, 2017 15:30
@daniel-j-h daniel-j-h mentioned this pull request Mar 29, 2017
4 tasks
env:
global:
- secure: "hk+32aXXF5t1ApaM2Wjqooz3dx1si907L87WRMkO47WlpJmUUU/Ye+MJk9sViH8MdhOcceocVAmdYl5/WFWOIbDWNlBya9QvXDZyIu2KIre/0QyOCTZbrsif8paBXKIO5O/R4OTvIZ8rvWZsadBdmAT9GSbDhih6FzqXAEgeIYQ="
- secure: "VE+cFkseFwW4jK6XwkP0yW3h4DixPJ8+Eb3yKcchGZ5iIJxlZ/8i1vKHYxadgPRwSYwPSB14tF70xj2OmiT2keGzZUfphmPXinBaLEhYk+Bde+GZZkoSl5ND109I/LcyNr0nG9dDgtV6pkvFchgchpyP9JnVOOS0+crEZlAz0RE="
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did you get those from and how are they getting used? for node pre gyp publishing / aws credentials?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup they set node_pre_gyp_{secretKey,KeyId}.

- /^v\d+\.\d+(\.\d+)?(-\S*)?$/

cache:
yarn: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah factor 3-5 faster then npm.

- popd
- npm run build-api-docs
# building docs only works with npm3+ not with yarn or npm2
#- yarn run docs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? And can't we just use npm here, then?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs fixes in the docs tool. I don't see the point of building the docs for every build job. It almost takes a minute and would block us from using a sensible package manager like yarn.

7. Use `npm run build-api-docs` to generate the API documentation. Copy `build/docs/*` to `https://github.com/Project-OSRM/project-osrm.github.com` in the `docs/vN.N.N/api` directory
8. Push tags and commits: `git push; git push --tags`
9. If not a release-candidate: Write a mailing-list post to [email protected] to announce the release
10. Wait until the travis build has been complated and check if the node binaries were published by doing:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

completed

{
Nan::ThrowError("algorithm option must be a string and one of 'CH', 'CoreCH', or 'MLD'.");
return engine_config_ptr();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, using the maybe returned from Get is fine this way? as in, this is the same as

maybe = Get();
if (!maybe) err;

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm the docs say that the result from Object::Get is a MaybeLocal<> but that type does not have a operator->. For a Local<> calling operator-> is not safe since it would dereference a nullptr. So yes this would need a check.

assert.ok(route.routes.length);
assert.ok(route.routes[0].geometry);
});
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urgh please merge into master asap, I'm already working on changing the tests to monaco

if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
export JOBS=$((`sysctl -n hw.ncpu` + 1))
sudo mdutil -i off /
npm install -g yarn
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the yarn.lock file every time we update package.config now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it is updated automatically by yarn when you add a package using yarn add package. You will have to commit it though.

"author": "",
"license": "ISC",
"author": "Project OSRM Team",
"license": "BSD 2-Clause",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess ISC was wrong originally?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just the default license and nobody changed it.

@@ -0,0 +1,6179 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary to commit the auto-generated file? Guess it is better to add it to .gitignore otherwise will be always local changes and conflicts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this basically ensure that yarn resolves package versions the same for everyone installing osrm. One advantage of the yarn approach with the lock file is to enable caching, e.g. on Travis.

@TheMarex
Copy link
Copy Markdown
Member Author

@daniel-j-h @oxidase hopefully I addressed all concerns. Let me know if this is good to merge.

@daniel-j-h
Copy link
Copy Markdown
Member

👍

Copy link
Copy Markdown
Contributor

@oxidase oxidase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 just disappointed due to adding 6000 lines that is basically a job of a package manager.

@TheMarex TheMarex merged commit 273fd68 into master Mar 30, 2017
@TheMarex TheMarex deleted the feature/algorithmsjs branch March 30, 2017 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants