mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
Merge pull request #10835 from hercules-ci/update-nixpkgs-24.05
Update to Nixpkgs 24.05
This commit is contained in:
commit
1a32490aca
14 changed files with 186 additions and 310 deletions
|
@ -31,4 +31,3 @@ AlwaysBreakBeforeMultilineStrings: true
|
||||||
IndentPPDirectives: AfterHash
|
IndentPPDirectives: AfterHash
|
||||||
PPIndentWidth: 2
|
PPIndentWidth: 2
|
||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: false
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
# System tests.
|
# System tests.
|
||||||
tests = import ../tests/nixos { inherit lib nixpkgs nixpkgsFor; } // {
|
tests = import ../tests/nixos { inherit lib nixpkgs nixpkgsFor self; } // {
|
||||||
|
|
||||||
# Make sure that nix-env still produces the exact same result
|
# Make sure that nix-env still produces the exact same result
|
||||||
# on a particular version of Nixpkgs.
|
# on a particular version of Nixpkgs.
|
||||||
|
@ -151,10 +151,11 @@ in
|
||||||
|
|
||||||
nixpkgsLibTests =
|
nixpkgsLibTests =
|
||||||
forAllSystems (system:
|
forAllSystems (system:
|
||||||
import (nixpkgs + "/lib/tests/release.nix")
|
import (nixpkgs + "/lib/tests/test-with-nix.nix")
|
||||||
{
|
{
|
||||||
|
lib = nixpkgsFor.${system}.native.lib;
|
||||||
|
nix = self.packages.${system}.nix;
|
||||||
pkgs = nixpkgsFor.${system}.native;
|
pkgs = nixpkgsFor.${system}.native;
|
||||||
nixVersions = [ self.packages.${system}.nix ];
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -169,10 +170,10 @@ in
|
||||||
pkgs.runCommand "install-tests"
|
pkgs.runCommand "install-tests"
|
||||||
{
|
{
|
||||||
againstSelf = testNixVersions pkgs pkgs.nix pkgs.pkgs.nix;
|
againstSelf = testNixVersions pkgs pkgs.nix pkgs.pkgs.nix;
|
||||||
againstCurrentUnstable =
|
againstCurrentLatest =
|
||||||
# FIXME: temporarily disable this on macOS because of #3605.
|
# FIXME: temporarily disable this on macOS because of #3605.
|
||||||
if system == "x86_64-linux"
|
if system == "x86_64-linux"
|
||||||
then testNixVersions pkgs pkgs.nix pkgs.nixUnstable
|
then testNixVersions pkgs pkgs.nix pkgs.nixVersions.latest
|
||||||
else null;
|
else null;
|
||||||
# Disabled because the latest stable version doesn't handle
|
# Disabled because the latest stable version doesn't handle
|
||||||
# `NIX_DAEMON_SOCKET_PATH` which is required for the tests to work
|
# `NIX_DAEMON_SOCKET_PATH` which is required for the tests to work
|
||||||
|
|
|
@ -1,99 +0,0 @@
|
||||||
diff --git a/darwin_stop_world.c b/darwin_stop_world.c
|
|
||||||
index 0468aaec..b348d869 100644
|
|
||||||
--- a/darwin_stop_world.c
|
|
||||||
+++ b/darwin_stop_world.c
|
|
||||||
@@ -356,6 +356,7 @@ GC_INNER void GC_push_all_stacks(void)
|
|
||||||
int nthreads = 0;
|
|
||||||
word total_size = 0;
|
|
||||||
mach_msg_type_number_t listcount = (mach_msg_type_number_t)THREAD_TABLE_SZ;
|
|
||||||
+ size_t stack_limit;
|
|
||||||
if (!EXPECT(GC_thr_initialized, TRUE))
|
|
||||||
GC_thr_init();
|
|
||||||
|
|
||||||
@@ -411,6 +412,19 @@ GC_INNER void GC_push_all_stacks(void)
|
|
||||||
GC_push_all_stack_sections(lo, hi, p->traced_stack_sect);
|
|
||||||
}
|
|
||||||
if (altstack_lo) {
|
|
||||||
+ // When a thread goes into a coroutine, we lose its original sp until
|
|
||||||
+ // control flow returns to the thread.
|
|
||||||
+ // While in the coroutine, the sp points outside the thread stack,
|
|
||||||
+ // so we can detect this and push the entire thread stack instead,
|
|
||||||
+ // as an approximation.
|
|
||||||
+ // We assume that the coroutine has similarly added its entire stack.
|
|
||||||
+ // This could be made accurate by cooperating with the application
|
|
||||||
+ // via new functions and/or callbacks.
|
|
||||||
+ stack_limit = pthread_get_stacksize_np(p->id);
|
|
||||||
+ if (altstack_lo >= altstack_hi || altstack_lo < altstack_hi - stack_limit) { // sp outside stack
|
|
||||||
+ altstack_lo = altstack_hi - stack_limit;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
total_size += altstack_hi - altstack_lo;
|
|
||||||
GC_push_all_stack(altstack_lo, altstack_hi);
|
|
||||||
}
|
|
||||||
diff --git a/include/gc.h b/include/gc.h
|
|
||||||
index edab6c22..f2c61282 100644
|
|
||||||
--- a/include/gc.h
|
|
||||||
+++ b/include/gc.h
|
|
||||||
@@ -2172,6 +2172,11 @@ GC_API void GC_CALL GC_win32_free_heap(void);
|
|
||||||
(*GC_amiga_allocwrapper_do)(a,GC_malloc_atomic_ignore_off_page)
|
|
||||||
#endif /* _AMIGA && !GC_AMIGA_MAKINGLIB */
|
|
||||||
|
|
||||||
+#if !__APPLE__
|
|
||||||
+/* Patch doesn't work on apple */
|
|
||||||
+#define NIX_BOEHM_PATCH_VERSION 1
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
|
|
||||||
index b5d71e62..aed7b0bf 100644
|
|
||||||
--- a/pthread_stop_world.c
|
|
||||||
+++ b/pthread_stop_world.c
|
|
||||||
@@ -768,6 +768,8 @@ STATIC void GC_restart_handler(int sig)
|
|
||||||
/* world is stopped. Should not fail if it isn't. */
|
|
||||||
GC_INNER void GC_push_all_stacks(void)
|
|
||||||
{
|
|
||||||
+ size_t stack_limit;
|
|
||||||
+ pthread_attr_t pattr;
|
|
||||||
GC_bool found_me = FALSE;
|
|
||||||
size_t nthreads = 0;
|
|
||||||
int i;
|
|
||||||
@@ -851,6 +853,37 @@ GC_INNER void GC_push_all_stacks(void)
|
|
||||||
hi = p->altstack + p->altstack_size;
|
|
||||||
/* FIXME: Need to scan the normal stack too, but how ? */
|
|
||||||
/* FIXME: Assume stack grows down */
|
|
||||||
+ } else {
|
|
||||||
+#ifdef HAVE_PTHREAD_ATTR_GET_NP
|
|
||||||
+ if (!pthread_attr_init(&pattr)
|
|
||||||
+ || !pthread_attr_get_np(p->id, &pattr))
|
|
||||||
+#else /* HAVE_PTHREAD_GETATTR_NP */
|
|
||||||
+ if (pthread_getattr_np(p->id, &pattr))
|
|
||||||
+#endif
|
|
||||||
+ {
|
|
||||||
+ ABORT("GC_push_all_stacks: pthread_getattr_np failed!");
|
|
||||||
+ }
|
|
||||||
+ if (pthread_attr_getstacksize(&pattr, &stack_limit)) {
|
|
||||||
+ ABORT("GC_push_all_stacks: pthread_attr_getstacksize failed!");
|
|
||||||
+ }
|
|
||||||
+ if (pthread_attr_destroy(&pattr)) {
|
|
||||||
+ ABORT("GC_push_all_stacks: pthread_attr_destroy failed!");
|
|
||||||
+ }
|
|
||||||
+ // When a thread goes into a coroutine, we lose its original sp until
|
|
||||||
+ // control flow returns to the thread.
|
|
||||||
+ // While in the coroutine, the sp points outside the thread stack,
|
|
||||||
+ // so we can detect this and push the entire thread stack instead,
|
|
||||||
+ // as an approximation.
|
|
||||||
+ // We assume that the coroutine has similarly added its entire stack.
|
|
||||||
+ // This could be made accurate by cooperating with the application
|
|
||||||
+ // via new functions and/or callbacks.
|
|
||||||
+ #ifndef STACK_GROWS_UP
|
|
||||||
+ if (lo >= hi || lo < hi - stack_limit) { // sp outside stack
|
|
||||||
+ lo = hi - stack_limit;
|
|
||||||
+ }
|
|
||||||
+ #else
|
|
||||||
+ #error "STACK_GROWS_UP not supported in boost_coroutine2 (as of june 2021), so we don't support it in Nix."
|
|
||||||
+ #endif
|
|
||||||
}
|
|
||||||
GC_push_all_stack_sections(lo, hi, traced_stack_sect);
|
|
||||||
# ifdef STACK_GROWS_UP
|
|
25
flake.lock
25
flake.lock
|
@ -69,20 +69,36 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1709083642,
|
"lastModified": 1717432640,
|
||||||
"narHash": "sha256-7kkJQd4rZ+vFrzWu8sTRtta5D1kBG0LSRYAfhtmMlSo=",
|
"narHash": "sha256-+f9c4/ZX5MWDOuB1rKoWj+lBNm0z0rs4CK47HBLxy1o=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b550fe4b4776908ac2a861124307045f8e717c8e",
|
"rev": "88269ab3044128b7c2f4c7d68448b2fb50456870",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "release-23.11",
|
"ref": "release-24.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-23-11": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1717159533,
|
||||||
|
"narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs-regression": {
|
"nixpkgs-regression": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1643052045,
|
"lastModified": 1643052045,
|
||||||
|
@ -131,6 +147,7 @@
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"libgit2": "libgit2",
|
"libgit2": "libgit2",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-23-11": "nixpkgs-23-11",
|
||||||
"nixpkgs-regression": "nixpkgs-regression",
|
"nixpkgs-regression": "nixpkgs-regression",
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
}
|
}
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -3,8 +3,9 @@
|
||||||
|
|
||||||
# TODO switch to nixos-23.11-small
|
# TODO switch to nixos-23.11-small
|
||||||
# https://nixpk.gs/pr-tracker.html?pr=291954
|
# https://nixpk.gs/pr-tracker.html?pr=291954
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
|
||||||
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
|
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
|
||||||
|
inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446";
|
||||||
inputs.flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
inputs.flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
||||||
inputs.libgit2 = { url = "github:libgit2/libgit2"; flake = false; };
|
inputs.libgit2 = { url = "github:libgit2/libgit2"; flake = false; };
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@
|
||||||
"armv7l-unknown-linux-gnueabihf"
|
"armv7l-unknown-linux-gnueabihf"
|
||||||
"riscv64-unknown-linux-gnu"
|
"riscv64-unknown-linux-gnu"
|
||||||
"x86_64-unknown-netbsd"
|
"x86_64-unknown-netbsd"
|
||||||
|
"x86_64-unknown-freebsd"
|
||||||
"x86_64-w64-mingw32"
|
"x86_64-w64-mingw32"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -146,16 +148,9 @@
|
||||||
++ [ "-DUSE_SSH=exec" ];
|
++ [ "-DUSE_SSH=exec" ];
|
||||||
});
|
});
|
||||||
|
|
||||||
boehmgc-nix = (final.boehmgc.override {
|
boehmgc-nix = final.boehmgc.override {
|
||||||
enableLargeConfig = true;
|
enableLargeConfig = true;
|
||||||
}).overrideAttrs(o: {
|
};
|
||||||
patches = (o.patches or []) ++ [
|
|
||||||
./dep-patches/boehmgc-coroutine-sp-fallback.diff
|
|
||||||
|
|
||||||
# https://github.com/ivmai/bdwgc/pull/586
|
|
||||||
./dep-patches/boehmgc-traceable_allocator-public.diff
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
libseccomp-nix = final.libseccomp.overrideAttrs (_: rec {
|
libseccomp-nix = final.libseccomp.overrideAttrs (_: rec {
|
||||||
version = "2.5.5";
|
version = "2.5.5";
|
||||||
|
@ -165,8 +160,6 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
changelog-d-nix = final.buildPackages.callPackage ./misc/changelog-d.nix { };
|
|
||||||
|
|
||||||
nix =
|
nix =
|
||||||
let
|
let
|
||||||
officialRelease = false;
|
officialRelease = false;
|
||||||
|
@ -230,7 +223,7 @@
|
||||||
rl-next =
|
rl-next =
|
||||||
let pkgs = nixpkgsFor.${system}.native;
|
let pkgs = nixpkgsFor.${system}.native;
|
||||||
in pkgs.buildPackages.runCommand "test-rl-next-release-notes" { } ''
|
in pkgs.buildPackages.runCommand "test-rl-next-release-notes" { } ''
|
||||||
LANG=C.UTF-8 ${pkgs.changelog-d-nix}/bin/changelog-d ${./doc/manual/rl-next} >$out
|
LANG=C.UTF-8 ${pkgs.changelog-d}/bin/changelog-d ${./doc/manual/rl-next} >$out
|
||||||
'';
|
'';
|
||||||
repl-completion = nixpkgsFor.${system}.native.callPackage ./tests/repl-completion.nix { };
|
repl-completion = nixpkgsFor.${system}.native.callPackage ./tests/repl-completion.nix { };
|
||||||
} // (lib.optionalAttrs (builtins.elem system linux64BitSystems)) {
|
} // (lib.optionalAttrs (builtins.elem system linux64BitSystems)) {
|
||||||
|
@ -244,7 +237,7 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
packages = forAllSystems (system: rec {
|
packages = forAllSystems (system: rec {
|
||||||
inherit (nixpkgsFor.${system}.native) nix changelog-d-nix;
|
inherit (nixpkgsFor.${system}.native) nix changelog-d;
|
||||||
default = nix;
|
default = nix;
|
||||||
} // (lib.optionalAttrs (builtins.elem system linux64BitSystems) {
|
} // (lib.optionalAttrs (builtins.elem system linux64BitSystems) {
|
||||||
nix-static = nixpkgsFor.${system}.static.nix;
|
nix-static = nixpkgsFor.${system}.static.nix;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env nix
|
#!/usr/bin/env nix
|
||||||
#!nix shell .#changelog-d-nix --command bash
|
#!nix shell .#changelog-d --command bash
|
||||||
|
|
||||||
# --- CONFIGURATION ---
|
# --- CONFIGURATION ---
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
{ mkDerivation, aeson, base, bytestring, cabal-install-parsers
|
|
||||||
, Cabal-syntax, containers, directory, filepath, frontmatter
|
|
||||||
, generic-lens-lite, lib, mtl, optparse-applicative, parsec, pretty
|
|
||||||
, regex-applicative, text, pkgs
|
|
||||||
}:
|
|
||||||
let rev = "f30f6969e9cd8b56242309639d58acea21c99d06";
|
|
||||||
in
|
|
||||||
mkDerivation {
|
|
||||||
pname = "changelog-d";
|
|
||||||
version = "0.1";
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
name = "changelog-d-${rev}.tar.gz";
|
|
||||||
url = "https://codeberg.org/roberth/changelog-d/archive/${rev}.tar.gz";
|
|
||||||
hash = "sha256-8a2+i5u7YoszAgd5OIEW0eYUcP8yfhtoOIhLJkylYJ4=";
|
|
||||||
} // { inherit rev; };
|
|
||||||
isLibrary = false;
|
|
||||||
isExecutable = true;
|
|
||||||
libraryHaskellDepends = [
|
|
||||||
aeson base bytestring cabal-install-parsers Cabal-syntax containers
|
|
||||||
directory filepath frontmatter generic-lens-lite mtl parsec pretty
|
|
||||||
regex-applicative text
|
|
||||||
];
|
|
||||||
executableHaskellDepends = [
|
|
||||||
base bytestring Cabal-syntax directory filepath
|
|
||||||
optparse-applicative
|
|
||||||
];
|
|
||||||
doHaddock = false;
|
|
||||||
description = "Concatenate changelog entries into a single one";
|
|
||||||
license = lib.licenses.gpl3Plus;
|
|
||||||
mainProgram = "changelog-d";
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
# Taken temporarily from <nixpkgs/pkgs/by-name/ch/changelog-d/package.nix>
|
|
||||||
{
|
|
||||||
callPackage,
|
|
||||||
lib,
|
|
||||||
haskell,
|
|
||||||
haskellPackages,
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
hsPkg = haskellPackages.callPackage ./changelog-d.cabal.nix { };
|
|
||||||
|
|
||||||
addCompletions = haskellPackages.generateOptparseApplicativeCompletions ["changelog-d"];
|
|
||||||
|
|
||||||
haskellModifications =
|
|
||||||
lib.flip lib.pipe [
|
|
||||||
addCompletions
|
|
||||||
haskell.lib.justStaticExecutables
|
|
||||||
];
|
|
||||||
|
|
||||||
mkDerivationOverrides = finalAttrs: oldAttrs: {
|
|
||||||
|
|
||||||
version = oldAttrs.version + "-git-${lib.strings.substring 0 7 oldAttrs.src.rev}";
|
|
||||||
|
|
||||||
meta = oldAttrs.meta // {
|
|
||||||
homepage = "https://codeberg.org/roberth/changelog-d";
|
|
||||||
maintainers = [ lib.maintainers.roberth ];
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
in
|
|
||||||
(haskellModifications hsPkg).overrideAttrs mkDerivationOverrides
|
|
|
@ -114,12 +114,12 @@ nix_err nix_value_call_multi(
|
||||||
*
|
*
|
||||||
* @see nix_value_call_multi
|
* @see nix_value_call_multi
|
||||||
*/
|
*/
|
||||||
#define NIX_VALUE_CALL(context, state, value, fn, ...) \
|
#define NIX_VALUE_CALL(context, state, value, fn, ...) \
|
||||||
do { \
|
do { \
|
||||||
Value * args_array[] = {__VA_ARGS__}; \
|
Value * args_array[] = {__VA_ARGS__}; \
|
||||||
size_t nargs = sizeof(args_array) / sizeof(args_array[0]); \
|
size_t nargs = sizeof(args_array) / sizeof(args_array[0]); \
|
||||||
nix_value_call_multi(context, state, fn, nargs, args_array, value); \
|
nix_value_call_multi(context, state, fn, nargs, args_array, value); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Forces the evaluation of a Nix value.
|
* @brief Forces the evaluation of a Nix value.
|
||||||
|
|
|
@ -47,6 +47,8 @@
|
||||||
|
|
||||||
#define GC_INCLUDE_NEW
|
#define GC_INCLUDE_NEW
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
#include <gc/gc.h>
|
#include <gc/gc.h>
|
||||||
#include <gc/gc_cpp.h>
|
#include <gc/gc_cpp.h>
|
||||||
#include <gc/gc_allocator.h>
|
#include <gc/gc_allocator.h>
|
||||||
|
@ -250,6 +252,50 @@ class BoehmGCStackAllocator : public StackAllocator {
|
||||||
|
|
||||||
static BoehmGCStackAllocator boehmGCStackAllocator;
|
static BoehmGCStackAllocator boehmGCStackAllocator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When a thread goes into a coroutine, we lose its original sp until
|
||||||
|
* control flow returns to the thread.
|
||||||
|
* While in the coroutine, the sp points outside the thread stack,
|
||||||
|
* so we can detect this and push the entire thread stack instead,
|
||||||
|
* as an approximation.
|
||||||
|
* The coroutine's stack is covered by `BoehmGCStackAllocator`.
|
||||||
|
* This is not an optimal solution, because the garbage is scanned when a
|
||||||
|
* coroutine is active, for both the coroutine and the original thread stack.
|
||||||
|
* However, the implementation is quite lean, and usually we don't have active
|
||||||
|
* coroutines during evaluation, so this is acceptable.
|
||||||
|
*/
|
||||||
|
void fixupBoehmStackPointer(void ** sp_ptr, void * pthread_id) {
|
||||||
|
void *& sp = *sp_ptr;
|
||||||
|
pthread_attr_t pattr;
|
||||||
|
size_t osStackSize;
|
||||||
|
void * osStackLow;
|
||||||
|
void * osStackBase;
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
osStackSize = pthread_get_stacksize_np((pthread_t)pthread_id);
|
||||||
|
osStackLow = pthread_get_stackaddr_np((pthread_t)pthread_id);
|
||||||
|
#else
|
||||||
|
if (pthread_attr_init(&pattr)) {
|
||||||
|
throw Error("fixupBoehmStackPointer: pthread_attr_init failed");
|
||||||
|
}
|
||||||
|
if (pthread_getattr_np((pthread_t)pthread_id, &pattr)) {
|
||||||
|
throw Error("fixupBoehmStackPointer: pthread_getattr_np failed");
|
||||||
|
}
|
||||||
|
if (pthread_attr_getstack(&pattr, &osStackLow, &osStackSize)) {
|
||||||
|
throw Error("fixupBoehmStackPointer: pthread_attr_getstack failed");
|
||||||
|
}
|
||||||
|
if (pthread_attr_destroy(&pattr)) {
|
||||||
|
throw Error("fixupBoehmStackPointer: pthread_attr_destroy failed");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
osStackBase = (char *)osStackLow + osStackSize;
|
||||||
|
// NOTE: We assume the stack grows down, as it does on all architectures we support.
|
||||||
|
// Architectures that grow the stack up are rare.
|
||||||
|
if (sp >= osStackBase || sp < osStackLow) { // lo is outside the os stack
|
||||||
|
sp = osStackBase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -305,14 +351,23 @@ void initGC()
|
||||||
|
|
||||||
StackAllocator::defaultAllocator = &boehmGCStackAllocator;
|
StackAllocator::defaultAllocator = &boehmGCStackAllocator;
|
||||||
|
|
||||||
|
// TODO: Remove __APPLE__ condition.
|
||||||
|
// Comment suggests an implementation that works on darwin and windows
|
||||||
|
// https://github.com/ivmai/bdwgc/issues/362#issuecomment-1936672196
|
||||||
|
#if GC_VERSION_MAJOR >= 8 && GC_VERSION_MINOR >= 4 && !defined(__APPLE__)
|
||||||
|
GC_set_sp_corrector(&fixupBoehmStackPointer);
|
||||||
|
|
||||||
|
if (!GC_get_sp_corrector()) {
|
||||||
|
printTalkative("BoehmGC on this platform does not support sp_corrector; will disable GC inside coroutines");
|
||||||
|
/* Used to disable GC when entering coroutines on macOS */
|
||||||
|
create_coro_gc_hook = []() -> std::shared_ptr<void> {
|
||||||
|
return std::make_shared<BoehmDisableGC>();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#warning "BoehmGC version does not support GC while coroutine exists. GC will be disabled inside coroutines. Consider updating bwd-gc to 8.4 or later."
|
||||||
|
#endif
|
||||||
|
|
||||||
#if NIX_BOEHM_PATCH_VERSION != 1
|
|
||||||
printTalkative("Unpatched BoehmGC, disabling GC inside coroutines");
|
|
||||||
/* Used to disable GC when entering coroutines on macOS */
|
|
||||||
create_coro_gc_hook = []() -> std::shared_ptr<void> {
|
|
||||||
return std::make_shared<BoehmDisableGC>();
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set the initial heap size to something fairly big (25% of
|
/* Set the initial heap size to something fairly big (25% of
|
||||||
physical RAM, up to a maximum of 384 MiB) so that in most cases
|
physical RAM, up to a maximum of 384 MiB) so that in most cases
|
||||||
|
|
|
@ -15,7 +15,9 @@ libexpr_SOURCES := \
|
||||||
|
|
||||||
INCLUDE_libexpr := -I $(d)
|
INCLUDE_libexpr := -I $(d)
|
||||||
|
|
||||||
libexpr_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libstore) $(INCLUDE_libfetchers) $(INCLUDE_libmain) $(INCLUDE_libexpr)
|
libexpr_CXXFLAGS += \
|
||||||
|
$(INCLUDE_libutil) $(INCLUDE_libstore) $(INCLUDE_libfetchers) $(INCLUDE_libmain) $(INCLUDE_libexpr) \
|
||||||
|
-DGC_THREADS
|
||||||
|
|
||||||
libexpr_LIBS = libutil libstore libfetchers
|
libexpr_LIBS = libutil libstore libfetchers
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, nixpkgs, nixpkgsFor }:
|
{ lib, nixpkgs, nixpkgsFor, self }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -33,8 +33,30 @@ let
|
||||||
checkOverrideNixVersion = { pkgs, lib, ... }: {
|
checkOverrideNixVersion = { pkgs, lib, ... }: {
|
||||||
# pkgs.nix: The new Nix in this repo
|
# pkgs.nix: The new Nix in this repo
|
||||||
# We disallow it, to make sure we don't accidentally use it.
|
# We disallow it, to make sure we don't accidentally use it.
|
||||||
system.forbiddenDependenciesRegex = lib.strings.escapeRegex "nix-${pkgs.nix.version}";
|
system.forbiddenDependenciesRegexes = [
|
||||||
|
(lib.strings.escapeRegex "nix-${pkgs.nix.version}")
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
otherNixes.nix_2_3.setNixPackage = { lib, pkgs, ... }: {
|
||||||
|
imports = [ checkOverrideNixVersion ];
|
||||||
|
nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
|
||||||
|
};
|
||||||
|
|
||||||
|
otherNixes.nix_2_13.setNixPackage = { lib, pkgs, ... }: {
|
||||||
|
imports = [ checkOverrideNixVersion ];
|
||||||
|
nix.package = lib.mkForce (
|
||||||
|
self.inputs.nixpkgs-23-11.legacyPackages.${pkgs.stdenv.hostPlatform.system}.nixVersions.nix_2_13.overrideAttrs (o: {
|
||||||
|
meta = o.meta // { knownVulnerabilities = []; };
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
otherNixes.nix_2_18.setNixPackage = { lib, pkgs, ... }: {
|
||||||
|
imports = [ checkOverrideNixVersion ];
|
||||||
|
nix.package = lib.mkForce pkgs.nixVersions.nix_2_18;
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -42,100 +64,48 @@ in
|
||||||
|
|
||||||
remoteBuilds = runNixOSTestFor "x86_64-linux" ./remote-builds.nix;
|
remoteBuilds = runNixOSTestFor "x86_64-linux" ./remote-builds.nix;
|
||||||
|
|
||||||
# Test our Nix as a client against remotes that are older
|
|
||||||
|
|
||||||
remoteBuilds_remote_2_3 = runNixOSTestFor "x86_64-linux" {
|
|
||||||
name = "remoteBuilds_remote_2_3";
|
|
||||||
imports = [ ./remote-builds.nix ];
|
|
||||||
builders.config = { lib, pkgs, ... }: {
|
|
||||||
imports = [ checkOverrideNixVersion ];
|
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
remoteBuilds_remote_2_13 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
|
|
||||||
name = "remoteBuilds_remote_2_13";
|
|
||||||
imports = [ ./remote-builds.nix ];
|
|
||||||
builders.config = { lib, pkgs, ... }: {
|
|
||||||
imports = [ checkOverrideNixVersion ];
|
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
# TODO: (nixpkgs update) remoteBuilds_remote_2_18 = ...
|
|
||||||
|
|
||||||
# Test our Nix as a builder for clients that are older
|
|
||||||
|
|
||||||
remoteBuilds_local_2_3 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
|
|
||||||
name = "remoteBuilds_local_2_3";
|
|
||||||
imports = [ ./remote-builds.nix ];
|
|
||||||
nodes.client = { lib, pkgs, ... }: {
|
|
||||||
imports = [ checkOverrideNixVersion ];
|
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
remoteBuilds_local_2_13 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
|
|
||||||
name = "remoteBuilds_local_2_13";
|
|
||||||
imports = [ ./remote-builds.nix ];
|
|
||||||
nodes.client = { lib, pkgs, ... }: {
|
|
||||||
imports = [ checkOverrideNixVersion ];
|
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_13;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
# TODO: (nixpkgs update) remoteBuilds_local_2_18 = ...
|
|
||||||
|
|
||||||
# End remoteBuilds tests
|
|
||||||
|
|
||||||
remoteBuildsSshNg = runNixOSTestFor "x86_64-linux" ./remote-builds-ssh-ng.nix;
|
remoteBuildsSshNg = runNixOSTestFor "x86_64-linux" ./remote-builds-ssh-ng.nix;
|
||||||
|
|
||||||
# Test our Nix as a client against remotes that are older
|
}
|
||||||
|
// lib.concatMapAttrs (
|
||||||
remoteBuildsSshNg_remote_2_3 = runNixOSTestFor "x86_64-linux" {
|
nixVersion: { setNixPackage, ... }:
|
||||||
name = "remoteBuildsSshNg_remote_2_3";
|
{
|
||||||
imports = [ ./remote-builds-ssh-ng.nix ];
|
"remoteBuilds_remote_${nixVersion}" = runNixOSTestFor "x86_64-linux" {
|
||||||
builders.config = { lib, pkgs, ... }: {
|
name = "remoteBuilds_remote_${nixVersion}";
|
||||||
imports = [ checkOverrideNixVersion ];
|
imports = [ ./remote-builds.nix ];
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
|
builders.config = { lib, pkgs, ... }: {
|
||||||
|
imports = [ setNixPackage ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
remoteBuildsSshNg_remote_2_13 = runNixOSTestFor "x86_64-linux" {
|
"remoteBuilds_local_${nixVersion}" = runNixOSTestFor "x86_64-linux" {
|
||||||
name = "remoteBuildsSshNg_remote_2_13";
|
name = "remoteBuilds_local_${nixVersion}";
|
||||||
imports = [ ./remote-builds-ssh-ng.nix ];
|
imports = [ ./remote-builds.nix ];
|
||||||
builders.config = { lib, pkgs, ... }: {
|
nodes.client = { lib, pkgs, ... }: {
|
||||||
imports = [ checkOverrideNixVersion ];
|
imports = [ setNixPackage ];
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_13;
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: (nixpkgs update) remoteBuildsSshNg_remote_2_18 = ...
|
"remoteBuildsSshNg_remote_${nixVersion}" = runNixOSTestFor "x86_64-linux" {
|
||||||
|
name = "remoteBuildsSshNg_remote_${nixVersion}";
|
||||||
# Test our Nix as a builder for clients that are older
|
imports = [ ./remote-builds-ssh-ng.nix ];
|
||||||
|
builders.config = { lib, pkgs, ... }: {
|
||||||
# FIXME: these tests don't work yet
|
imports = [ setNixPackage ];
|
||||||
/*
|
};
|
||||||
remoteBuildsSshNg_local_2_3 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
|
|
||||||
name = "remoteBuildsSshNg_local_2_3";
|
|
||||||
imports = [ ./remote-builds-ssh-ng.nix ];
|
|
||||||
nodes.client = { lib, pkgs, ... }: {
|
|
||||||
imports = [ checkOverrideNixVersion ];
|
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_3;
|
|
||||||
};
|
};
|
||||||
});
|
|
||||||
|
|
||||||
remoteBuildsSshNg_local_2_13 = runNixOSTestFor "x86_64-linux" ({ lib, pkgs, ... }: {
|
# FIXME: these tests don't work yet
|
||||||
name = "remoteBuildsSshNg_local_2_13";
|
|
||||||
imports = [ ./remote-builds-ssh-ng.nix ];
|
|
||||||
nodes.client = { lib, pkgs, ... }: {
|
|
||||||
imports = [ checkOverrideNixVersion ];
|
|
||||||
nix.package = lib.mkForce pkgs.nixVersions.nix_2_13;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
# TODO: (nixpkgs update) remoteBuildsSshNg_local_2_18 = ...
|
# "remoteBuildsSshNg_local_${nixVersion}" = runNixOSTestFor "x86_64-linux" {
|
||||||
*/
|
# name = "remoteBuildsSshNg_local_${nixVersion}";
|
||||||
|
# imports = [ ./remote-builds-ssh-ng.nix ];
|
||||||
|
# nodes.client = { lib, pkgs, ... }: {
|
||||||
|
# imports = [ overridingModule ];
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
}
|
||||||
|
) otherNixes
|
||||||
|
// {
|
||||||
|
|
||||||
nix-copy-closure = runNixOSTestFor "x86_64-linux" ./nix-copy-closure.nix;
|
nix-copy-closure = runNixOSTestFor "x86_64-linux" ./nix-copy-closure.nix;
|
||||||
|
|
||||||
|
@ -154,7 +124,7 @@ in
|
||||||
containers = runNixOSTestFor "x86_64-linux" ./containers/containers.nix;
|
containers = runNixOSTestFor "x86_64-linux" ./containers/containers.nix;
|
||||||
|
|
||||||
setuid = lib.genAttrs
|
setuid = lib.genAttrs
|
||||||
["i686-linux" "x86_64-linux"]
|
["x86_64-linux"]
|
||||||
(system: runNixOSTestFor system ./setuid.nix);
|
(system: runNixOSTestFor system ./setuid.nix);
|
||||||
|
|
||||||
fetch-git = runNixOSTestFor "x86_64-linux" ./fetch-git;
|
fetch-git = runNixOSTestFor "x86_64-linux" ./fetch-git;
|
||||||
|
|
|
@ -21,29 +21,29 @@ class StoreReferenceTest : public CharacterizationTest, public LibStoreTest
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define URI_TEST_READ(STEM, OBJ) \
|
#define URI_TEST_READ(STEM, OBJ) \
|
||||||
TEST_F(StoreReferenceTest, PathInfo_##STEM##_from_uri) \
|
TEST_F(StoreReferenceTest, PathInfo_##STEM##_from_uri) \
|
||||||
{ \
|
{ \
|
||||||
readTest(#STEM, ([&](const auto & encoded) { \
|
readTest(#STEM, ([&](const auto & encoded) { \
|
||||||
StoreReference expected = OBJ; \
|
StoreReference expected = OBJ; \
|
||||||
auto got = StoreReference::parse(encoded); \
|
auto got = StoreReference::parse(encoded); \
|
||||||
ASSERT_EQ(got, expected); \
|
ASSERT_EQ(got, expected); \
|
||||||
})); \
|
})); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define URI_TEST_WRITE(STEM, OBJ) \
|
#define URI_TEST_WRITE(STEM, OBJ) \
|
||||||
TEST_F(StoreReferenceTest, PathInfo_##STEM##_to_uri) \
|
TEST_F(StoreReferenceTest, PathInfo_##STEM##_to_uri) \
|
||||||
{ \
|
{ \
|
||||||
writeTest( \
|
writeTest( \
|
||||||
#STEM, \
|
#STEM, \
|
||||||
[&]() -> StoreReference { return OBJ; }, \
|
[&]() -> StoreReference { return OBJ; }, \
|
||||||
[](const auto & file) { return StoreReference::parse(readFile(file)); }, \
|
[](const auto & file) { return StoreReference::parse(readFile(file)); }, \
|
||||||
[](const auto & file, const auto & got) { return writeFile(file, got.render()); }); \
|
[](const auto & file, const auto & got) { return writeFile(file, got.render()); }); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define URI_TEST(STEM, OBJ) \
|
#define URI_TEST(STEM, OBJ) \
|
||||||
URI_TEST_READ(STEM, OBJ) \
|
URI_TEST_READ(STEM, OBJ) \
|
||||||
URI_TEST_WRITE(STEM, OBJ)
|
URI_TEST_WRITE(STEM, OBJ)
|
||||||
|
|
||||||
URI_TEST(
|
URI_TEST(
|
||||||
auto,
|
auto,
|
||||||
|
|
|
@ -11,6 +11,6 @@ inline void * observe_string_cb_data(std::string & out)
|
||||||
};
|
};
|
||||||
|
|
||||||
#define OBSERVE_STRING(str) \
|
#define OBSERVE_STRING(str) \
|
||||||
(nix_get_string_callback) nix::testing::observe_string_cb, nix::testing::observe_string_cb_data(str)
|
(nix_get_string_callback) nix::testing::observe_string_cb, nix::testing::observe_string_cb_data(str)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue