From 8a5d6f57a0a3e95aadae5816a6922052f31d49a8 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Fri, 6 Dec 2024 05:48:34 +0000 Subject: [PATCH 1/7] libbladeRF: gcc-14 fixes fix build for gcc-14 > host/utilities/bladeRF-fsk/c/src/fir_filter.c:227:28: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument 227 | outbuf = calloc(sizeof(struct complex_sample), chunk_size); https://cache.nixos.org/log/hsg1v3cl1hk9ca77rgkng6n6dabz1bi3-libbladeRF-2.5.0.drv --- .../li/libbladeRF/gcc-14-calloc-fixes.diff | 26 +++++++++++++++++++ pkgs/by-name/li/libbladeRF/package.nix | 5 ++++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/by-name/li/libbladeRF/gcc-14-calloc-fixes.diff diff --git a/pkgs/by-name/li/libbladeRF/gcc-14-calloc-fixes.diff b/pkgs/by-name/li/libbladeRF/gcc-14-calloc-fixes.diff new file mode 100644 index 000000000000..ae11b26073b6 --- /dev/null +++ b/pkgs/by-name/li/libbladeRF/gcc-14-calloc-fixes.diff @@ -0,0 +1,26 @@ +diff --git a/host/utilities/bladeRF-fsk/c/src/fir_filter.c b/host/utilities/bladeRF-fsk/c/src/fir_filter.c +index 59f34f0..7def697 100644 +--- a/host/utilities/bladeRF-fsk/c/src/fir_filter.c ++++ b/host/utilities/bladeRF-fsk/c/src/fir_filter.c +@@ -213,18 +213,18 @@ int main(int argc, char *argv[]) + return EXIT_FAILURE; + } + +- inbuf = calloc(2*sizeof(int16_t), chunk_size); ++ inbuf = calloc(chunk_size, 2*sizeof(int16_t)); + if (!inbuf) { + perror("calloc"); + goto out; + } +- tempbuf = calloc(2*sizeof(int16_t), chunk_size); ++ tempbuf = calloc(chunk_size, 2*sizeof(int16_t)); + if (!tempbuf) { + perror("calloc"); + goto out; + } + +- outbuf = calloc(sizeof(struct complex_sample), chunk_size); ++ outbuf = calloc(chunk_size, sizeof(struct complex_sample)); + if (!outbuf) { + perror("calloc"); + goto out; diff --git a/pkgs/by-name/li/libbladeRF/package.nix b/pkgs/by-name/li/libbladeRF/package.nix index 77e72d22db6c..4c05f76d1351 100644 --- a/pkgs/by-name/li/libbladeRF/package.nix +++ b/pkgs/by-name/li/libbladeRF/package.nix @@ -13,6 +13,11 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ + # https://github.com/Nuand/bladeRF/issues/994 + ./gcc-14-calloc-fixes.diff + ]; + nativeBuildInputs = [ cmake pkg-config git doxygen help2man ]; # ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208 buildInputs = [ tecla libusb1 ] From 22924b6cbd7813ff722ee7a8a73f90e30c345606 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 29 Nov 2024 10:57:04 +0100 Subject: [PATCH 2/7] protobuf: add versionCheckHook --- pkgs/development/libraries/protobuf/generic.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index 447202dff539..89d86bd2b20d 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -13,6 +13,7 @@ zlib, version, hash, + versionCheckHook, # downstream dependencies python3, @@ -31,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "protocolbuffers"; repo = "protobuf"; - rev = "refs/tags/v${version}"; + tag = "v${version}"; inherit hash; }; @@ -94,6 +95,13 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/protocolbuffers/protobuf/issues/8460 && !stdenv.hostPlatform.is32bit; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = [ "${placeholder "out"}/bin/protoc" ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + passthru = { tests = { pythonProtobuf = python3.pkgs.protobuf; From 7d7d58bd3e304cd3c3d895c87c964efef9ef8447 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 29 Nov 2024 11:04:38 +0100 Subject: [PATCH 3/7] protobuf: enable tests on darwin --- pkgs/development/libraries/protobuf/generic.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index 89d86bd2b20d..f8cfa4daff03 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -85,15 +85,11 @@ stdenv.mkDerivation (finalAttrs: { ]; doCheck = - # FIXME: investigate. 24.x and 23.x have different errors. - # At least some of it is not reproduced on some other machine; example: - # https://hydra.nixos.org/build/235677717/nixlog/4/tail - !(stdenv.hostPlatform.isDarwin && lib.versionAtLeast version "23") # Tests fail to build on 32-bit platforms; fixed in 22.x # https://github.com/protocolbuffers/protobuf/issues/10418 # Also AnyTest.TestPackFromSerializationExceedsSizeLimit fails on 32-bit platforms # https://github.com/protocolbuffers/protobuf/issues/8460 - && !stdenv.hostPlatform.is32bit; + !stdenv.hostPlatform.is32bit; nativeInstallCheckInputs = [ versionCheckHook From cf417151b9e9607e47ab750b51aa8fbbdef00c53 Mon Sep 17 00:00:00 2001 From: misilelab Date: Thu, 5 Dec 2024 09:13:02 +0900 Subject: [PATCH 4/7] uv: 0.5.5 -> 0.5.6 Signed-off-by: misilelab --- pkgs/by-name/uv/uv/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/uv/uv/package.nix b/pkgs/by-name/uv/uv/package.nix index 3abe878f2afd..74a9f1298ff8 100644 --- a/pkgs/by-name/uv/uv/package.nix +++ b/pkgs/by-name/uv/uv/package.nix @@ -13,17 +13,17 @@ rustPlatform.buildRustPackage rec { pname = "uv"; - version = "0.5.5"; + version = "0.5.6"; src = fetchFromGitHub { owner = "astral-sh"; repo = "uv"; - rev = "refs/tags/${version}"; - hash = "sha256-E0U6K+lvtIM9htpMpFN36JHA772LgTHaTCVGiTTlvQk="; + tag = version; + hash = "sha256-iiIbSya+SUM7Xk+lV7h7Zyb1WMvc1IAHxCAylWmKaKU="; }; useFetchCargoVendor = true; - cargoHash = "sha256-WbA0/HojU/E2ccAvV2sv9EAXLqcb+99LFHxddcYFZFw="; + cargoHash = "sha256-xrUjHJ8VDGNwN4xfOqqaRRUTEhRh2Jnckj7ynILigpc="; nativeBuildInputs = [ cmake @@ -63,7 +63,7 @@ rustPlatform.buildRustPackage rec { meta = { description = "Extremely fast Python package installer and resolver, written in Rust"; homepage = "https://github.com/astral-sh/uv"; - changelog = "https://github.com/astral-sh/uv/blob/${src.rev}/CHANGELOG.md"; + changelog = "https://github.com/astral-sh/uv/blob/${version}/CHANGELOG.md"; license = with lib.licenses; [ asl20 mit From 2a3534c45b9266acd342268b038cc7705816f607 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 6 Dec 2024 10:28:33 +0100 Subject: [PATCH 5/7] abseil-cpp_202[301,401]: fix build on aarch64_darwin https://github.com/abseil/abseil-cpp/pull/1707 --- pkgs/development/libraries/abseil-cpp/202301.nix | 11 ++++++++++- pkgs/development/libraries/abseil-cpp/202401.nix | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/abseil-cpp/202301.nix b/pkgs/development/libraries/abseil-cpp/202301.nix index 0280a183e869..897bd3854ac2 100644 --- a/pkgs/development/libraries/abseil-cpp/202301.nix +++ b/pkgs/development/libraries/abseil-cpp/202301.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , cmake , gtest , static ? stdenv.hostPlatform.isStatic @@ -18,7 +19,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-7C/QIXYRyUyNVVE0tqmv8b5g/uWc58iBI5jzdtddQ+U="; }; - patches = lib.optionals stdenv.hostPlatform.isDarwin [ + patches = [ + # Fixes: clang++: error: unsupported option '-msse4.1' for target 'aarch64-apple-darwin' + # https://github.com/abseil/abseil-cpp/pull/1707 + (fetchpatch { + name = "fix-compile-breakage-on-darwin"; + url = "https://github.com/abseil/abseil-cpp/commit/6dee153242d7becebe026a9bed52f4114441719d.patch"; + hash = "sha256-r6QnHPnwPwOE/hv4kLNA3FqNq2vU/QGmwAc5q0/q1cs="; + }) + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages # that require a different SDK other than the default one. ./cmake-core-foundation.patch diff --git a/pkgs/development/libraries/abseil-cpp/202401.nix b/pkgs/development/libraries/abseil-cpp/202401.nix index ad5417d6eb62..7a9d1eb836e3 100644 --- a/pkgs/development/libraries/abseil-cpp/202401.nix +++ b/pkgs/development/libraries/abseil-cpp/202401.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , cmake , gtest , static ? stdenv.hostPlatform.isStatic @@ -18,6 +19,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-eA2/dZpNOlex1O5PNa3XSZhpMB3AmaIoHzVDI9TD/cg="; }; + patches = [ + # Fixes: clang++: error: unsupported option '-msse4.1' for target 'aarch64-apple-darwin' + # https://github.com/abseil/abseil-cpp/pull/1707 + (fetchpatch { + name = "fix-compile-breakage-on-darwin"; + url = "https://github.com/abseil/abseil-cpp/commit/6dee153242d7becebe026a9bed52f4114441719d.patch"; + hash = "sha256-r6QnHPnwPwOE/hv4kLNA3FqNq2vU/QGmwAc5q0/q1cs="; + }) + ]; + cmakeFlags = [ "-DABSL_BUILD_TEST_HELPERS=ON" "-DABSL_USE_EXTERNAL_GOOGLETEST=ON" From a41bf37c496e4482d3dd364c64ee04064642569c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 5 Dec 2024 14:35:32 +0100 Subject: [PATCH 6/7] ruff: 0.8.1 -> 0.8.2 Diff: https://github.com/astral-sh/ruff/compare/refs/tags/0.8.1...0.8.2 Changelog: https://github.com/astral-sh/ruff/releases/tag/0.8.2 --- pkgs/by-name/ru/ruff/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ru/ruff/package.nix b/pkgs/by-name/ru/ruff/package.nix index 6fd163a518cd..df10f15fff71 100644 --- a/pkgs/by-name/ru/ruff/package.nix +++ b/pkgs/by-name/ru/ruff/package.nix @@ -16,7 +16,7 @@ python3Packages.buildPythonPackage rec { pname = "ruff"; - version = "0.8.1"; + version = "0.8.2"; pyproject = true; outputs = [ @@ -27,8 +27,8 @@ python3Packages.buildPythonPackage rec { src = fetchFromGitHub { owner = "astral-sh"; repo = "ruff"; - rev = "refs/tags/${version}"; - hash = "sha256-N3TplR+vPu2r56VP/vnOfkxN3Lh2o92kE2hFZKLXO04="; + tag = version; + hash = "sha256-rAIedDjJ1OajxrHS9cgP9sdcTbT7JFbA16jeVsaoEEY="; }; # Do not rely on path lookup at runtime to find the ruff binary @@ -41,7 +41,7 @@ python3Packages.buildPythonPackage rec { cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src; - hash = "sha256-iddUzip2LmBMOB+MfpI4k3OitdPbwAZkc4szDPB6duM="; + hash = "sha256-aT1qF7RYytUTLVIM0QDgPesiJPCLwKoARWcIBgwN7C8="; }; nativeBuildInputs = From 464187c4869b6a1f2cc81ebf2ff08d2e0911b678 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 6 Dec 2024 13:20:08 +0100 Subject: [PATCH 7/7] rustc: patch the path to llvm-strip instead of using /usr/bin/strip on darwin --- pkgs/development/compilers/rust/rustc.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 0e999407c9d0..508942a97c7a 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -227,6 +227,11 @@ in stdenv.mkDerivation (finalAttrs: { # Useful debugging parameter # export VERBOSE=1 + '' + lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.targetPlatform.isDarwin) '' + # Replace hardcoded path to strip with llvm-strip + # https://github.com/NixOS/nixpkgs/issues/299606 + substituteInPlace compiler/rustc_codegen_ssa/src/back/link.rs \ + --replace-fail "/usr/bin/strip" "${lib.getExe' llvmShared "llvm-strip"}" '' + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' # See https://github.com/jemalloc/jemalloc/issues/1997 # Using a value of 48 should work on both emulated and native x86_64-darwin.