Skip to content

Conversation

@jackorp
Copy link
Contributor

@jackorp jackorp commented Feb 10, 2025

A nodejs tool "node-gyp" used for compiling native extensions from npm from source requires python version >= 3.8.

Install the high-enough python version 3.12 for RHEL 8 container. RHEL 8 base version is 3.6, it is not enough for node-gyp. Python 3.12 in RHEL 8 has support until 2029,
the currently projected RHEL 8 EOL, similarly to python 3.6

nodejs-22-minimal container does not do anything with python, leave that Containerfile as-is.

A nodejs tool "node-gyp" used for compiling native extensions
from npm from source requires python version >= 3.8.

Install the high-enough python version 3.12 for RHEL 8 container.
RHEL 8 base version is 3.6, it is not enough for node-gyp.
Python 3.12 in RHEL 8 has support until 2029,
the currently projected RHEL 8 EOL, similarly to python 3.6

nodejs-22-minimal container does not do anything with python,
leave that Containerfile as-is.
@github-actions
Copy link

github-actions bot commented Feb 10, 2025

Pull Request validation

Failed

🔴 Failed or pending statuses - Testing Farm - CentOS Stream 9 - 20[error],Testing Farm - RHEL8 - 20[error]
🔴 Review - Missing review from a member (1 required)

@phracek
Copy link
Member

phracek commented Feb 11, 2025

[test]

@github-actions
Copy link

github-actions bot commented Feb 11, 2025

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - 18-minimalFedora-latestx86_64✅ passed11.02.2025 14:34:147min 55stest pipeline
Fedora - 18Fedora-latestx86_64✅ passed26.02.2025 12:29:4410min 59stest pipeline
CentOS Stream 9 - 20CentOS-Stream-9x86_64❌ error26.02.2025 12:29:4814min 21stest pipeline
Fedora - 20Fedora-latestx86_64✅ passed26.02.2025 12:29:4813min 2stest pipeline
CentOS Stream 9 - 20-minimalCentOS-Stream-9x86_64✅ passed26.02.2025 12:29:5011min 33stest pipeline
Fedora - 20-minimalFedora-latestx86_64✅ passed26.02.2025 12:29:559min 10stest pipeline
CentOS Stream 10 - 22CentOS-Stream-10x86_64✅ passed26.02.2025 12:30:028min 49stest pipeline
RHEL9 - 18RHEL-9.4.0-Nightlyx86_64✅ passed26.02.2025 12:29:4419min 40stest pipeline
RHEL9 - 18-minimalRHEL-9.4.0-Nightlyx86_64✅ passed26.02.2025 12:29:4817min 52stest pipeline
RHEL8 - 18RHEL-8.10.0-Nightlyx86_64✅ passed26.02.2025 12:29:4422min 11stest pipeline
Fedora - 22Fedora-latestx86_64✅ passed26.02.2025 12:30:0813min 39stest pipeline
RHEL8 - 18-minimalRHEL-8.10.0-Nightlyx86_64✅ passed26.02.2025 12:29:4721min 41stest pipeline
CentOS Stream 10 - 22-minimalCentOS-Stream-10x86_64✅ passed26.02.2025 12:37:588min 8stest pipeline
Fedora - 22-minimalFedora-latestx86_64✅ passed26.02.2025 12:39:5110min 4stest pipeline
RHEL8 - 20RHEL-8.10.0-Nightlyx86_64❌ error26.02.2025 12:29:5024min 14stest pipeline
RHEL9 - 20RHEL-9.4.0-Nightlyx86_64✅ passed26.02.2025 12:29:5022min 48stest pipeline
RHEL8 - 20-minimalRHEL-8.10.0-Nightlyx86_64✅ passed26.02.2025 12:30:0021min 7stest pipeline
RHEL9 - 20-minimalRHEL-9.4.0-Nightlyx86_64✅ passed26.02.2025 12:29:5917min 11stest pipeline
RHEL9 - 22-minimalRHEL-9.4.0-Nightlyx86_64✅ passed26.02.2025 12:40:0415min 30stest pipeline
RHEL10 - 22-minimalRHEL-10-Nightlyx86_64✅ passed26.02.2025 12:40:0615min 6stest pipeline
RHEL10 - 22RHEL-10-Nightlyx86_64✅ passed26.02.2025 12:30:1123min 8stest pipeline
RHEL8 - 22-minimalRHEL-8.10.0-Nightlyx86_64✅ passed26.02.2025 12:41:4921min 38stest pipeline
RHEL9 - 22RHEL-9.4.0-Nightlyx86_64✅ passed26.02.2025 12:30:2422min 23stest pipeline
RHEL8 - 22RHEL-8.10.0-Nightlyx86_64✅ passed26.02.2025 12:30:4128min 20stest pipeline

