-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[WIP] Use post_config.gypi to use shared libraries #1264
base: main
Are you sure you want to change the base?
Conversation
When is this a problem and why does it require a new file? |
I try to make node-sass to compile in a situation when libuv is unbundled. I need to supply system include directory (in my case What I am trying to do is to tell sass/node-sass#2070 to put libsass headers first and this patch is needed to make sure system include path goes last. So we get this order:
I do not see a way to tell gyp "add those directories at the end of the list". When not using "+" (prepend) qualifier it seems to merge directories in the order of include files - so I have added the directories to the I am experimenting here to make it work, this PR combined with sass/node-sass#2070 does the job. There are may be better alternatives, like removing |
Here is what happens (building sass/node-sass@4a0f3d0 with https://github.com/nodejs/node-gyp/releases/tag/v3.6.2 when using node v8.2.1 from FreeBSD ports :
Bundled libsass C++ files get compiled but |
@bnoordhuis I need solution to this problem quite urgently, do you think this is a way to go forward? Can you (or anyone) think of better alternatives? (I agree that introduction of an extra file is a kind of overkill) |
@saper do you want to continue pursuing this? if so, rebase to master and we'll try and get Ben back in here. |
Yes, definitely, this is the #1 reason why plain compilation of binary extensions fails on FreeBSD - |
Node can be compiled with external shared libraries; in this case append their compile and linker flags last.
@saper can you start considering how a test (or tests) for this might be constructed? There's a few more examples inside test/ these days that you could lean on. |
While I can't review the proposed changes here, I want to voice my support for this in general because this is becoming a huge pain for addon developers. Most recently the issue is that some OSes are still building node v17.x (which now bundles OpenSSL 3.x) against a shared OpenSSL 1.x. In this situation, when node-gyp builds, it downloads and builds against the bundled OpenSSL 3.x headers instead of the shared headers, which (depending on OpenSSL API changes) may still allow compilation to complete successfully but will end up causing runtime errors (e.g. due to missing symbols), which is more frustrating than not being able to compile at all because the user thinks the addon is going to work properly after installation. Some example OSes that are currently doing this include: macOS (specifically homebrew), ArchLinux (and any of its derivatives -- e.g. Manjaro), and some other Linux distro (RH/CentOS-based?) I can't recall offhand right now. |
Rebase, please? |
Actually, I just realized that in the case of OpenSSL, I don't think this kind of change will help because of how the headers tarball is structured. Specifically the issue is the At least if the OpenSSL subdirectory was in a separate directory (e.g. |
This is really bad, do you think node should bundle OpenSSL differently? |
Node can be compiled with external shared libraries;
in this case append their compile and linker flags last.