-
Notifications
You must be signed in to change notification settings - Fork 698
Node 10 support #1545
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
Node 10 support #1545
Conversation
|
Building on Linux Mint 19 ATM. |
c51d22f to
a1050f9
Compare
|
Oh windows :(. |
0abf500 to
8e0c31e
Compare
|
Looks like however we stood up libssh2 in NodeGit in the past utilized libssh2/win32/libssh2_config.h as the configuration file, which I think might be some sort of test fixture (I haven't looked too deeply into it). They changed that in 1.8 and reverting the use of libgcrypt for openssl seems to have done the trick on Windows. At least locally. |
|
Windows not happy about libssh2. It might be that we need to update openssl to 1.1 now, as well. |
|
So it's not a test fixture, but it's some weird config generated by cmake IIRC |
|
No, I don't believe so. The file, |
|
Oh ok yeah, I remember that now. I don't think the win32 one is a test fixture though, it was simply hardcoded (before we ever got our hands on it). I am vaguely recalling having to do some manual hacking on it last time we updated though :/ (take that with a grain of salt obviously) Bumping openssl at the same time is definitely worth the effort in my experience. |
|
Aha, yea test fixture was just a guess. I am not too sure what its actual origin / use really is, because it makes a lot of assumptions about the system. As for updating openssl, potentially! I'm debating it. We need to update it, and that actually might help alleviate the issue we're seeing with windows there. Though that's only really a guess! I need to sit down with a debugger and see what's causing the segfault in windows. It might point me in the right direction. It's possible there are header related issues for node 10 since node 10 exports openssl 1.1.0 and we node 6/8 are at 1.0.2 (where we are)... |
|
I will get back to this, but probably not until the weekend. It looks like Node 10 starts LTS in October, so we should try to get this working by then. |
|
In my extremely scientific opinion (based on a massive non-anecdotal dataset of 2 datapoints) updating openssl always alleviates the libssh issues, while bringing it's own issues (which are usually easier to solve, at least). Although, when was the last time we updated openssl? I fear it's been a while. Last time I'd tried, it was a massive failure and even the node-core guys weren't sure what the issue was. I always pull in openssl from nodecore, as they've already tweaked some headers etc. |
|
@stevek-axo are actively working on this branch locally. We're currently ripping out openssl on non-electron targets. We've also found that on linux libcurl fulfills the openssl dependency for electron. On OSX, we can provide the openssl dependency statically from homebrew, and on windows sigmoid provides prebuilts which we will hoist onto the nodegit s3 bucket. We will only need those for electron builds in the electron-npg-automator though... |
|
Please check out Conan it is a C/C++ package manager, written in Python (and Python is obviously already a dependency anyway of nodegit). You would have there an easy cross-platform way to install OpenSSL from conan-center and link against it. Only warning, I don't know much about gyp, so I'm not sure how flexible gyp is for such purposes. |
|
I feel pretty confident about our solution at this point - we'll see if CI agrees.TODO:
|
a3a3530 to
a1f5188
Compare
|
I am leaning toward the amount of trust conan provides for those binaries though.. I wonder if there's a way to get the openssl libraries without going through the rigmarole of using conan itself. |
|
Aha, we figured out how to navigate their files. We're going to try and nab Mac OS and Windows openssl prebuilts from conan without adding conan as a dependency. Thanks @Croydon! |
|
Aha. The libssh linking issue was the thing that prevented me from going down the rip-out-openssl road a long time ago. Beautiful work! I definitely agree and would like to avoid a conan dependency. It's all well and great when its just on our boxes/ci, but when people need to build nodegit (new node version, different platform etc) thats ANOTHER hurdle for people getting involved. As an aside, is the way to determine electron in node-gyp seriously checking if it's classified as iojs? That is so gross lol. |
|
@maxkorp We spent a lot of time deliberating and searching before making that approach final. As of now, I haven't managed to find a single hook point for making the distinction. If we wanted to go a different approach, we need to have users define an env variable or something. I think for builds where a user has an npmrc defined, we can use npm to determine the disturl of the headers via npm config, but for users who are trying to debug their solutions (see https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md#manually-building-for-electron) it doesn't work quite as well. What do you think? |
|
Oh also, we agree that it's gross, but actual iojs is no longer in my support target, and electron seems to want to be known as iojs. |
|
If I could find, and I would love the additional help, one works for all solution that is literally like, yes definitely it's building for electron right now that is not that, I'm all for it :) |
|
I do remember someone in node-core saying there was a flag or such to allow you to determine if there were openssl headers bundled with node, such that even if it wasn't electron (but someone was building nodegit on some platform where they'd compiled node without exporting those headers) we'd still be able to determine that. I'll try to go through my old posts on the matter. |
|
Hrm, no that flag was I think the issue here is going to end up being something a little (or a lottle) shitty, like, bundling openssl still, but also bundling the development headers. There's some way of passing flags into node-gyp, but I'm raking through the gyp sources right now and haven't found anything. |
|
So it seems like the environment variable that gets set internally by npm might be available in gyp land, which should tell us what we need to know via dist-url (unless they've also passed nodedir or whatever it is that just lets them point explicitly to a set of headers on disk, but theres literally no solution for that bar listening to the npmrc |
|
I think this branch is in a good place to be merged in. Summary of Changes
Ideas for Future Work:
Notes:There is a bit of wackiness in the node-gyp process for the In order to make |
|
That is some seriously impressive work. Nice job! I think folks are gonna be ecstatic to see this merged in! |
|
I have crashed my browser 3 times trying to look at the code lol. |
|
Can you add the files that get created during the libssh2 configure to the .gitignore across the different platforms? @stevek-axo |
|
@stevek-axo it looks like ramda, request-promise-native, and tar-fs are part of the gyp process now. They will need to be moved into the dependencies group, because if anyone uses npm install --production, node-gyp will fail. |
21fa4fb to
a637c19
Compare
|
@stevek-axo the formatting in https://github.com/implausible/nodegit/blob/feature/node-10-support/utils/README.md You also spelled system wrong on line 21. |
|
In const getDistributionConfigURLFromHash = itemHash =>
`https://bintray.com/conan-community/conan/download_file?file_path=conan%2FOpenSSL%2F1.1.0i%2Fstable%2Fpackage%2F${itemHash}%2Fconaninfo.txt`with const getDistributionConfigURLFromHash = itemHash =>
`https://dl.bintray.com/conan-community/conan/conan/OpenSSL/1.1.0i/stable/package/${itemHash}/conaninfo.txt`;And the getDistributionsRootURL that you specified Is actually easier to parse via |
6f4794f to
3497732
Compare
|
@stevek-axo We should be consistent with our compiler versions in our CI environment. I know vs15 looks like msvs2015, but it's actually msvs2017. We're currently targeting msvs2015, so you'll want to change your windows target to vs14 in |
|
I'd say this looks pretty darn good. |
|
God help us |
|
I don't really catch your meaning. This PR eliminated the complicated process of building openssl in favor of utilizing node, system libs, or prebuilts from conan as providers of openssl. I think this is a huge win for build times and ease of openssl upgrades. Imagine not having to nab and translate gyp files from nodejs every time we want to update! |
|
Oh it's a HUGE win. I was just saying, we've changed the build. We're batting a perfect 0 historically for build changes not breaking weird edge cases down the line is all I'm saying lol. |
|
Aha, yea that's so true. NodeGit is so god damn complicated. |
|
@implausible some day we'll be porting this to WASM and that will either make things 🌈 or 🌋 |
|
How is threading support so far for WASM? |
|
Also, just as an update on this big ordeal, we're currently testing the electron side of things for 2.0.9 in GitKraken. Everything seems to be going really well on that side of things!! How exciting 😄 |
|
So whatever broke is somewhere cold and dank, where old things lie and which make men tremble. In all seriousness, that is great news. |

No description provided.