GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — build: refine static and shared lib build by yhwang · Pull Request #17604 · nodejs/node Conversation
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Was discussing this with Yihong last week, and I think it's worth pointing this out specifically.
In the Unix build, we build libnode.so (which gets linked as -lnode) and node (the binary).
In Windows, we can't build node.dll and node.exe, because the node.pdb and node.lib files clash. So this PR currently builds node.exe as node-win.exe to avoid the clash.
I guess the alternatives would be:
node.exe (sounds like this isn't possible, but maybe there's a way).node-win.dll and node.exe (I think this is worse than what the PR does currently).So assuming 1. isn't possible, I'm leaning towards what this PR does, I guess the only downside is that the dll and pdb files will have the wrong names, maybe they should be renamed too?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
or keep using node-win.exe and modify the test.py to pick up the new name in windows platform for this case?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, the problem is the clash in the symbol name? Can you use /Fd with VC++to specify the pdb filename?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should split cctest into internal and external tests, that way we could test the shared library on the external cctest tests.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
good point. I think it depends on the value of running cctest against the shared lib. If it's good and necessary, then we should do it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A summary for the change:
For cctest, since it depends some internal APIs, it can only build from obj files in all of the cases. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I hit two Windows issues mainly when creating this PR, including:
For first one, there are two ways to solve it (maybe more):
For the second one, I found two approaches,
Since our purpose is to used the static lib to build the executable and verify it. I used |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@digitalinfinity can you take a look as many of the challenges were around windows. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
My 2 cents given the choices for the name of the exe and the dll I think we want to:
I do wonder if there is any dependency on node.exe when the addons built or if they just use the node.pdb and node.lib files (ie addons would build/run fine without node.exe) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI run to validate tests pass across platforms in base case (particularly interested in AIX were there was some extra steps previously) https://ci.nodejs.org/job/node-test-pull-request/12040/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mhdawson It's good to run CI for verifying. I do see the failures. let me check those failures |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
If you need access to AIX to test out changes just let me know |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, I need to access AIX to verify the change |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
(cc @joaocgreis @bzoz since I'm technically on vacation 😄) @yhwang forgive me, I'm missing a bit of context here so I'll ask a somewhat basic question- in your case where you're building the exe out of the static lib, what is the problem if functions not used by the exe are optimized out? Or is the problem that the exe fails to link? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@digitalinfinity I guess you were asking about Windows specifically, right? Yes, unused functions are optimized out, the N-API. Because N-API is used by user addon. In And this issue only exists in Windows, in other platforms, the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Updated my change to address AIX failure. May I have another CI to verify the AIX build? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
updated the change to fix fips related failures. Please kick off another CI. Thanks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Another CI run: https://ci.nodejs.org/job/node-test-pull-request/12067/console |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@yhwang that's very odd- the NAPI methods are marked as |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Actually, I asked around and noticed this: https://blogs.msdn.microsoft.com/oldnewthing/20140321-00/?p=1433 So @yhwang it looks like the behavior you're seeing is by design and if we want those functions to actually get exported, the solution is to probably use a .DEF file |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
For link, I guess people may choose shared lib. But I don’t know how many pepole use node.exe with node.dll. and agree with you that people may link to the exe for native modules. I fixed AIX failure and found we use .exp in AIX. However, the way to generate the exp is not perfect yet. maybe we could refine the script and use it for AIX and Windows. I could create another PR for it later. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I am trying to find the failure in windows with VS 2017 now. The weird thing is I am using VS 2017 and I can build the node without any issue. Trying to recreate it first. For smartos, @cjihrig can I access the smartos env in CI? Then I can try to fix the failure. Thanks. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
for the windows failures, I can recreated it after I updated my VS2017. and the reason is one static project can't have more then one .res file. maybe merge the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@yhwang, I don't have access to any of the CI machines, but someone from the build group might be able to help. cc: @mhdawson |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
For Windows, I updated change and the .rc files are compiled and included in shared lib and executable. For static lib case, users need to add .rc files to their projects by themselves. May I have a new CI to verify the Windows build? If everything goes well, then only smartos left. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Refine the static and shared lib build process in order to integrate static and shared lib verfication into CI. When building both static and shared lib, we still build node executable now and it uses the shared and static lib. Signed-off-by: Yihong Wang <[email protected]> Refs: #14158 Backport-PR-URL: #19050 PR-URL: #17604 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
Refine the static and shared lib build process in order to integrate static and shared lib verfication into CI. When building both static and shared lib, we still build node executable now and it uses the shared and static lib. Signed-off-by: Yihong Wang <[email protected]> Refs: #14158 PR-URL: #17604 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
Refine the static and shared lib build process in order to integrate static and shared lib verfication into CI. When building both static and shared lib, we still build node executable now and it uses the shared and static lib. Signed-off-by: Yihong Wang <[email protected]> Refs: #14158 Backport-PR-URL: #19050 PR-URL: #17604 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
Refine the static and shared lib build process in order to integrate static and shared lib verfication into CI. When building both static and shared lib, we still build node executable now and it uses the shared and static lib. Signed-off-by: Yihong Wang <[email protected]> Refs: #14158 PR-URL: #17604 Reviewed-By: Bartosz Sosnowski <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
There was an error while loading. Please reload this page.
|
P.S. this change broke I opened nodejs/build#1288 so that once we get this working again we can keep it from regressing unintentionaly. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@refack I can help to solve the issue. But I don't know how to use BTW, currently, the master branch has an error when using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
nodejs#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: nodejs#25444
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
nodejs#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: nodejs#25444 PR-URL: nodejs#25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
nodejs#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: nodejs#25444 Backport-PR-URL: nodejs#25521 PR-URL: nodejs#25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
nodejs#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: nodejs#25444 Backport-PR-URL: nodejs#26478 PR-URL: nodejs#25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 Backport-PR-URL: #26478 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
#17604 refactored the gyp files so that `-blibpath:` on AIX was only set if `node_shared=="true"`. Restore the setting for non-shared builds. Fixes: #25444 Backport-PR-URL: #25521 PR-URL: #25447 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
doc: better document--shared build
There was an error while loading. Please reload this page.