mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 02:36:16 +02:00
8105307f0f
Because of an objc quirk[1], calling curl_global_init for the first time after fork() will always result in a crash. Up until now the solution has been to set OBJC_DISABLE_INITIALIZE_FORK_SAFETY for every nix process to ignore that error. This is less than ideal because we were setting it in package.nix, which meant that running nix tests locally would fail because that variable was not set. Instead of working around that error we address it at the core - by calling curl_global_init inside initLibStore, which should mean curl will already have been initialized by the time we try to do so in a forked process. [1]01edf1705f/runtime/objc-initialize.mm (L614-L636)
(cherry-picked and adapted fromc7d97802e4
)
110 lines
1.9 KiB
Nix
110 lines
1.9 KiB
Nix
{ lib
|
|
, stdenv
|
|
, mkMesonDerivation
|
|
, releaseTools
|
|
|
|
, meson
|
|
, ninja
|
|
, pkg-config
|
|
, rsync
|
|
|
|
, jq
|
|
, git
|
|
, mercurial
|
|
, util-linux
|
|
|
|
, nix-store
|
|
, nix-expr
|
|
, nix-cli
|
|
|
|
, rapidcheck
|
|
, gtest
|
|
, runCommand
|
|
|
|
, busybox-sandbox-shell ? null
|
|
|
|
# Configuration Options
|
|
|
|
, version
|
|
|
|
# For running the functional tests against a different pre-built Nix.
|
|
, test-daemon ? null
|
|
}:
|
|
|
|
let
|
|
inherit (lib) fileset;
|
|
in
|
|
|
|
mkMesonDerivation (finalAttrs: {
|
|
pname = "nix-functional-tests";
|
|
inherit version;
|
|
|
|
workDir = ./.;
|
|
fileset = fileset.unions [
|
|
../../scripts/nix-profile.sh.in
|
|
../../.version
|
|
../../tests/functional
|
|
./.
|
|
];
|
|
|
|
# Hack for sake of the dev shell
|
|
passthru.baseNativeBuildInputs = [
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
rsync
|
|
|
|
jq
|
|
git
|
|
mercurial
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
# For various sandboxing tests that needs a statically-linked shell,
|
|
# etc.
|
|
busybox-sandbox-shell
|
|
# For Overlay FS tests need `mount`, `umount`, and `unshare`.
|
|
# TODO use `unixtools` to be precise over which executables instead?
|
|
util-linux
|
|
];
|
|
|
|
nativeBuildInputs = finalAttrs.passthru.baseNativeBuildInputs ++ [
|
|
nix-cli
|
|
];
|
|
|
|
buildInputs = [
|
|
nix-store
|
|
nix-expr
|
|
];
|
|
|
|
|
|
preConfigure =
|
|
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
# Do the meson utils, without modification.
|
|
''
|
|
chmod u+w ./.version
|
|
echo ${version} > ../../../.version
|
|
''
|
|
# TEMP hack for Meson before make is gone, where
|
|
# `src/nix-functional-tests` is during the transition a symlink and
|
|
# not the actual directory directory.
|
|
+ ''
|
|
cd $(readlink -e $PWD)
|
|
echo $PWD | grep tests/functional
|
|
'';
|
|
|
|
mesonCheckFlags = [
|
|
"--print-errorlogs"
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
installPhase = ''
|
|
mkdir $out
|
|
'';
|
|
|
|
meta = {
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
|
|
} // lib.optionalAttrs (test-daemon != null) {
|
|
NIX_DAEMON_PACKAGE = test-daemon;
|
|
})
|