Skip to content

Building 20.12.0 with old GLIBC: sys/random.h: No such file or directory #52223

Open
@njzjz

Description

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.

#ifdef HAVE_SYS_RANDOM_H
# include <sys/random.h>
#endif

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 when sys/random.h is missing in the old glibc (<2.25).

What do you see instead?

2024-03-26T19:49:01.0021083Z     cc -o /tmp/tmppjl__aad/build/nodejs-prefix/src/nodejs/out/Release/obj.target/cares/deps/cares/src/lib/ares_rand.o ../deps/cares/src/lib/ares_rand.c '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_OPENSSL_HAS_QUIC' '-DICU_NO_USER_DATA_OVERRIDE' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/config/linux  -pthread -Wall -Wextra -Wno-unused-parameter -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu11 -m64 -O3 -fno-omit-frame-pointer  -MMD -MF /tmp/tmppjl__aad/build/nodejs-prefix/src/nodejs/out/Release/.deps//tmp/tmppjl__aad/build/nodejs-prefix/src/nodejs/out/Release/obj.target/cares/deps/cares/src/lib/ares_rand.o.d.raw   -c
2024-03-26T19:49:01.0552754Z   ../deps/cares/src/lib/ares_rand.c:39:12: fatal error: sys/random.h: No such file or directory
2024-03-26T19:49:01.0553982Z      39 | #  include <sys/random.h>
2024-03-26T19:49:01.0554526Z         |            ^~~~~~~~~~~~~~
2024-03-26T19:49:01.0559918Z   compilation terminated.
2024-03-26T19:49:01.0588060Z   make[1]: *** [/tmp/tmppjl__aad/build/nodejs-prefix/src/nodejs/out/Release/obj.target/cares/deps/cares/src/lib/ares_rand.o] Error 1
2024-03-26T19:49:01.0590872Z   make[1]: *** Waiting for unfinished jobs....
2024-03-26T19:49:01.2031508Z   rm 6b3de4dd491ec37fd0646cdb3ef3868d29e0cb21.intermediate
2024-03-26T19:49:01.2232100Z   make[1]: Leaving directory `/tmp/tmppjl__aad/build/nodejs-prefix/src/nodejs/out'
2024-03-26T19:49:01.2253454Z   make: *** [node] Error 2
2024-03-26T19:49:01.2263564Z   FAILED: nodejs-prefix/src/nodejs-stamp/nodejs-build /tmp/tmppjl__aad/build/nodejs-prefix/src/nodejs-stamp/nodejs-build

Additional information

No response

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions