From 588d8570a155ce50e48f24019cbcbe5f6156db30 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 31 Mar 2025 17:22:10 +0200 Subject: [PATCH] Revert "cosmic-launcher: use mold linker" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This mostly reverts commit 63a365d8ffd47ffe7bbd0e577e3fecb51130efed. I've left the deletion of the postPatch from the original commit stand — it seems to have been included in the original commit by mistake instead of being a separate commit, as it has nothing to do with mold. In Nixpkgs, we consider the linker a property of the platform. Individual packages should not be using toolchains other than the ones that are part of the platform without a strong justification. In this case, the only justification appears to have been that upstream uses this linker. Just like we don't force every package whose upstream happens to use Clang in their own builds to build with Clang in Nixpkgs rather than the platform compiler, upstream's choice alone isn't grounds for overriding the platform linker here. --- pkgs/by-name/co/cosmic-launcher/package.nix | 102 +++++++++----------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/pkgs/by-name/co/cosmic-launcher/package.nix b/pkgs/by-name/co/cosmic-launcher/package.nix index fba267328761..ac55e2b38390 100644 --- a/pkgs/by-name/co/cosmic-launcher/package.nix +++ b/pkgs/by-name/co/cosmic-launcher/package.nix @@ -1,70 +1,64 @@ { lib, stdenv, - stdenvAdapters, fetchFromGitHub, rustPlatform, just, libcosmicAppHook, nix-update-script, - - withMoldLinker ? stdenv.targetPlatform.isLinux, }: -rustPlatform.buildRustPackage.override - { stdenv = if withMoldLinker then stdenvAdapters.useMoldLinker stdenv else stdenv; } - (finalAttrs: { - pname = "cosmic-launcher"; - version = "1.0.0-alpha.6"; +rustPlatform.buildRustPackage (finalAttrs: { + pname = "cosmic-launcher"; + version = "1.0.0-alpha.6"; - src = fetchFromGitHub { - owner = "pop-os"; - repo = "cosmic-launcher"; - tag = "epoch-${finalAttrs.version}"; - hash = "sha256-BtYnL+qkM/aw+Air5yOKH098V+TQByM5mh1DX7v+v+s="; - }; + src = fetchFromGitHub { + owner = "pop-os"; + repo = "cosmic-launcher"; + tag = "epoch-${finalAttrs.version}"; + hash = "sha256-BtYnL+qkM/aw+Air5yOKH098V+TQByM5mh1DX7v+v+s="; + }; - useFetchCargoVendor = true; - cargoHash = "sha256-g7Qr3C8jQg65KehXAhftdXCpEukag0w12ClvZFkxfqs="; + useFetchCargoVendor = true; + cargoHash = "sha256-g7Qr3C8jQg65KehXAhftdXCpEukag0w12ClvZFkxfqs="; - nativeBuildInputs = [ - just - libcosmicAppHook + nativeBuildInputs = [ + just + libcosmicAppHook + ]; + + dontUseJustBuild = true; + dontUseJustCheck = true; + + justFlags = [ + "--set" + "prefix" + (placeholder "out") + "--set" + "bin-src" + "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-launcher" + ]; + + env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = "--cfg tokio_unstable"; + + passthru.updateScript = nix-update-script { + extraArgs = [ + "--version" + "unstable" + "--version-regex" + "epoch-(.*)" ]; + }; - dontUseJustBuild = true; - dontUseJustCheck = true; - - justFlags = [ - "--set" - "prefix" - (placeholder "out") - "--set" - "bin-src" - "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-launcher" + meta = { + homepage = "https://github.com/pop-os/cosmic-launcher"; + description = "Launcher for the COSMIC Desktop Environment"; + mainProgram = "cosmic-launcher"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ + nyabinary + HeitorAugustoLN ]; - - env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = - "--cfg tokio_unstable${lib.optionalString withMoldLinker " -C link-arg=-fuse-ld=mold"}"; - - passthru.updateScript = nix-update-script { - extraArgs = [ - "--version" - "unstable" - "--version-regex" - "epoch-(.*)" - ]; - }; - - meta = { - homepage = "https://github.com/pop-os/cosmic-launcher"; - description = "Launcher for the COSMIC Desktop Environment"; - mainProgram = "cosmic-launcher"; - license = lib.licenses.gpl3Only; - maintainers = with lib.maintainers; [ - nyabinary - HeitorAugustoLN - ]; - platforms = lib.platforms.linux; - }; - }) + platforms = lib.platforms.linux; + }; +})