!UNVBThoJtlIiVwiDjU:nixos.org

Staging

286 Members
Staging merges | Running staging cycles: https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Astaging-next+head%3Astaging-next-25.05 | Review Reports: https://malob.github.io/nix-review-tools-reports/99 Servers

Load older messages


SenderMessageTime
14 Sep 2025
@emilazy:matrix.orgemilyright. or at least intent to tell ourselves we could upstream it 😅15:05:57
@aloisw:julia0815.dealoisw Ah I just assumed it because you started talking about GOFLAGS right after I mentioned rhe PR. 15:06:17
@aloisw:julia0815.dealoiswBut yes maybe I should close it, it was an experiment and I think you have better ideas.15:07:43
@emilazy:matrix.orgemily

a.diff looks good to me. there's a little evil Rob Pike inside me wondering if this might be more Tao of Go

if interpreter == "" {
	interpreter = os.Getenv("GO_LDSO")
}
if interpreter == "" && buildcfg.GOOS == runtime.GOOS && buildcfg.GOARCH == runtime.GOARCH {
	interpreter = buildcfg.DefaultGO_LDSO
}
15:08:10
@emilazy:matrix.orgemily(because it's worse)15:08:15
@emilazy:matrix.orgemilyI appreciate the vote of confidence given my roughly zero knowledge of the Go toolchain 🫠15:08:49
@emilazy:matrix.orgemily

but yeah this plus

if [[ -e $NIX_CC/nix-support/dynamic-linker ]]; then
  export GO_LDSO=$(< "$NIX_CC/nix-support/dynamic-linker")
fi

seems good

15:10:07
@emilazy:matrix.orgemilyideally we wouldn't duplicate that across two versions of Go and the builder function but idk if it's avoidable15:10:25
@aloisw:julia0815.dealoisw
In reply to @emilazy:matrix.org
I appreciate the vote of confidence given my roughly zero knowledge of the Go toolchain 🫠
That's not less knowledge than me there.
15:11:29
@emilazy:matrix.orgemily

and then

func DefaultPIE(goos, goarch string, isRace bool) bool {
	switch goos {
	case "windows":
		if isRace {
			// PIE is not supported with -race on windows;
			// see https://go.dev/cl/416174.
			return false
		}
	}
	return true
}
15:12:03
@emilazy:matrix.orgemily or even just return false → return true if you want the smallest possible diff… 15:12:15
@lt1379:matrix.orgLunYeah have it working just setting up a passthru.test for buildmode=internal15:12:15
@lt1379:matrix.orgLun* Yeah have it working for syncthing, just setting up a passthru.test for buildmode=internal15:12:23
@emilazy:matrix.orgemilythis ended up a lot more elegant than I was expecting15:12:52
@aloisw:julia0815.dealoisw One possible problem with the GO_LDSO approach could be packages trying to do cross compilation with GOARCH on GOOS, but from a cursory glance most usages of that seems to be either redundantly for native, or wasm. 15:12:56
@emilazy:matrix.orgemily if upstream don't like GO_LDSO then it'll be annoying and we might have to argue with them about how to get -I passed down etc. 15:13:04
@emilazy:matrix.orgemily but they already do GO_EXTLINK_ENABLED 15:13:09
@emilazy:matrix.orgemilyand read that directly in the linker15:13:13
@emilazy:matrix.orgemilyso my hope is that it's an easy enough sell15:13:18
@emilazy:matrix.orgemilyoh hmm yeah I guess maybe that's why the conditional is there15:13:46
@emilazy:matrix.orgemilythe cross one I mean15:13:50
@emilazy:matrix.orgemily in which case maybe Getgoldso() is the right approach 15:13:59
@emilazy:matrix.orgemilyit's just15:14:04
@emilazy:matrix.orgemilyall that logic seems kinda busted anyway15:14:10
@emilazy:matrix.orgemily like GO_EXTLINK_ENABLED should also be platform-specific etc. 15:14:17
@emilazy:matrix.orgemily and our Go package is not targetPlatform-agnostic, which is quite evil but anyway 15:14:29
@emilazy:matrix.orgemilymy thinking was like15:14:51
@emilazy:matrix.orgemily you can do GO_LDSO=… GOARCH=… to at least make cross work 15:15:01
@emilazy:matrix.orgemilyso it's nominally better to have the override15:15:07
@emilazy:matrix.orgemilyI suppose we'll have to see what upstream thinks15:15:22

Show newer messages


Back to Room ListRoom Version: 6