| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
style nit: no space after function keyword
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed thanks.
Sorry, something went wrong.
|
I wanted to add that I tried making a test for this, but that would entail actually loading a native addon (I think). And I couldn't find an example of another test doing that so I'm not sure how to effectively make a test for this. I'm open for input on how best to achieve that. |
Sorry, something went wrong.
I don't see a problem with that. It should be test/addons/ though. An example can be found here, I think: https://github.com/nodejs/node/pull/2830/files cc @bnoordhuis? |
Sorry, something went wrong.
|
@Fishrock123 Great, thanks. Looking now. |
Sorry, something went wrong.
|
@Fishrock123 I apologize for the delay but based on your feedback I added a unit test that successfully loads the addon from a long path. |
Sorry, something went wrong.
|
I tried running eslint like this: node tools/eslint/bin/eslint.js lib/module.js --rulesdir tools/eslint-rules --quiet But I get a ton of existing errors. The CONTRIBUTING.md documentation just says:
I'm not totally sure that I'm doing it right. |
Sorry, something went wrong.
|
For linting just run make jslint :)
|
Sorry, something went wrong.
|
@Fishrock123 Again, thank you for your patience and your help :) I ran the tests and the linter successfully. I rebased my commits into a single commit with a descriptive comment and recently rebased upstream/master into my branch. I believe that this is ready for merging. |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you assert.equal(addon.hello(), 'world'); here?
Sorry, something went wrong.
There was a problem hiding this comment.
done.
Sorry, something went wrong.
There was a problem hiding this comment.
@justinmchase Are you intentionally comparing against both null and undefined here?
Sorry, something went wrong.
There was a problem hiding this comment.
@thefourtheye I believe I just copied that line from another test doing something similar. However, I think its most accurate to say that addon should be neither null or undefined. So yes it is intentional.
Also, the error case before this PR actually throws an error instead of returning null or undefined. So it's mostly just a sanity check. Same with the following line which actually calls the addon.hello() function, another sanity check.
Sorry, something went wrong.
|
LGTM but someone from @nodejs/platform-windows should sign off on this, I'm not sure to what extent LoadLibrary() supports UNC paths. |
Sorry, something went wrong.
|
Also, you might want to make sure that the commit is reflected in your GitHub profile. https://help.github.com/articles/setting-your-email-in-git/ |
Sorry, something went wrong.
It should work, although a comment on the doc page suggests that it doesn't for 32-bit builds. Did you test this? |
Sorry, something went wrong.
When using require to load a native addon the path must be converted into a long path, otherwise the addon will fail to be loaded on windows if the path is longer than 260 characters.
|
@piscisaureus I didn't, I only tested on x64. I don't know if I trust that comment but I will make a VM and try it there, it could take a little while. @thefourtheye I think the machine I happened to make this branch on hadn't been configured right but commit itself should have the right email and name now. Sorry for that. |
Sorry, something went wrong.
|
LGTM, thanks for this it was a painful issue in the past too :D |
Sorry, something went wrong.
|
/cc @nodejs/build - I think our Windows CI bots only test 64 bits builds now? |
Sorry, something went wrong.
|
@bnoordhuis : correct (even though I would like to fix that). |
Sorry, something went wrong.
|
@bnoordhuis @piscisaureus I built an x86 win7 vm and tested it there, confirmed it works on x86 as well. |
Sorry, something went wrong.
|
I added a correcting comment to msdn to help prevent confusion in the future: |
Sorry, something went wrong.
Sorry, something went wrong.
|
CI seems happy. |
Sorry, something went wrong.
When using require to load a native addon the path must be converted into a long path, otherwise the addon will fail to be loaded on windows if the path is longer than 260 characters. PR-URL: #2965 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com>
|
Landed in 8593b3e, thanks Justin. I had to touch up the first line of the commit log to make it fit in <= 50 columns, hope you don't mind. |
Sorry, something went wrong.
When using require to load a native addon the path must be converted into a long path, otherwise the addon will fail to be loaded on windows if the path is longer than 260 characters. PR-URL: #2965 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com>
| Back | FazBrowse Home | New Git URL |
Currently, it's possible for a native addon on windows to throw an exception during module loading if it's path is too long.
This change resolves the issue by converting the path to the addon to a long path before calling process.dlopen.
Fixes #2964