-
Notifications
You must be signed in to change notification settings - Fork 29.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
Building 20.12.0 with old GLIBC: sys/random.h: No such file or directory
#52223
Comments
I reproduced your problem using the same Docker image. By temporarily compiling successfully with At the same time, I found that the |
The root cause of this compilation error is that Node.js adopted a static method to directly load Lines 197 to 200 in 6d2d3f1
As a result, the original mechanism of c-ares for generating macros, as demonstrated below, was not executed. Lines 21505 to 21509 in 6d2d3f1
However, I currently do not know how to dynamically detect header files and set macros in GYP. |
If you are building Node.js for an older glibc you'll need to make adjustments accordingly. |
Could we append the following codes to #if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 25))
#undef HAVE_SYS_RANDOM_H
#undef HAVE_GETRANDOM
#endif When GLIBC version <2.25, undefine |
I agree with this workaround! |
I have solved this problem by applying Anna's patch. |
That may need You can check your setup it by adding
branch and building on older glibc, should not fail if all macros are set. |
This worked for me on RHEL 7.5 |
Can you suggest a workaround for this to build on machines with older
|
See the code in here: https://unofficial-builds.nodejs.org/ |
…CI failures Signed-off-by: Teague Sterling <[email protected]>
* Adding new versions and compilation conflict for nodejs * Update failed version for gcc14 * Updating conflicts notes for correctness/clarity/format * Applying spack-ized versions of fix in nodejs/node#52223 to adddress CI failures * Update fix-old-glibc-random-headers.patch * Update package.py * Update fix-old-glibc-random-headers.patch * Update fix-old-glibc-random-headers.patch * Adding conflict for older glibc * Fixing patch for older systems, need to undef * Removing overly strict conflicts --------- Signed-off-by: Teague Sterling <[email protected]>
* Adding new versions and compilation conflict for nodejs * Update failed version for gcc14 * Updating conflicts notes for correctness/clarity/format * Applying spack-ized versions of fix in nodejs/node#52223 to adddress CI failures * Update fix-old-glibc-random-headers.patch * Update package.py * Update fix-old-glibc-random-headers.patch * Update fix-old-glibc-random-headers.patch * Adding conflict for older glibc * Fixing patch for older systems, need to undef * Removing overly strict conflicts --------- Signed-off-by: Teague Sterling <[email protected]>
* Adding new versions and compilation conflict for nodejs * Update failed version for gcc14 * Updating conflicts notes for correctness/clarity/format * Applying spack-ized versions of fix in nodejs/node#52223 to adddress CI failures * Update fix-old-glibc-random-headers.patch * Update package.py * Update fix-old-glibc-random-headers.patch * Update fix-old-glibc-random-headers.patch * Adding conflict for older glibc * Fixing patch for older systems, need to undef * Removing overly strict conflicts --------- Signed-off-by: Teague Sterling <[email protected]>
* Adding new versions and compilation conflict for nodejs * Update failed version for gcc14 * Updating conflicts notes for correctness/clarity/format * Applying spack-ized versions of fix in nodejs/node#52223 to adddress CI failures * Update fix-old-glibc-random-headers.patch * Update package.py * Update fix-old-glibc-random-headers.patch * Update fix-old-glibc-random-headers.patch * Adding conflict for older glibc * Fixing patch for older systems, need to undef * Removing overly strict conflicts --------- Signed-off-by: Teague Sterling <[email protected]>
* Adding new versions and compilation conflict for nodejs * Update failed version for gcc14 * Updating conflicts notes for correctness/clarity/format * Applying spack-ized versions of fix in nodejs/node#52223 to adddress CI failures * Update fix-old-glibc-random-headers.patch * Update package.py * Update fix-old-glibc-random-headers.patch * Update fix-old-glibc-random-headers.patch * Adding conflict for older glibc * Fixing patch for older systems, need to undef * Removing overly strict conflicts --------- Signed-off-by: Teague Sterling <[email protected]>
* Adding new versions and compilation conflict for nodejs * Update failed version for gcc14 * Updating conflicts notes for correctness/clarity/format * Applying spack-ized versions of fix in nodejs/node#52223 to adddress CI failures * Update fix-old-glibc-random-headers.patch * Update package.py * Update fix-old-glibc-random-headers.patch * Update fix-old-glibc-random-headers.patch * Adding conflict for older glibc * Fixing patch for older systems, need to undef * Removing overly strict conflicts --------- Signed-off-by: Teague Sterling <[email protected]>
* nodejs_20.17.0 * Add libuv to build as it's a bootstrap dependency in js2c of nodejs >=20.3 * Use libuv 1.48 because of a new uv_pipe_bind2 * Clean up the local cbc.yaml * Adjust install.py call * Add workaround for nodejs/node#52223
Version
20.12.0
Platform
Linux 42c14383a17c 6.7.3-100.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Feb 1 03:33:32 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
CentOS 7
What steps will reproduce the bug?
Use the
quay.io/pypa/manylinux2014_x86_64
docker image (CentOS 7 based) to build nodejs (./configure
).How often does it reproduce? Is there a required condition?
It can be consistently reproduced.
What is the expected behavior? Why is that the expected behavior?
It can be successfully built, like 20.11.1.
node/deps/cares/src/lib/ares_rand.c
Lines 38 to 40 in 94fb854
These three lines were added by #51385 (upstream: c-ares/c-ares@d8edb76), and I believe that
HAVE_SYS_RANDOM_H
is not correctly set whensys/random.h
is missing in the old glibc (<2.25).What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: