-
-
Notifications
You must be signed in to change notification settings - Fork 477
All: Add binary support for node 4 and 6 #103
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
This is fantastic work. If we could support windows as well, it would be superb. I will test this asap, have you got the prebuilts uploaded somewhere? |
@mcollina prebuilds are kind of a problem, actually. As it stands, the binaries containing the N-API implementations for 4 and for 6 would show up as tarballs at https://github.com/nodejs/node-addon-api/releases and the When I was testing this I forked the repo and changed all references to https://github.com/nodejs/node-addon-api in package.json to my personal clone at https://github.com/gabrielschulhof/node-addon-api, so when I ran I do not wish to pollute the release stream for this upstream repo with tarballs unless we all agree that we should perform the test. So, if you wish to test this, I would recommend that you
...
"node-addon-api": "git+https://github.com/mcollina/node-addon-api#binary"
... and then simply do this with your module: nvm use 4
npm install
node -p 'something that causes your module to load and output something'
nvm use 6
node -p 'something that causes your module to load and output something'
nvm use 8
node -p 'something that causes your module to load and output something' You should be able to run |
I guess we need more than just this PR. We also need a workflow to accompany the creation of a new |
@gabrielschulhof yes! Also, we need some way to make all of this setup work in Node releases between 8.0.0 and 8.x.0, when we drop the flag. But we can think about those releases later on. I will test this on Mac OS X early next week. |
I have managed to simplify the usage a bit. You need no longer make your own clone. It is now sufficient to depend on ...
"node-addon-api": "git+https://github.com/gabrielschulhof/node-addon-api#test-release"
... When you do that, it will still do some compiling, but only the loader that does the A further refinement could be to store the loader on github in binary form as well, so that |
@mcollina I have now uploaded prebuilds for OSX. I built them using the procedure for which I added documentation in the PR. So, ...
"node-addon-api": "git+https://github.com/gabrielschulhof/node-addon-api#test-release"
... followed by nvm use 4
npm install
node -p 'something that causes your module to load and output something'
nvm use 6
node -p 'something that causes your module to load and output something'
nvm use 8
node -p 'something that causes your module to load and output something' should now Just Work™ on OSX as well. |
So it's working, but I'm hitting #101 as well when switching versions, it seems working fine, as I can run a binary built on Node 4 on Node 6. For me it's a big 👍 and LGTM really. We need to sort out the prebuilt story for this, ideally before landing. Can we do the builds using our CI? cc @mhdawson. I've opened prebuild/prebuild#184 to track down how to remove the Personal Access Token requirement, it does not seem hard or impossible. |
I'd like to validate on AIX as well. |
I'm guessing this relies of linux exporting all symbols by default, AIX does not do that so it will probably require some extra steps like we had to do for the node executable itself. |
@gabrielschulhof can we put this on the agenda to discuss in the next meeting, would like to better understand and define next steps that we need to complete. |
Absolutely!
…On Fri, Sep 8, 2017 at 9:24 PM, Michael Dawson ***@***.***> wrote:
@gabrielschulhof <https://github.com/gabrielschulhof> can we put this on
the agenda to discuss in the next meeting, would like to better understand
and define next steps that we need to complete.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#103 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA7k0aBNUAG-qE6FOnOOeAyH-mHHeCOSks5sgYZmgaJpZM4OuUd0>
.
|
627cf2e
to
24bb8c6
Compare
@nodejs/addon-api, @mcollina I made it upload binaries to https://github.com/napi-binary-upload/upload/. That's pretty secure. We now need to test extensively with many different architectures. I couldn't get prebuild to work with Node.js between 8.0.0 and before 8.6.0, because a subsequently loaded shared library cannot eclipse the symbols of the loaded executable. Here's the built/runs result for the node-addon-api test suite:
I renamed the I used the following procedure for testing:
|
On Linux, building on 8.0.0 and running on 8.7.0 is successful, but there's an unresolved symbol. On Windows, building on 8.0.0 fails at the link stage, because the same symbol is available in two places. |
24bb8c6
to
8e2fc37
Compare
|
Note that for each table the result on the diagonal is the same as without prebuild. Only the off-diagonal checkmarks are made possible by using the prebuilds. I also edited the test procedure to mention the fact that prebuilds for the given platform/arch must be available before testing can be done. |
This is a departure from the way node-addon-api currently works because it never links |
* Introduce infrastructure for creating prebuilds and uploading them to a github repo. * Use prebuilds on all platforms except Windows and except Node.js >= 8.0.0 and < 8.6.0. * Update documentation to reflect requirement to load native addon `loadModule()` provided by index.js instead of `require()`. * Update tests to use `loadModule()`.
8e2fc37
to
e216cec
Compare
I believe we discussed this in the last N-API meeting and this is no longer applicable, closing. @gabrielschulhof please re-open if that is not the case. |
This is the first pass at achieving never-compile-again. I've tested it on Linux and I've made sure that it continues to work as before on Windows.
Many things can still be improved. For example, there is no need to build
n-api-implem.node
except when building viaprebuild
, however, I cannot distinguish inbinding.gyp
between a build initiated vianpm install
and a build initiated viaprebuild
.