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