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
2 changes: 0 additions & 2 deletions pkgs/applications/networking/ids/zeek/broker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ stdenv.mkDerivation rec {
"-DPY_MOD_INSTALL_DIR=${placeholder "py"}/${python3.sitePackages}/"
];

env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";

meta = with lib; {
description = "Zeek's Messaging Library";
mainProgram = "broker-benchmark";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/applications/networking/ids/zeek/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ stdenv.mkDerivation rec {
"-DLIBKQUEUE_ROOT_DIR=${libkqueue}"
];

env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";

postInstall = ''
for file in $out/share/zeek/base/frameworks/notice/actions/pp-alarms.zeek $out/share/zeek/base/frameworks/notice/main.zeek; do
substituteInPlace $file \
Expand Down
2 changes: 0 additions & 2 deletions pkgs/by-name/ca/caf/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ stdenv.mkDerivation rec {
"-DCAF_ENABLE_EXAMPLES:BOOL=OFF"
];

env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";

doCheck = !stdenv.hostPlatform.isDarwin;
checkTarget = "test";

Expand Down
5 changes: 0 additions & 5 deletions pkgs/by-name/ci/cinny-unwrapped/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ buildNpmPackage rec {

npmDepsHash = "sha256-fDoia6evCmXZgeIKL0coRo3yunX1dfud31ROgmop2Sc=";

# Fix error: no member named 'aligned_alloc' in the global namespace
env.NIX_CFLAGS_COMPILE = lib.optionalString (
stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11.0"
) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";

nativeBuildInputs = [
python3
pkg-config
Expand Down
4 changes: 0 additions & 4 deletions pkgs/by-name/lu/luaformatter/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ stdenv.mkDerivation rec {
yaml-cpp
];

env.NIX_CFLAGS_COMPILE = lib.optionalString (
stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64
) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";

meta = with lib; {
description = "Code formatter for Lua";
homepage = "https://github.com/Koihik/LuaFormatter";
Expand Down
3 changes: 0 additions & 3 deletions pkgs/by-name/ma/matrix-authentication-service/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,5 @@ rustPlatform.buildRustPackage rec {
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ teutat3s ];
mainProgram = "mas-cli";
# Note: broken on x86_64-darwin because of aligned_alloc, can be revisited after
# https://github.com/NixOS/nixpkgs/pull/346043 is merged
badPlatforms = [ "x86_64-darwin" ];
};
}
4 changes: 0 additions & 4 deletions pkgs/by-name/mo/mold/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ stdenv.mkDerivation rec {
"-DMOLD_USE_SYSTEM_TBB:BOOL=ON"
];

env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.hostPlatform.isDarwin [
"-faligned-allocation"
]);

passthru = {
updateScript = nix-update-script { };
tests =
Expand Down
12 changes: 4 additions & 8 deletions pkgs/by-name/na/naja/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,10 @@ stdenv.mkDerivation {
tbb_2021_11
];

cmakeFlags =
[
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_LIBDWARF" true)
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_ZSTD" true)
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.cmakeFeature "CMAKE_OSX_DEPLOYMENT_TARGET" "10.14") # For aligned allocation
];
cmakeFlags = [
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_LIBDWARF" true)
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_ZSTD" true)
];

doCheck = true;

Expand Down
8 changes: 0 additions & 8 deletions pkgs/by-name/p2/p2pool/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ stdenv.mkDerivation rec {

cmakeFlags = [ "-DWITH_LTO=OFF" ];

env.NIX_CFLAGS_COMPILE = toString (
lib.optionals
(stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13")
[
"-faligned-allocation"
]
);

installPhase = ''
runHook preInstall

Expand Down
9 changes: 2 additions & 7 deletions pkgs/by-name/re/renovate/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
yq-go,
}:

let
# fix build error, `no member named 'aligned_alloc'` on x86_64-darwin
# https://github.com/NixOS/nixpkgs/issues/272156#issuecomment-1839904283
stdenv' = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv;
in
stdenv'.mkDerivation (finalAttrs: {
stdenv.mkDerivation (finalAttrs: {
pname = "renovate";
version = "39.90.2";

Expand All @@ -41,7 +36,7 @@ stdenv'.mkDerivation (finalAttrs: {
pnpm_9.configHook
python3
yq-go
] ++ lib.optional stdenv'.hostPlatform.isDarwin xcbuild;
] ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild;

pnpmDeps = pnpm_9.fetchDeps {
inherit (finalAttrs) pname version src;
Expand Down
6 changes: 0 additions & 6 deletions pkgs/by-name/ro/rocksdb/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ stdenv.mkDerivation (finalAttrs: {
"tools"
];

env.NIX_CFLAGS_COMPILE = toString (
lib.optionals stdenv.cc.isClang [
"-faligned-allocation"
]
);

cmakeFlags = [
"-DPORTABLE=1"
"-DWITH_JEMALLOC=${if enableJemalloc then "1" else "0"}"
Expand Down
5 changes: 0 additions & 5 deletions pkgs/by-name/ro/root/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ stdenv.mkDerivation rec {
}"
'';

# error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
env.CXXFLAGS = lib.optionalString (
stdenv.hostPlatform.system == "x86_64-darwin"
) "-faligned-allocation";

# workaround for
# https://github.com/root-project/root/issues/14778
env.NIX_LDFLAGS = lib.optionalString (
Expand Down
2 changes: 0 additions & 2 deletions pkgs/by-name/so/sonic-server/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ rustPlatform.buildRustPackage rec {
rustPlatform.bindgenHook
];

env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";

postPatch = ''
substituteInPlace src/main.rs \
--replace-fail "./config.cfg" "$out/etc/sonic/config.cfg"
Expand Down
2 changes: 0 additions & 2 deletions pkgs/by-name/sp/spades/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ stdenv.mkDerivation (finalAttrs: {
readline
];

env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";

doCheck = true;

strictDeps = true;
Expand Down
3 changes: 0 additions & 3 deletions pkgs/by-name/tr/tracy/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ stdenv.mkDerivation rec {
env.NIX_CFLAGS_COMPILE = toString (
[ ]
++ lib.optional stdenv.hostPlatform.isLinux "-ltbb"
++ lib.optional (
stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13"
) "-fno-aligned-allocation"
# Workaround for https://github.com/NixOS/nixpkgs/issues/19098
++ lib.optional (stdenv.cc.isClang && stdenv.hostPlatform.isDarwin) "-fno-lto"
);
Expand Down
8 changes: 0 additions & 8 deletions pkgs/by-name/ue/ueberzugpp/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ stdenv.mkDerivation rec {
"-DENABLE_X11=OFF"
];

# error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.14 or newer
preBuild =
lib.optionalString
(stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0")
''
export MACOSX_DEPLOYMENT_TARGET=10.14
'';

meta = with lib; {
description = "Drop in replacement for ueberzug written in C++";
homepage = "https://github.com/jstkdng/ueberzugpp";
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/compilers/clasp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ stdenv.mkDerivation rec {
"x86_64-linux"
"x86_64-darwin"
];
# Upstream claims support, but breaks with:
# error: use of undeclared identifier 'aligned_alloc'
broken = stdenv.hostPlatform.isDarwin;
homepage = "https://github.com/clasp-developers/clasp";
mainProgram = "clasp";
};
Expand Down
32 changes: 8 additions & 24 deletions pkgs/development/compilers/halide/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,14 @@ stdenv.mkDerivation rec {
hash = "sha256-BPalUh9EgdCqVaWC1HoreyyRcPQc4QMIYnLrRoNDDCI=";
};

postPatch =
''
# See https://github.com/halide/Halide/issues/7785
substituteInPlace 'src/runtime/HalideRuntime.h' \
--replace '#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
#define HALIDE_CPP_COMPILER_HAS_FLOAT16' \
'#if defined(__x86_64__) || defined(__i386__)
#define HALIDE_CPP_COMPILER_HAS_FLOAT16'
''
# Note: on x86_64-darwin, clang fails to find AvailabilityVersions.h, so we remove it.
# Halide uses AvailabilityVersions.h and TargetConditionals.h to determine whether
# ::aligned_alloc is available. For us, it isn't.
+ lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
substituteInPlace 'src/runtime/HalideBuffer.h' \
--replace '#ifdef __APPLE__
#include <AvailabilityVersions.h>
#include <TargetConditionals.h>
#endif' \
' ' \
--replace 'TARGET_OS_OSX && (__MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_15)' \
'1' \
--replace 'TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_14_0)' \
'0'
'';
postPatch = ''
# See https://github.com/halide/Halide/issues/7785
substituteInPlace 'src/runtime/HalideRuntime.h' \
--replace '#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
#define HALIDE_CPP_COMPILER_HAS_FLOAT16' \
'#if defined(__x86_64__) || defined(__i386__)
#define HALIDE_CPP_COMPILER_HAS_FLOAT16'
'';

cmakeFlags = [
"-DWARNINGS_AS_ERRORS=OFF"
Expand Down
13 changes: 3 additions & 10 deletions pkgs/development/libraries/libfive/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,9 @@ stdenv.mkDerivation {
export XDG_CACHE_HOME=$(mktemp -d)/.cache
'';

cmakeFlags =
[
"-DGUILE_CCACHE_DIR=${placeholder "out"}/${guile.siteCcacheDir}"
]
++ lib.optionals
(stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11")
[
# warning: 'aligned_alloc' is only available on macOS 10.15 or newer
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15"
];
cmakeFlags = [
"-DGUILE_CCACHE_DIR=${placeholder "out"}/${guile.siteCcacheDir}"
];

env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=enum-constexpr-conversion";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/libraries/lief/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ stdenv.mkDerivation rec {
scikit-build-core
];

env.CXXFLAGS = toString (lib.optional stdenv.hostPlatform.isDarwin [ "-faligned-allocation" "-fno-aligned-new" "-fvisibility=hidden" ]);

postBuild = ''
pushd ../api/python
${pyEnv.interpreter} -m build --no-isolation --wheel --skip-dependency-check --config-setting=--parallel=$NIX_BUILD_CORES
Expand Down
12 changes: 0 additions & 12 deletions pkgs/development/libraries/openvdb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ stdenv.mkDerivation rec {
"-DOPENVDB_BUILD_NANOVDB=ON"
];

# error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on macOS 10.13 or newer
env =
lib.optionalAttrs
(
stdenv.hostPlatform.isDarwin
&& lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13"
&& lib.versionAtLeast tbb.version "2021.8.0"
)
{
NIX_CFLAGS_COMPILE = "-faligned-allocation";
};

postFixup = ''
substituteInPlace $dev/lib/cmake/OpenVDB/FindOpenVDB.cmake \
--replace \''${OPENVDB_LIBRARYDIR} $out/lib \
Expand Down
14 changes: 0 additions & 14 deletions pkgs/development/ocaml-modules/hacl-star/aligned-alloc.patch

This file was deleted.

4 changes: 0 additions & 4 deletions pkgs/development/ocaml-modules/hacl-star/raw.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ stdenv.mkDerivation rec {
stripRoot = false;
};

patches = [
./aligned-alloc.patch
];

# strictoverflow is disabled because it breaks aarch64-darwin
hardeningDisable = [ "strictoverflow" ];

Expand Down
12 changes: 1 addition & 11 deletions pkgs/development/python-modules/torch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,7 @@ buildPythonPackage rec {
# until https://github.com/pytorch/pytorch/issues/76082 is addressed
+ lib.optionalString cudaSupport ''
rm cmake/Modules/FindCUDAToolkit.cmake
''
# error: no member named 'aligned_alloc' in the global namespace; did you mean simply 'aligned_alloc'
# This lib overrided aligned_alloc hence the error message. Tltr: his function is linkable but not in header.
+
lib.optionalString
(stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11.0")
''
substituteInPlace third_party/pocketfft/pocketfft_hdronly.h --replace-fail '#if (__cplusplus >= 201703L) && (!defined(__MINGW32__)) && (!defined(_MSC_VER))
inline void *aligned_alloc(size_t align, size_t size)' '#if 0
inline void *aligned_alloc(size_t align, size_t size)'
'';
'';

# NOTE(@connorbaker): Though we do not disable Gloo or MPI when building with CUDA support, caution should be taken
# when using the different backends. Gloo's GPU support isn't great, and MPI and CUDA can't be used at the same time
Expand Down
6 changes: 0 additions & 6 deletions pkgs/servers/mail/mailpit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ let
hash = source.npmDepsHash;
};

env = lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
# Make sure libc++ uses `posix_memalign` instead of `aligned_alloc` on x86_64-darwin.
# Otherwise, nodejs would require the 11.0 SDK and macOS 10.15+.
NIX_CFLAGS_COMPILE = "-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=101300";
};

nativeBuildInputs = [
nodejs
python3
Expand Down
12 changes: 3 additions & 9 deletions pkgs/servers/monitoring/grafana/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,9 @@ buildGoModule rec {
};

# borrowed from: https://github.com/NixOS/nixpkgs/blob/d70d9425f49f9aba3c49e2c389fe6d42bac8c5b0/pkgs/development/tools/analysis/snyk/default.nix#L20-L22
env =
{
CYPRESS_INSTALL_BINARY = 0;
}
// lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
# Fix error: no member named 'aligned_alloc' in the global namespace.
# Occurs while building @esfx/equatable@npm:1.0.2 on x86_64-darwin
NIX_CFLAGS_COMPILE = "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";
};
env = {
CYPRESS_INSTALL_BINARY = 0;
};

offlineCache = stdenv.mkDerivation {
name = "${pname}-${version}-yarn-offline-cache";
Expand Down
12 changes: 4 additions & 8 deletions pkgs/servers/search/qdrant/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,10 @@ rustPlatform.buildRustPackage rec {
pkg-config
];

env =
{
# Needed to get openssl-sys to use pkg-config.
OPENSSL_NO_VENDOR = 1;
}
// lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-faligned-allocation";
};
env = {
# Needed to get openssl-sys to use pkg-config.
OPENSSL_NO_VENDOR = 1;
};

passthru = {
updateScript = nix-update-script { };
Expand Down
3 changes: 0 additions & 3 deletions pkgs/servers/sql/postgresql/ext/lantern.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,5 @@ buildPostgresqlExtension (finalAttrs: {
license = licenses.agpl3Only;
maintainers = [ ];
platforms = postgresql.meta.platforms;
# error: use of undeclared identifier 'aligned_alloc'
broken =
stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13";
};
})
Loading