Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 787251 - net-libs/nodejs: bundled uvwasi causes --shared-libuv to be quietly ignored
Summary: net-libs/nodejs: bundled uvwasi causes --shared-libuv to be quietly ignored
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: bundled-libs
  Show dependency tree
 
Reported: 2021-04-30 23:19 UTC by Alessandro Barbieri
Modified: 2021-05-05 00:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
nodejs log grepped for libuv (libuv-nodejs.txt,63.44 KB, text/plain)
2021-04-30 23:19 UTC, Alessandro Barbieri
Details
full log (nodejs-16.0.0-r1:20210423-163322.logx.xz,54.12 KB, application/x-xz)
2021-04-30 23:24 UTC, Alessandro Barbieri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Barbieri 2021-04-30 23:19:06 UTC
Created attachment 704772 [details]
nodejs log grepped for libuv

I've noticed that libuv inside nodejs is still built and linked statically (and dynamically with -luv) even if in the ebuild is passed --shared-libuv

I suggest deleting the folders of the bundled libraries to be sure they are not built

Please see the attached log
Comment 1 Alessandro Barbieri 2021-04-30 23:24:08 UTC
Created attachment 704775 [details]
full log
Comment 2 Marek Szuba (RETIRED) archtester gentoo-dev 2021-05-04 12:14:30 UTC
Good catch, thanks - I can confirm that 'ldd node' shows no trace of libuv for latest ebuilds of both v16 and v14 (haven't tried v12 yet). Will try your suggestion, if it works it will be simpler than having to explicitly set all the libuv-related configure arguments to make sure the system version is used.
Comment 3 Marek Szuba (RETIRED) archtester gentoo-dev 2021-05-04 13:52:14 UTC
From what I can see the problem is that while Node itself can be told to use shared libuv, it does not propagate this setting to its bundled dependency "uvwasi". I am now testing if we can make the bundled uvwasi build against system libuv. As for unbundling the former, it has already been proposed upstream but it seems work on the related PR has  stalled.
Comment 4 Larry the Git Cow gentoo-dev 2021-05-04 15:42:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2aae48cbb242fae42837df1fba82b3aaf70139a

commit d2aae48cbb242fae42837df1fba82b3aaf70139a
Author:     Marek Szuba <marecki@gentoo.org>
AuthorDate: 2021-05-04 15:37:14 +0000
Commit:     Marek Szuba <marecki@gentoo.org>
CommitDate: 2021-05-04 15:41:57 +0000

    net-libs/nodejs: really link against system libuv
    
    Turns out the bundled library "uvwasi" implicitly pulled in the bundled
    libuv as a static library regardless of us having been passing
    --shared-libuv to configure.py pretty much for ever. Fortunately,
    patching the relevant lines out of the uvwasi gyp file seems to take
    care of the problem.
    
    Closes: https://bugs.gentoo.org/787251
    Signed-off-by: Marek Szuba <marecki@gentoo.org>

 .../nodejs/files/nodejs-12.22.1-uvwasi_shared_libuv.patch    | 12 ++++++++++++
 net-libs/nodejs/nodejs-12.22.1-r1.ebuild                     |  1 +
 net-libs/nodejs/nodejs-14.16.1-r1.ebuild                     |  1 +
 net-libs/nodejs/nodejs-16.0.0-r1.ebuild                      |  1 +
 4 files changed, 15 insertions(+)
Comment 5 Alessandro Barbieri 2021-05-05 00:21:08 UTC
Thanks