@phracek
Copy link
Member

phracek commented Feb 12, 2025

RHEL10 failed here:

npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error rdkafka_admin.c: In function 'rd_kafka_UserScramCredentialUpsertion_new':
npm error rdkafka_admin.c:5986:21: error: implicit declaration of function 'RAND_priv_bytes' [-Wimplicit-function-declaration]
npm error  5986 |                 if (RAND_priv_bytes(random_salt, sizeof(random_salt)) == 1) {
npm error       |                     ^~~~~~~~~~~~~~~
npm error make[2]: *** [../mklove/Makefile.base:97: rdkafka_admin.o] Error 1
npm error make[1]: *** [Makefile:27: libs] Error 2
npm error make: *** [deps/librdkafka.target.mk:30: 11a9e3388a67e1ca5c31c1d8da49cb6d2714eb41.intermediate] Error 2
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules_22/npm/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Linux 6.12.0-48.el10.x86_64
npm error gyp ERR! command "/usr/bin/node-22" "/usr/lib/node_modules_22/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /opt/app-root/src/node_modules/node-rdkafka
npm error gyp ERR! node -v v22.11.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /opt/app-root/src/.npm/_logs/2025-02-11T20_19_18_326Z-debug-0.log
Error: building at STEP "RUN /usr/libexec/s2i/assemble": while running runtime: exit status 1
  ERROR: Failed to to build /tmp/tmp.h7eUN9OVnp/Dockerfile.sURe
Test for image 'ubi10/nodejs-22:1' FAILED (exit code: 1)

Fedora 22 passed, but the result is FAILED. Error in common module. The same for CentOS Stream 9

Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RHEL10 is still failing on rdkafka. See comment.

@jackorp
Copy link
Contributor Author

jackorp commented Feb 12, 2025

RHEL10 is still failing on rdkafka. See comment.

Not sure what can be done about that currently from our side as that is node-rdkafka bundled library's compilation problem, I'd guess confluentinc/librdkafka#4732 fixes that, but it is still open.

But the test got through python in node-gyp in other streams so there it is a betterment on RHEL 8 and fix of no longer using incorrect python with nodejs:22.

@jackorp
Copy link
Contributor Author

jackorp commented Feb 12, 2025

Actually this has better description of what's going on, which is OpenSSL incompatibility confluentinc/librdkafka#4911 and confluentinc/librdkafka#3535 should have fixed it, but the npm package node-rdkafka has the library as a git submodule and it's compiled as part of npm install... They probably need to update it.

@mhdawson
Copy link
Member

@khardix was this all that was needed to fixup the issue with respect to RHEL 8 the python version and the problems with node-rdkafka or was there something else?

@pacostas confirmed today that the issue on RHEL 9 has been resolved, there was an update 2 days ago that pulled in the new version of librdkafka that the needed fix with respect to OpenSSL.

@jackorp
Copy link
Contributor Author

jackorp commented Feb 20, 2025

was this all that was needed to fixup the issue with respect to RHEL 8 the python version and the problems with node-rdkafka or was there something else?

This will satisfy node-gyp's requirement for python >= 3.8 (that I last looked at)

confirmed today that the issue on RHEL 9 has been resolved, there was an update 2 days ago that pulled in the new version of librdkafka that the needed fix with respect to OpenSSL.

One problem fixed, another added. Now, we have too old compiler, default RHEL 8 gcc does not understand -std=c++20 introduced here: Blizzard/node-rdkafka@c8389ea

$ rpm -qa python3.12 npm nodejs gcc-c++
npm-10.9.2-1.22.13.1.1.module+el8.10.0+22759+46b58560.x86_64
gcc-c++-8.5.0-23.el8_10.x86_64
python3.12-3.12.8-1.el8_10.x86_64
nodejs-22.13.1-1.module+el8.10.0+22759+46b58560.x86_64
$ npm install node-rdkafka
<snip>
npm error make[1]: Leaving directory '/root/node_modules/node-rdkafka/deps/librdkafka'
npm error   TOUCH Release/obj.target/deps/librdkafka.stamp
npm error   CXX(target) Release/obj.target/node-librdkafka/src/binding.o
npm error rm 11a9e3388a67e1ca5c31c1d8da49cb6d2714eb41.intermediate
npm error make: Leaving directory '/root/node_modules/node-rdkafka/build'
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp info find Python using Python version 3.12.8 found at "/usr/bin/python3"
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/node_modules/node-rdkafka/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/.cache/node-gyp/22.13.1/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/22.13.1',
npm error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/22.13.1/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/root/node_modules/node-rdkafka',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error g++: error: unrecognized command line option ‘-std=c++20’; did you mean ‘-std=c++2a’?
npm error make: *** [node-librdkafka.target.mk:128: Release/obj.target/node-librdkafka/src/binding.o] Error 1
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Linux 6.12.11-200.fc41.x86_64
npm error gyp ERR! command "/usr/bin/node-22" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /root/node_modules/node-rdkafka
npm error gyp ERR! node -v v22.13.1
npm error gyp ERR! node-gyp -v v11.0.0
npm error gyp ERR! not ok

Notice line: npm error g++: error: unrecognized command line option ‘-std=c++20’; did you mean ‘-std=c++2a’?

@khardix
Copy link
Contributor

khardix commented Feb 24, 2025

One problem fixed, another added. Now, we have too old compiler, default RHEL 8 gcc does not understand -std=c++20 introduced here: Blizzard/node-rdkafka@c8389ea

Well, Node 22 cannot itself be compiled with the default gcc; we use gcc-toolset-12 in the spec file. I would suggest doing the same for this test.

@jackorp
Copy link
Contributor Author

jackorp commented Feb 24, 2025

Well, Node 22 cannot itself be compiled with the default gcc; we use gcc-toolset-12 in the spec file. I would suggest doing the same for this test.

That would also mean introducing it for the container, but I think it is a reasonable assumption from npm package developers that a capable enough compiler that was used for node build is used for npm compilation as well. Let's try it out here.

Node.js 22's minimal GCC requirement is higher than the default GCC
and GCC-C++ available on RHEL 8. It is reasonable from npm module
developers to expect at least the minimal version node.js supports
for compilation will be available to also compile the native extension
from source.

Therefore use and enable the gcc-toolset-14 collection inside container.
@jackorp
Copy link
Contributor Author

jackorp commented Feb 26, 2025

@phracek could you please try to rerun CI, I have also, additionally, added gcc-toolset-14 into the container instead of the regular gcc, we don't use the base version for Node.js build itself, and I think npm native extension authors could in theory expect compiler capable of compiling node.js to also compile their extensions.

This should make RHEL 8 pass for the binary application test (again).

@phracek
Copy link
Member

phracek commented Feb 26, 2025

let's re-run tests

[test]

@jackorp
Copy link
Contributor Author

jackorp commented Mar 10, 2025

Those related nodejs 22 tests look green, now that there is also the newer gcc-toolset-14

@phracek
Copy link
Member

phracek commented Mar 18, 2025

This loooks fine. Let's get merge it so we do not block #475

@phracek phracek merged commit aed9a20 into sclorg:master Mar 18, 2025
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants