mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
Compare commits
1 Commits
d8ca282fc0
...
pr/libredi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74b43602bc |
@@ -32,6 +32,14 @@ else stdenv.mkDerivation rec {
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
ENABLE_TEST_SYSTEM=1
|
||||
if [ "$(cat /proc/self/uid_map)" = " 0 0 4294967295" ]; then
|
||||
echo "Boot namespace detected! Disabling tests that use system()."
|
||||
echo "The system() relies on /bin/sh which may not be compatible with nixpkgs's"
|
||||
echo "glibc, so we can't test this without the sandboxing isolation."
|
||||
ENABLE_TEST_SYSTEM=0
|
||||
fi
|
||||
|
||||
${if stdenv.isDarwin && stdenv.isAarch64 then ''
|
||||
# We need the unwrapped binutils and clang:
|
||||
# We also want to build a fat library with x86_64, arm64, arm64e in there.
|
||||
@@ -45,16 +53,15 @@ else stdenv.mkDerivation rec {
|
||||
-isystem ${llvmPackages_13.libclang.lib}/lib/clang/*/include \
|
||||
-L${llvmPackages_13.clang.libc}/lib \
|
||||
-Wl,-install_name,$libName \
|
||||
-Wall -std=c99 -O3 -fPIC libredirect.c \
|
||||
-shared -o "$libName"
|
||||
'' else if stdenv.isDarwin then ''
|
||||
$CC -Wall -std=c99 -O3 -fPIC libredirect.c \
|
||||
$CC \
|
||||
-Wl,-install_name,$out/lib/$libName \
|
||||
-shared -o "$libName"
|
||||
'' else ''
|
||||
$CC -Wall -std=c99 -O3 -fPIC libredirect.c \
|
||||
$CC \
|
||||
''} \
|
||||
-Wall -std=c99 -O3 -fPIC libredirect.c \
|
||||
-DENABLE_TEST_SYSTEM=$ENABLE_TEST_SYSTEM \
|
||||
-shared -o "$libName"
|
||||
''}
|
||||
|
||||
if [ -n "$doInstallCheck" ]; then
|
||||
$CC -Wall -std=c99 \
|
||||
|
||||
@@ -146,6 +146,8 @@ int main(int argc, char *argv[])
|
||||
assert_mktemp_path(TESTDIR "/temp", "", buf);
|
||||
|
||||
test_spawn();
|
||||
|
||||
#if ENABLE_TEST_SYSTEM
|
||||
test_system();
|
||||
|
||||
// Only run subprocess if no arguments are given
|
||||
@@ -154,6 +156,7 @@ int main(int argc, char *argv[])
|
||||
if (argc == 1) {
|
||||
test_subprocess();
|
||||
}
|
||||
#endif
|
||||
|
||||
test_execv();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user