Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903916 - net-libs/nodejs-16.19.1: compilation failes with enabled "pax-kernel" USE flag
Summary: net-libs/nodejs-16.19.1: compilation failes with enabled "pax-kernel" USE flag
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-04-06 14:38 UTC by EK
Modified: 2024-03-21 09:35 UTC (History)
3 users (show)

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


Attachments
nodejs-18.16.0-paxmarking.patch (nodejs-18.16.0-paxmarking.patch,3.39 KB, patch)
2023-06-25 20:14 UTC, Peter Levine
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description EK 2023-04-06 14:38:42 UTC
On attempt to emerge net-libs/nodejs-16.19.1 it fails to build, with the error message:

 * ERROR: net-libs/nodejs-16.19.1::gentoo failed (prepare phase):
 *   patch -p1  failed with /var/tmp/portage/net-libs/nodejs-16.19.1/files/nodejs-16.4.2-paxmarking.patch
 * 
 * Call stack:
 *               ebuild.sh, line  136:  Called src_prepare
 *             environment, line 3306:  Called default
 *      phase-functions.sh, line  872:  Called default_src_prepare
 *      phase-functions.sh, line  948:  Called __eapi8_src_prepare
 *             environment, line  351:  Called eapply '--' '/var/tmp/portage/net-libs/nodejs-16.19.1/files/nodejs-15.2.0-global-npm-config.patch' '/var/tmp/portage/net-libs/nodejs-16.19.1/files/nodejs-gcc-13.patch' '/var/tmp/portage/net-libs/nodejs-16.19.1/files/nodejs-16.4.2-paxmarking.patch'
 *             environment, line 1448:  Called _eapply_patch '/var/tmp/portage/net-libs/nodejs-16.19.1/files/nodejs-16.4.2-paxmarking.patch'
 *             environment, line 1386:  Called __helpers_die 'patch -p1  failed with /var/tmp/portage/net-libs/nodejs-16.19.1/files/nodejs-16.4.2-paxmarking.patch'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *   		die "$@"

With 'pax-kernel' USE flag disabled, compilation emerge succeeds without any problem.

Reproducible: Always

Steps to Reproduce:
1. enable 'pax-kernel' USE-flag
2. run emerge =net-libs/nodejs-16.19.1
Comment 1 William Hubbs gentoo-dev 2023-04-17 17:30:43 UTC
The issue is that the patch for node.gyp to apply pax marking for the
16.x branch doesn't apply to > nodejs-16.0.0.

It would be very helpful if someone could take a look and let me know
how to adjust the patch.

Thanks,

William
Comment 2 Peter Levine 2023-06-25 20:14:10 UTC
Created attachment 864599 [details, diff]
nodejs-18.16.0-paxmarking.patch

This applies cleanly to nodejs-20.3.0.
Comment 3 Andreas Thalhammer 2023-08-18 09:01:16 UTC
I just updated net-libs/nodejs from 20.2.0 to 20.5.1 (amd64 stable), and it seems like nodejs-18.16.0-paxmarking.patch no longer works for 20.5.1. (Reproducible: always)

I'm on a desktop-profile but I have USE=pax-kernel globally in my make.conf (among others, like "hardened").

---- terminal copy & paste ----
# emerge -aDuvN --with-bdeps=y --keep-going @world

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 21.58 s.

[ebuild     U  ] net-libs/nodejs-20.5.1:0/20::gentoo [20.2.0:0/20::gentoo] USE="icu inspector npm pax-kernel snapshot ssl system-icu system-ssl -corepack% -debug -doc (-lto) -test" CPU_FLAGS_X86="sse2" 0 KiB

Total: 1 package (1 upgrade), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] Yes
>>> Verifying ebuild manifests
>>> Running pre-merge checks for net-libs/nodejs-20.5.1
>>> Emerging (1 of 1) net-libs/nodejs-20.5.1::gentoo
>>> Failed to emerge net-libs/nodejs-20.5.1, Log file:
>>>  '/var/log/portage/net-libs:nodejs-20.5.1:20230818-082615.log'
>>> Jobs: 0 of 1 complete, 1 failed                 Load avg: 0.84, 0.57, 0.48

 * Messages for package net-libs/nodejs-20.5.1:
 * Log file: /var/log/portage/net-libs:nodejs-20.5.1:20230818-082615.log

 * ERROR: net-libs/nodejs-20.5.1::gentoo failed (prepare phase):
 *   patch -p1  failed with /var/tmp/portage/net-libs/nodejs-20.5.1/files/nodejs-18.16.0-paxmarking.patch
 * 
 * Call stack:
 *               ebuild.sh, line  136:  Called src_prepare
 *             environment, line 3613:  Called default
 *      phase-functions.sh, line  872:  Called default_src_prepare
 *      phase-functions.sh, line  948:  Called __eapi8_src_prepare
 *             environment, line  369:  Called eapply '--' '/var/tmp/portage/net-libs/nodejs-20.5.1/files/nodejs-20.3.0-gcc14.patch' '/var/tmp/portage/net-libs/nodejs-20.5.1/files/nodejs-18.16.0-paxmarking.patch'
 *             environment, line 1748:  Called _eapply_patch '/var/tmp/portage/net-libs/nodejs-20.5.1/files/nodejs-18.16.0-paxmarking.patch'
 *             environment, line 1686:  Called __helpers_die 'patch -p1  failed with /var/tmp/portage/net-libs/nodejs-20.5.1/files/nodejs-18.16.0-paxmarking.patch'
 *   isolated-functions.sh, line  112:  Called die
 * The specific snippet of code:
 *              die "$@"
---- snip ----

I got nodejs-20.5.1 installed with USE="-pax-kernel" for now.
Comment 4 Martin Filo 2023-08-18 12:48:58 UTC
Patch from Peter Levine works for nodejs-20.5.1 too.
Comment 5 Mike Benson 2023-08-23 02:46:50 UTC
(In reply to Martin Filo from comment #4)
> Patch from Peter Levine works for nodejs-20.5.1 too.

It also works for me. The patch in the gentoo repository has the same name, but differs by two lines from Peter's, (which I now have in my overlay):
$ diff gentoo/net-libs/nodejs/files/nodejs-18.16.0-paxmarking.patch overlay/net-libs/nodejs/files/nodejs-18.16.0-paxmarking.patch 
19a20
>      'node_js2c_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)node_js2c<(EXECUTABLE_SUFFIX)',
22d22
<          'node_text_start_object_path': 'src/large_pages/node_text_start.node_text_start.o'
Comment 6 Attila Tóth 2023-10-06 18:03:47 UTC
See my patches:
https://bugs.gentoo.org/694100
https://bugs.gentoo.org/735832