From 8a77757b7ebfcf0958951a096f005ab919d6567f Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 21 Sep 2023 04:09:34 +0300 Subject: [PATCH] writers.writeCBin: fix binary name when cross-compiling `$name` contains cross-compilation info `bin/wrapped-argv0-aarch64-unknown-linux-gnu` name should not be set directly. --- pkgs/build-support/trivial-builders/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index c4f2cfd754cd..8b8732af0656 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -379,21 +379,21 @@ rec { }; # Create a C binary - writeCBin = name: code: - runCommandCC name + writeCBin = pname: code: + runCommandCC pname { - inherit name code; + inherit pname code; executable = true; passAsFile = ["code"]; # Pointless to do this on a remote machine. preferLocalBuild = true; allowSubstitutes = false; meta = { - mainProgram = name; + mainProgram = pname; }; } '' - n=$out/bin/$name + n=$out/bin/${pname} mkdir -p "$(dirname "$n")" mv "$codePath" code.c $CC -x c code.c -o "$n"