-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update to nan2 and node 3+ APIs #622
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
Conversation
@@ -63,19 +63,19 @@ Canvas::Initialize(Handle<Object> target) { | |||
*/ | |||
|
|||
NAN_METHOD(Canvas::New) { | |||
NanScope(); | |||
Nan::HandleScope scope; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed, HandleScopes are implicit for methods
Huh. This builds on Windows. That excludes JPEGStream, which is causing failures for 1.8+. Build logs for 0.8 - 0.12 are useless, but might be the same problem. |
return NanThrowTypeError("offset required"); | ||
if (!args[1]->IsString()) | ||
return NanThrowTypeError("color string required"); | ||
Nan::HandleScope scope; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
@rvagg gimme a sec and I'll clean those up :) |
Looks really good @zbjornson, I think where your crashiness comes from is in the use of |
@rvagg Changing Gonna be a bit for travis to catch up but I assume build issues will remain. Actually looks like it's from running node-gyp 2.0.2 instead of 3.x.x. https://travis-ci.org/Automattic/node-canvas/jobs/79592537#L3031 @LinusU perhaps your realm to fix that? :) |
The choice of |
@rvagg Got most of the builds working. I'm not sure what to do about these: https://travis-ci.org/Automattic/node-canvas/jobs/79758937#L3036 for example |
I'm not even sure how to properly test 0.8 any more, I haven't tested it for node-canvas since ... actually I don't know if I ever have! Anyway, you should be able to remove all of the |
Closer.
|
for 0.8, in init.cc, change:
to
|
for 3.0+, see this thread to update .travis.yml serialport/node-serialport#566 (comment) |
Wooo builds! I have FYI I also fixed the libpng download URL while troubleshooting the build. (replaces #489, fixes #466, overlaps with #602). |
Oh crap, I forgot to cut an actual release for that 😭 I'll fix that |
Massive! I'm so happy I didn't have to do this! |
I've been following and reading along on all this nan2 upgrade trying to understand whats going on. I see that node-canvas still wants no higher than node version 3. I saw one of you write something about v8::Handle and v8::Local .. wondering if I can help do anything to get node-canvas to work with node 4.0.0 ? |
What works on 3 works on 4. On Monday 14 September 2015 06:00:49 Benz Muircroft wrote:
|
|
It won't work until this PR has been merged. |
I have another issue. I am testing locally and it works fine with
But on Travis, it is different (only for v4, 0.12 is fine):
|
Needs g++-4.8. |
@targos It was released, but not pushed to the main repo :S
|
@kkoopa It's supposed to be here: language: node_js
node_js:
- "0.12"
- "4"
- "stable"
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libcairo2-dev
- libjpeg8-dev
- libpango1.0-dev
- libgif-dev
- g++-4.8 |
@LinusU cool, thanks 😃 |
You have to set CXX=g++-4.8 too. Just installing the package is not enough. |
Oh right, it is fine now. Thanks a lot ! |
- sudo chown -R $USER /usr/local | ||
- sh install | ||
- npm explore npm -g -- npm install node-gyp@latest | ||
after_script: | ||
- make benchmark |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add back the newline at the end of the file?
before_install: | ||
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g [email protected]' | ||
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this line or the one above should be updated so that they follow the same style?
'[ "${TRAVIS_OS_NAME}" != "linux" ] || export CXX=g++-4.8'
This is very good work, hopefully we can get this out of the door within the hour. Do you mind rebasing on master? I pushed some commits and it seems that you are two after. |
Rebased and changed .travis.yml. (I went with the I removed my change to install.sh where I updated the URI for libpng. My fix wasn't correct (typo in URL) and when I fixed it, it broke. So, no libpng. Save that for #602. Thanks! |
Cool cool cool! I'll test locally now and merge if everything looks good. Great job 🚀 🎢 |
Update to nan2 and node 3+ APIs
Published as |
excellent! |
Thanks everybody! Impressive work, in no time. |
Awesome to see this merged! 👍 |
Latest node-canvas support nodejs v4.0.0; see Automattic/node-canvas#622
This is not ready to merge.
This builds and all tests (mocha and browser) pass with iojs 3.3.0, but it's unstable and crashes node randomly. I'm at the limits of my C++ knowledge to debug this, although I have some suspicion it's an iojs bug based on the call stack.
@rvagg?
Replaces #580.