go_1_25,buildGo125Module: drop

go 1.25 is end-of-life, and has no more consumers in-tree.
This commit is contained in:
whispers
2026-09-14 07:26:44 -04:00
parent d513b2e01a
commit 0cb6cf9340
5 changed files with 2 additions and 262 deletions

View File

@@ -1,204 +0,0 @@
{
lib,
stdenv,
fetchurl,
tzdata,
replaceVars,
iana-etc,
mailcap,
buildPackages,
pkgsBuildTarget,
targetPackages,
# for testing
buildGo125Module,
callPackage,
}:
let
goBootstrap = buildPackages.callPackage ./bootstrap122.nix { };
# We need a target compiler which is still runnable at build time,
# to handle the cross-building case where build != host == target
targetCC = pkgsBuildTarget.targetPackages.stdenv.cc;
isCross = stdenv.buildPlatform != stdenv.targetPlatform;
in
stdenv.mkDerivation (finalAttrs: {
pname = "go";
version = "1.25.14";
src = fetchurl {
url = "https://go.dev/dl/go${finalAttrs.version}.src.tar.gz";
hash = "sha256-noP0T1/ClzeIYbThbMaqEUvordeZP7POssUSOAqk1YI=";
};
strictDeps = true;
buildInputs =
[ ]
++ lib.optionals stdenv.hostPlatform.isLinux [ stdenv.cc.libc.out ]
++ lib.optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
depsBuildTarget = lib.optional isCross targetCC;
depsTargetTarget = lib.optional stdenv.targetPlatform.isMinGW targetPackages.threads.package;
postPatch = ''
patchShebangs .
'';
patches = [
(replaceVars ./iana-etc-1.25.patch {
iana = iana-etc;
})
# Patch the mimetype database location which is missing on NixOS.
# but also allow static binaries built with NixOS to run outside nix
(replaceVars ./mailcap-1.17.patch {
inherit mailcap;
})
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries
# that run outside a nix server
(replaceVars ./tzdata-1.19.patch {
inherit tzdata;
})
./remove-tools-1.11.patch
./go_no_vendor_checks-1.23.patch
./go-env-go_ldso.patch
];
env = {
inherit (stdenv.targetPlatform.go) GOOS GOARCH GOARM;
# GOHOSTOS/GOHOSTARCH must match the building system, not the host system.
# Go will nevertheless build a for host system that we will copy over in
# the install phase.
GOHOSTOS = stdenv.buildPlatform.go.GOOS;
GOHOSTARCH = stdenv.buildPlatform.go.GOARCH;
GO386 = "softfloat"; # from Arch: don't assume sse2 on i686
# Wasi does not support CGO
# ppc64/linux CGO is incomplete/borked, and will likely not receive any further improvements
# https://github.com/golang/go/issues/8912
# https://github.com/golang/go/issues/13192
CGO_ENABLED =
if
(
stdenv.targetPlatform.isWasi
|| (stdenv.targetPlatform.isPower64 && stdenv.targetPlatform.isBigEndian)
)
then
0
else
1;
GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
}
// lib.optionalAttrs isCross {
# {CC,CXX}_FOR_TARGET must be only set for cross compilation case as go expect those
# to be different from CC/CXX
CC_FOR_TARGET = "${targetCC}/bin/${targetCC.targetPrefix}cc";
CXX_FOR_TARGET = "${targetCC}/bin/${targetCC.targetPrefix}c++";
};
buildPhase = ''
runHook preBuild
export GOCACHE=$TMPDIR/go-cache
if [ -f "$NIX_CC/nix-support/dynamic-linker" ]; then
export GO_LDSO=$(cat $NIX_CC/nix-support/dynamic-linker)
fi
export PATH=$(pwd)/bin:$PATH
${lib.optionalString isCross ''
# Independent from host/target, CC should produce code for the building system.
# We only set it when cross-compiling.
export CC=${buildPackages.stdenv.cc}/bin/cc
# Prefer external linker for cross when CGO is supported, since
# we haven't taught go's internal linker to pick the correct ELF
# interpreter for cross
# When CGO is not supported we rely on static binaries being built
# since they don't need an ELF interpreter
export GO_EXTLINK_ENABLED=${toString finalAttrs.env.CGO_ENABLED}
''}
ulimit -a
pushd src
./make.bash
popd
runHook postBuild
'';
preInstall = ''
# Contains the wrong perl shebang when cross compiling,
# since it is not used for anything we can deleted as well.
rm src/regexp/syntax/make_perl_groups.pl
''
+ (
if (stdenv.buildPlatform.system != stdenv.hostPlatform.system) then
''
mv bin/*_*/* bin
rmdir bin/*_*
${lib.optionalString
(
!(
finalAttrs.env.GOHOSTARCH == finalAttrs.env.GOARCH && finalAttrs.env.GOOS == finalAttrs.env.GOHOSTOS
)
)
''
rm -rf pkg/${finalAttrs.env.GOHOSTOS}_${finalAttrs.env.GOHOSTARCH} pkg/tool/${finalAttrs.env.GOHOSTOS}_${finalAttrs.env.GOHOSTARCH}
''
}
''
else
lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system) ''
rm -rf bin/*_*
${lib.optionalString
(
!(
finalAttrs.env.GOHOSTARCH == finalAttrs.env.GOARCH && finalAttrs.env.GOOS == finalAttrs.env.GOHOSTOS
)
)
''
rm -rf pkg/${finalAttrs.env.GOOS}_${finalAttrs.env.GOARCH} pkg/tool/${finalAttrs.env.GOOS}_${finalAttrs.env.GOARCH}
''
}
''
);
installPhase = ''
runHook preInstall
mkdir -p $out/share/go
cp -a bin pkg src lib misc api doc go.env VERSION $out/share/go
mkdir -p $out/bin
ln -s $out/share/go/bin/* $out/bin
runHook postInstall
'';
disallowedReferences = [ goBootstrap ];
passthru = {
inherit goBootstrap;
tests = callPackage ./tests.nix {
go = finalAttrs.finalPackage;
buildGoModule = buildGo125Module;
};
};
__structuredAttrs = true;
meta = {
changelog = "https://go.dev/doc/devel/release#go${lib.versions.majorMinor finalAttrs.version}";
description = "Go Programming language";
homepage = "https://go.dev/";
license = lib.licenses.bsd3;
teams = [ lib.teams.golang ];
platforms =
lib.platforms.darwin ++ lib.platforms.linux ++ lib.platforms.wasi ++ lib.platforms.freebsd;
badPlatforms = [
# Support for big-endian POWER < 8 was dropped in 1.9, but POWER8 users have less of a reason to run in big-endian mode than pre-POWER8 ones
# So non-LE ppc64 is effectively unsupported, and Go SIGILLs on affordable ppc64 hardware
# https://github.com/golang/go/issues/19074 - Dropped support for big-endian POWER < 8, with community pushback
# https://github.com/golang/go/issues/73349 - upstream will not accept submissions to fix this
"powerpc64-linux"
];
mainProgram = "go";
};
})

View File

@@ -1,27 +0,0 @@
{ callPackage }:
callPackage ./binary.nix {
version = "1.22.12";
hashes = {
# Use `print-hashes.sh ${version}` to generate the list below
darwin-amd64 = "e7bbe07e96f0bd3df04225090fe1e7852ed33af37c43a23e16edbbb3b90a5b7c";
darwin-arm64 = "416c35218edb9d20990b5d8fc87be655d8b39926f15524ea35c66ee70273050d";
freebsd-386 = "85b00f8646e84be6ce51c753d22b68a5f4d5bbfc6a82c8ca9e7489c0c5a619d8";
freebsd-amd64 = "a8c77e76859db3e6f3322cbe11deea5faf779e374f45df7554d2cb484ffa492a";
freebsd-arm64 = "f56d3b2d26acd9e720f8be503d92bb7bb5d921462ff7c92463d0fa550507ed93";
freebsd-armv6l = "dac691ce62ac6b9c78f45a0058d7656abedbe5665b3d49910cbd6ba12e20c2fb";
freebsd-riscv64 = "d147c0c8faaffed65240f3b4fe5e44e573928827b9292fb873c9712d567fa986";
linux-386 = "40d4c297bc2e964e9c96fe79bb323dce79b77b8b103fc7cc52e0a87c7849890f";
linux-amd64 = "4fa4f869b0f7fc6bb1eb2660e74657fbf04cdd290b5aef905585c86051b34d43";
linux-arm64 = "fd017e647ec28525e86ae8203236e0653242722a7436929b1f775744e26278e7";
linux-armv6l = "bcd678461bb74cda217fb5aa3cc914b2021be6d828f0c6fb4e3a36c3d7312acb";
linux-loong64 = "ef1644676782354369210ed6cd839ff872de886c38f287d29ac69377928edec1";
linux-mips = "993c685dad0a59f9f15f76a2eb9146f741ef36d808f38985bc6748b38000746d";
linux-mips64 = "d8aa3dea17e0175d6a57dfdf9b3b29a911ebe8c5ddbefd808eab61a842c00229";
linux-mips64le = "2d473895f9c1dc8c86d51eb13f8ca49b7eea46010759fd71efed3eecacf5335b";
linux-mipsle = "d4ba5f6215643a1d64dc159869663f71dd339598e99678e97e1c5300bb46d46d";
linux-ppc64 = "ab0b6dc2aa1096f256224398d4a34eac5257289146cdc2f3a62b9fc17709a3c5";
linux-ppc64le = "9573d30003b0796717a99d9e2e96c48fddd4fc0f29d840f212c503b03d7de112";
linux-riscv64 = "f03a084aabc812fdc15b29acd5e1ee18e13b3c80be22aec43990119afcaf4947";
linux-s390x = "e1b20935cc790fdc4c48c0e3e6dd11be57ac09e4eb302ba2cdf146276468b346";
};
}

View File

@@ -1,26 +0,0 @@
diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go
index a3105b6b6d..0e10154a70 100644
--- a/src/cmd/go/internal/modload/import.go
+++ b/src/cmd/go/internal/modload/import.go
@@ -345,7 +345,7 @@ func importFromModules(ctx context.Context, path string, rs *Requirements, mg *M
// vendor/modules.txt does not exist or the user manually added directories to the vendor directory.
// Go 1.23 and later require vendored packages to be present in modules.txt to be imported.
_, ok := vendorPkgModule[path]
- if ok || (gover.Compare(MainModules.GoVersion(), gover.ExplicitModulesTxtImportVersion) < 0) {
+ if ok || (gover.Compare(MainModules.GoVersion(), gover.ExplicitModulesTxtImportVersion) < 0) || os.Getenv("GO_NO_VENDOR_CHECKS") == "1" {
mods = append(mods, vendorPkgModule[path])
dirs = append(dirs, dir)
roots = append(roots, vendorDir)
diff --git a/src/cmd/go/internal/modload/vendor.go b/src/cmd/go/internal/modload/vendor.go
index b2cb44100e..05bf3829d5 100644
--- a/src/cmd/go/internal/modload/vendor.go
+++ b/src/cmd/go/internal/modload/vendor.go
@@ -159,7 +159,7 @@ func checkVendorConsistency(indexes []*modFileIndex, modFiles []*modfile.File, m
panic(fmt.Errorf("not in workspace mode but number of indexes is %v, not 1", len(indexes)))
}
index := indexes[0]
- if gover.Compare(index.goVersion, "1.14") < 0 {
+ if gover.Compare(index.goVersion, "1.14") < 0 || (os.Getenv("GO_NO_VENDOR_CHECKS") == "1" && len(vendorMeta) == 0) {
// Go versions before 1.14 did not include enough information in
// vendor/modules.txt to check for consistency.
// If we know that we're on an earlier version, relax the consistency check.

View File

@@ -453,6 +453,7 @@ mapAliases {
buildBowerComponents = throw "buildBowerComponents has been removed as bower was removed. It is recommended to migrate to yarn."; # Added 2025-09-17
buildFHSEnvChroot = throw "'buildFHSEnvChroot' is deprecated, please use 'buildFHSEnv'"; # Added 2026-05-21
buildGo123Module = throw "Go 1.23 is end-of-life, and 'buildGo123Module' has been removed. Please use a newer builder version."; # Added 2025-08-13
buildGo125Module = throw "Go 1.25 is end-of-life, and 'buildGo125Module' has been removed. Please use a newer builder version."; # Added 2026-09-15
buildPlatform = warnAlias "'buildPlatform' has been renamed to/replaced by 'stdenv.buildPlatform'" stdenv.buildPlatform; # Converted to warning 2025-10-28
buildXenPackage = throw "'buildXenPackage' has been removed as a custom Xen build can now be achieved by simply overriding 'xen'."; # Added 2025-05-12
bullet-roboschool = throw "'bullet-roboschool' has been removed as its build was broken and it was deprecated with its last update in 2019."; # Added 2025-11-15
@@ -1060,6 +1061,7 @@ mapAliases {
go-thumbnailer = throw "'go-thumbnailer' has been renamed to/replaced by 'thud'"; # Converted to throw 2025-10-27
go-upower-notify = throw "'go-upower-notify' has been renamed to/replaced by 'upower-notify'"; # Converted to throw 2025-10-27
go_1_23 = throw "Go 1.23 is end-of-life and 'go_1_23' has been removed. Please use a newer Go toolchain."; # Added 2025-08-13
go_1_25 = throw "Go 1.25 is end-of-life and 'go_1_25' has been removed. Please use a newer Go toolchain."; # Added 2026-09-14
gobang = throw "'gobang' has been removed as it is unmaintained upstream. Consider using `lazysql` or `rainfrog` instead."; # added
godot-export-templates = throw "'godot-export-templates' has been renamed to/replaced by 'godot-export-templates-bin'"; # Converted to throw 2025-10-27
godot_4-export-templates = throw "'godot_4-export-templates' has been renamed to/replaced by 'godot_4-export-templates-bin'"; # Converted to throw 2025-10-27

View File

@@ -6827,11 +6827,6 @@ with pkgs;
go_latest = go_1_27;
buildGoLatestModule = buildGo127Module;
go_1_25 = callPackage ../development/compilers/go/1.25.nix { };
buildGo125Module = callPackage ../build-support/go/module.nix {
go = buildPackages.go_1_25;
};
go_1_26 = callPackage ../development/compilers/go/1.26.nix { };
buildGo126Module = callPackage ../build-support/go/module.nix {
go = buildPackages.go_1_26;