Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkgs/by-name/aw/aws-sdk-cpp/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
apis ? [ "*" ],
# Whether to enable AWS' custom memory management.
customMemoryManagement ? true,
# Builds in 2+h with 2 cores, and ~10m with a big-parallel builder.
requiredSystemFeatures ? [ "big-parallel" ],
}:

let
Expand Down Expand Up @@ -116,8 +118,7 @@ stdenv.mkDerivation rec {

__darwinAllowLocalNetworking = true;

# Builds in 2+h with 2 cores, and ~10m with a big-parallel builder.
requiredSystemFeatures = [ "big-parallel" ];
inherit requiredSystemFeatures;

passthru = {
tests = {
Expand Down
53 changes: 38 additions & 15 deletions pkgs/by-name/bo/boehmgc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
stdenv,
fetchFromGitHub,
autoreconfHook,
# doc: https://github.com/ivmai/bdwgc/blob/v8.2.8/doc/README.macros (LARGE_CONFIG)
# doc: https://github.com/bdwgc/bdwgc/blob/v8.2.8/doc/README.macros (LARGE_CONFIG)
enableLargeConfig ? false,
enableMmap ? true,
enableStatic ? false,
# Allows derivation users to increase the initial mark stack size to avoid stack overflows,
# since these inhibit parallel marking (see `GC_mark_some()` in `mark.c`.)
#
# Run Nix with the `GC_PRINT_STATS=1` environment set to check if the mark stack is too small.
# Look for messages such as `Mark stack overflow`, `No room to copy back mark stack`, and
# `Grew mark stack to ... frames`.
#
# If this parameter is set to `null`, the default from upstream is used, which is 4096 as of 8.2.8
initialMarkStackSize ? null,
nixVersions,
}:

Expand All @@ -15,7 +24,7 @@ stdenv.mkDerivation (finalAttrs: {
version = "8.2.8";

src = fetchFromGitHub {
owner = "ivmai";
owner = "bdwgc";
repo = "bdwgc";
rev = "v${finalAttrs.version}";
hash = "sha256-UQSLK/05uPal6/m+HMz0QwXVII1leonlmtSZsXjJ+/c=";
Expand All @@ -40,18 +49,32 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional enableMmap "--enable-mmap"
++ lib.optional enableLargeConfig "--enable-large-config";

# This stanza can be dropped when a release fixes this issue:
# https://github.com/ivmai/bdwgc/issues/376
# The version is checked with == instead of versionAtLeast so we
# don't forget to disable the fix (and if the next release does
# not fix the problem the test failure will be a reminder to
# extend the set of versions requiring the workaround).
makeFlags = lib.optionals (stdenv.hostPlatform.isPower64 && finalAttrs.version == "8.2.8") [
# do not use /proc primitives to track dirty bits; see:
# https://github.com/ivmai/bdwgc/issues/479#issuecomment-1279687537
# https://github.com/ivmai/bdwgc/blob/54522af853de28f45195044dadfd795c4e5942aa/include/private/gcconfig.h#L741
"CFLAGS_EXTRA=-DNO_SOFT_VDB"
];
makeFlags =
let
defineFlag = flag: "-D${flag}";

# This stanza can be dropped when a release fixes this issue:
# https://github.com/bdwgc/bdwgc/issues/376
# The version is checked with == instead of versionAtLeast so we
# don't forget to disable the fix (and if the next release does
# not fix the problem the test failure will be a reminder to
# extend the set of versions requiring the workaround).
noSoftVDB = lib.optional (stdenv.hostPlatform.isPower64 && finalAttrs.version == "8.2.8") (
# do not use /proc primitives to track dirty bits; see:
# https://github.com/bdwgc/bdwgc/issues/479#issuecomment-1279687537
# https://github.com/bdwgc/bdwgc/blob/54522af853de28f45195044dadfd795c4e5942aa/include/private/gcconfig.h#L741
"NO_SOFT_VDB"
);

initialMarkStackSizeFlag = lib.optionals (initialMarkStackSize != null) [
"INITIAL_MARK_STACK_SIZE=${toString initialMarkStackSize}"
];

cflagsExtra = noSoftVDB ++ initialMarkStackSizeFlag;
in
lib.optionals (cflagsExtra != [ ]) [
"CFLAGS_EXTRA=${lib.concatMapStringsSep " " defineFlag cflagsExtra}"
];

# OpenBSD patches lld (!!!!) to inject this symbol into every linker invocation.
# We are obviously not doing that.
Expand Down Expand Up @@ -91,7 +114,7 @@ stdenv.mkDerivation (finalAttrs: {
Alternatively, the garbage collector may be used as a leak detector for
C or C++ programs, though that is not its primary goal.
'';
changelog = "https://github.com/ivmai/bdwgc/blob/v${finalAttrs.version}/ChangeLog";
changelog = "https://github.com/bdwgc/bdwgc/blob/v${finalAttrs.version}/ChangeLog";
license = "https://hboehm.info/gc/license.txt"; # non-copyleft, X11-style license
maintainers = with lib.maintainers; [ ];
platforms = lib.platforms.all;
Expand Down
51 changes: 25 additions & 26 deletions pkgs/tools/package-management/nix/dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,31 @@ regular@{

{
scopeFunction = scope: {
boehmgc =
(regular.boehmgc.override {
enableLargeConfig = true;
}).overrideAttrs
(attrs: {
# Increase the initial mark stack size to avoid stack
# overflows, since these inhibit parallel marking (see
# GC_mark_some()). To check whether the mark stack is too
# small, run Nix with GC_PRINT_STATS=1 and look for messages
# such as `Mark stack overflow`, `No room to copy back mark
# stack`, and `Grew mark stack to ... frames`.
NIX_CFLAGS_COMPILE = "-DINITIAL_MARK_STACK_SIZE=1048576";
});
boehmgc = regular.boehmgc.override {
enableLargeConfig = true;

aws-sdk-cpp =
(regular.aws-sdk-cpp.override {
apis = [
"identity-management"
"s3"
"transfer"
];
customMemoryManagement = false;
}).overrideAttrs
{
# only a stripped down version is build which takes a lot less resources to build
requiredSystemFeatures = [ ];
};
# Increase the initial mark stack size to avoid stack overflows, since these inhibit parallel
# marking (see `GC_mark_some()` in `mark.c`).
#
# Run Nix with `GC_PRINT_STATS=1` set to see if the mark stack is too small.
# Look for messages such as `Mark stack overflow`, `No room to copy back mark stack`, and
# `Grew mark stack to ... frames`.
initialMarkStackSize = 1048576;
};

aws-sdk-cpp = regular.aws-sdk-cpp.override {
# Nix only needs these AWS APIs.
apis = [
"identity-management"
"s3"
"transfer"
];

# Don't use AWS' custom memory management.
customMemoryManagement = false;

# only a stripped down version is built which takes a lot less resources to build
requiredSystemFeatures = [ ];
};
};
}
Loading