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

Fix build breakage with Node.js 10.0.0-10.9.0. #833

Merged
merged 1 commit into from
Dec 18, 2018
Merged

Fix build breakage with Node.js 10.0.0-10.9.0. #833

merged 1 commit into from
Dec 18, 2018

Conversation

bnoordhuis
Copy link
Member

The five argument WriteUtf8() method was introduced in Node.js v10.0.0,
it doesn't exist in older 10.x releases.

Use the four argument overload and a bunch of pragmas to silence the
compiler warnings.

Fixes: #832
Refs: #825

nan.h Outdated
#else
// See https://github.com/nodejs/nan/issues/832.
// Disable the warning as there is no way around it.
// TODO(bnoordhuis) Use isolate-based version in Node.js v12.
Copy link
Member

Choose a reason for hiding this comment

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

I think the isolate version of WriteUtf8 is already available since v11 so #if NODE_MAJOR_VERSION >= 11 should be fine here.

Choose a reason for hiding this comment

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

What about

#if !NODE_VERSION_AT_LEAST(10,9,0)

It will use the isolate-based version for 10.10 and higher.

Copy link
Member

Choose a reason for hiding this comment

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

@MaartenBent There are situations where the node version used to build differs from that one used to execute the program. Therefore if you build with 10.10.0 but execute with 10.9.0 it will not work as the new API is not there. This is not intended as usually a native addon binary works for all minors of a major version.

Choose a reason for hiding this comment

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

You're right, I didn't consider ABI compatibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the isolate version of WriteUtf8 is already available since v11 so #if NODE_MAJOR_VERSION >= 11 should be fine here.

Right, that's true. Updated.

@Flarna
Copy link
Member

Flarna commented Dec 17, 2018

@bnoordhuis Do you think it would be a good idea to extend the test matrix with the initial node.js versions (e.g. add TRAVIS_NODE_VERSION="10.0.0",...)?

@kkoopa
Copy link
Collaborator

kkoopa commented Dec 17, 2018 via email

@Flarna
Copy link
Member

Flarna commented Dec 18, 2018

I would vote to add it for the "active" NodeJs versions, e.g. 10 and 11. I don't expect that anyone will touch older versions but I could imagine that the same deprecation mechanism used in Node 10 could happen again in 11 to prepare for 12.
Maybe remove versions like 5 from the matrix to reduce load?

The five argument WriteUtf8() method was introduced in Node.js v10.0.0,
it doesn't exist in older 10.x releases.

Use the four argument overload and a bunch of pragmas to silence the
compiler warnings.

Fixes: #832
Refs: #825
@bnoordhuis
Copy link
Member Author

@kkoopa LGTY? Would be best to put out a bug fix release ASAP.

@kkoopa
Copy link
Collaborator

kkoopa commented Dec 18, 2018 via email

@kkoopa
Copy link
Collaborator

kkoopa commented Dec 18, 2018

Done, thank you both for triaging this.

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

Successfully merging this pull request may close these issues.

None yet

4 participants