-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use node-pre-gyp to publish binaries for windows (fixes #186) #593
Conversation
Alternatively you can remove the publish call from AppVeyor and manage manually the binary publication with locally stored S3 access keys. |
Hello, thank you for starting work on this. Removing the need to install MSVC (even the newer, "lightweight" version) on Windows is going to make a huge improvement for users of sharp.
I'd like the pre-compiled sharp binaries to be served via Bintray alongside the pre-compiled dependent binaries because (a) S3 bandwidth charges (US$90/TB) are too high and (b) Bintray is Akamai-fronted, which I've found provides a better experience for users in Asia and Oceania. The docs suggest this should be possible. |
If you want to make it tag based then it makes sense to use node-pre-gyp-github instead which can use github releases for free file serving (instead of Bintray or S3). I can help to set it up if you want. If you still prefer bintray, you need your own way of uploading the output instead using the standard Controlling the bundle content in this case is very tricky. I would suggest to get all the required files in one request using the standard pre-gyp procedure instead of having the custom bindings.js logic. It is enough to use the bindings.js when you really want to (or have to) build from sources. Currently the bindings.js is called from gyp file, so anyway it will be executed only when no pre-gyp bundle have been downloaded. |
This is a very good point. I'm going to experiment a little with how this can work cross-platform and, as you say, avoid it becoming (any more) fragile. Thank you for your work so far getting this started - I'm sure Windows users will rejoice when this all "just works". |
I am probably missing something, but would this remove the need for the |
Very excited for this! This will be excellent for mac/linux users as well as it adds compiling sharp adds 1+ minute to installation currently :-) |
This solution only works on windows because on windows the
./build/Release
folder contains all the required binary dependencies. On linux and osx the./lib
folder is required as well, but they are excluded from the node-pre-gyp precompiled binary package. We might want to move the logic which prepares the./lib
folder from thebinding.gyp
file to a preinstall script. Would not be so complicates as some part is already inbinding.js
file.However I think the binary precompilation is much more important on windows than on linux. This is already a big a improvement in my opinion.
I have updated to
appveyor.yml
configuration to automatically publish the precompiled binary when the commit message contains the"[publish binary]"
string.Important notes
In my branch I am using my S3 bucket (kondi-sharp) and my encrypted keys to upload the binaries. You have to change the bucket in package.json binary/host entry and update the keys in appveyor.yml file. More details here: Create an S3 bucket and Create secure appveyor variables. If you do not update these, the
[publish binary]
builds will fail on your AppVeyor account because the encryption is unique per project instance.