update raceless

This commit is contained in:
2025-10-28 17:01:12 +00:00
parent 9fe0bbaefe
commit e22fe24f3a

View File

@@ -1,8 +1,6 @@
{ pkgs, go }: { pkgs, go }:
let let
go-wrapper = pkgs.writeShellApplication { go-script = pkgs.writeShellScript "go-raceless" ''
name = "go";
text = ''
args=("$@") args=("$@")
new_args=() new_args=()
has_test=false has_test=false
@@ -24,13 +22,12 @@ let
done done
if [[ "$found_race" == "true" ]]; then if [[ "$found_race" == "true" ]]; then
exec "$REAL_GO" "''${new_args[@]}" exec ${go}/bin/go "''${new_args[@]}"
fi fi
fi fi
exec "$REAL_GO" "$@" exec ${go}/bin/go "$@"
''; '';
};
preservedAttrs = pkgs.lib.attrsets.getAttrs [ preservedAttrs = pkgs.lib.attrsets.getAttrs [
"CGO_ENABLED" "CGO_ENABLED"
@@ -46,9 +43,8 @@ pkgs.symlinkJoin (
nativeBuildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = '' postBuild = ''
rm $out/bin/go rm $out/bin/go
cp ${go-script} $out/bin/go
makeWrapper ${go-wrapper}/bin/go $out/bin/go \ chmod +x $out/bin/go
--set REAL_GO ${go}/bin/go
''; '';
} }
// preservedAttrs // preservedAttrs