From 9fd601e53d4a1bc778087316548cdc086186e160 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Mon, 17 Jun 2024 18:14:23 +0300 Subject: [PATCH] chore(tvix): patch crate2nix to drop darwin dontStrip This patch has already been applied on upstream but there hasn't been an official release yet so we patch it ourselves. Upstreamed patch: https://github.com/nix-community/crate2nix/commit/0209f258cda8a9972a785e26d92fb477ce4d1b0e Follow-up of: https://cl.tvl.fyi/c/depot/+/11856 Change-Id: If56071ce5753fd26e2b4c203cd831bbe5d329009 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11858 Reviewed-by: flokli Tested-by: BuildkiteCI --- ...e2nix-drop-darwin-explicit-dontstrip.patch | 22 +++++++++++++++++++ third_party/overlays/tvl.nix | 2 ++ tvix/Cargo.nix | 2 -- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 third_party/overlays/patches/crate2nix-drop-darwin-explicit-dontstrip.patch diff --git a/third_party/overlays/patches/crate2nix-drop-darwin-explicit-dontstrip.patch b/third_party/overlays/patches/crate2nix-drop-darwin-explicit-dontstrip.patch new file mode 100644 index 000000000..ba64e660c --- /dev/null +++ b/third_party/overlays/patches/crate2nix-drop-darwin-explicit-dontstrip.patch @@ -0,0 +1,22 @@ +From 0209f258cda8a9972a785e26d92fb477ce4d1b0e Mon Sep 17 00:00:00 2001 +From: Ilan Joselevich +Date: Tue, 11 Jun 2024 18:14:06 +0300 +Subject: [PATCH] Get rid of dontStrip for Darwin as it's no longer needed + +Fixed in https://github.com/NixOS/nixpkgs/pull/255900 +--- + templates/nix/crate2nix/default.nix | 2 -- + +diff --git a/templates/nix/crate2nix/default.nix b/templates/nix/crate2nix/default.nix +index 95d3730f..c53925e7 100644 +--- a/templates/nix/crate2nix/default.nix ++++ b/templates/nix/crate2nix/default.nix +@@ -349,8 +349,6 @@ rec { + buildRustCrateForPkgsFunc pkgs + ( + crateConfig // { +- # https://github.com/NixOS/nixpkgs/issues/218712 +- dontStrip = stdenv.hostPlatform.isDarwin; + src = crateConfig.src or ( + pkgs.fetchurl rec { + name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; diff --git a/third_party/overlays/tvl.nix b/third_party/overlays/tvl.nix index a203866d3..f2260be8b 100644 --- a/third_party/overlays/tvl.nix +++ b/third_party/overlays/tvl.nix @@ -101,6 +101,8 @@ depot.nix.readTree.drvTargets { patches = old.patches or [ ] ++ [ # https://github.com/nix-community/crate2nix/pull/301 ./patches/crate2nix-tests-debug.patch + # TODO(Kranzes): drop on next release + ./patches/crate2nix-drop-darwin-explicit-dontstrip.patch ]; }); diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix index 68e37a3fa..acd3e1dfb 100644 --- a/tvix/Cargo.nix +++ b/tvix/Cargo.nix @@ -18000,8 +18000,6 @@ rec { buildRustCrateForPkgsFunc pkgs ( crateConfig // { - # https://github.com/NixOS/nixpkgs/issues/218712 - dontStrip = stdenv.hostPlatform.isDarwin; src = crateConfig.src or ( pkgs.fetchurl rec { name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz";