From c3a9ff64cc8677200baa87184d48bbbd08938185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 17 May 2026 07:20:18 +0200 Subject: [PATCH] flake: skip clippy on x86_64-darwin clippy fails to build on x86_64-darwin in nixpkgs (nixos-25.11), fixed in master. install_name_tool runs out of headerpad during fixup. Skip the preBuild lint there so the ofborg package can build. --- flake.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 4601a971..1a9f2b26 100644 --- a/flake.nix +++ b/flake.nix @@ -80,16 +80,23 @@ let pkgs = import nixpkgs { inherit system; }; + # clippy fails to build on x86_64-darwin (nixpkgs missing + # -headerpad_max_install_names, cf. rustfmt fix in nixpkgs#369349). + # Skip the lint step there. + runClippy = !(pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isx86_64); + pkg = pkgs.rustPlatform.buildRustPackage { name = "ofborg"; src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; - nativeBuildInputs = with pkgs; [ - pkg-config - pkgs.rustPackages.clippy - ]; + nativeBuildInputs = + with pkgs; + [ + pkg-config + ] + ++ pkgs.lib.optional runClippy pkgs.rustPackages.clippy; - preBuild = '' + preBuild = pkgs.lib.optionalString runClippy '' cargo clippy '';