!UNVBThoJtlIiVwiDjU:nixos.org

Staging

293 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/102 Servers

Load older messages


SenderMessageTime
14 Sep 2025
@emilazy:matrix.orgemilyum part of the GitHub UI I have never seen before cool14:12:48
@emilazy:matrix.orgemily oh you just patched src/cmd/dist/build.go, ok 14:14:29
@emilazy:matrix.orgemilyyeah so this seems sensible but I do think that just teaching it about the linker path seems like a good idea. let me meditate on the least awful way of doing that14:15:16
@lt1379:matrix.orgLun Is there a nice env var we already set that I can teach the part that uses buildcfg.GO_LDSO to grab the right interpreter path from? 14:15:35
@emilazy:matrix.orgemilyalso…14:15:39
@emilazy:matrix.orgemilyI'm confused14:15:44
@emilazy:matrix.orgemilyit tries to use internal linkmode even with cgo on normal Linux, right?14:15:52
@emilazy:matrix.orgemily why doesn't CGO_ENABLED produce busted executables by default then? 14:16:03
@emilazy:matrix.orgemilylike I get that it works for static because no interp14:16:48
@emilazy:matrix.orgemilybut the cgo external library case?14:16:54
@emilazy:matrix.orgemily fwiw, what we do is $NIX_CC/nix-support/dynamic-linker 14:17:40
@emilazy:matrix.orgemily but another option would be: teach it about runtime GO_LDSO too 14:17:49
@emilazy:matrix.orgemilyand then set that in the hook14:17:55
@emilazy:matrix.orgemilyand ofc default it to the one being used at compile-time in the Go build14:18:09
@emilazy:matrix.orgemilythat might be more upstreamable14:18:18
@emilazy:matrix.orgemilyI'm trying to figure out if that part of the code looks at any environment variables or if we'd have to pipe it in14:18:32
@lt1379:matrix.orgLun It seems like it uses the external linker right now by default in x86_64-linux, I see GCC: (GNU) 14.3.0 in .comment in github:nixos/nixpkgs/nixos-unstable#syncthing 14:19:04
@emilazy:matrix.orgemilybtw I've been really good at not saying this but I've spent long enough on this now that I have to let off some pressure by saying that I don't really like Go and I think it's kind of bad.14:19:15
@emilazy:matrix.orgemily I keep wondering where this cfg variable is being passed. it's going to be a global variable isn't it 14:21:00
@emilazy:matrix.orgemilyhttps://github.com/golang/go/blob/ac803b5949f6dbc5bfa559afe506d35f9e1b3195/src/cmd/go/internal/cfg/cfg.go oh it's a package containing global variables14:21:13
@emilazy:matrix.orgemily okay I think that the linker doesn't have cfg.BuildContext because it's not part of go(1) 14:22:41
@emilazy:matrix.orgemily
	if buildcfg.GOARCH != arch.Name {
		log.Fatalf("invalid buildcfg.GOARCH %s (want %s)", buildcfg.GOARCH, arch.Name)
	}
14:23:17
@emilazy:matrix.orgemilywait is the linker single-target?14:23:20
@emilazy:matrix.orgemily oh it probably is because it's like the Plan 9 6l 8l stuff 14:23:28
@emilazy:matrix.orgemily
			 * For x86, Apple has reserved a slot in the TLS for Go. See issue 23617.
14:23:46
@emilazy:matrix.orgemilyneed this kind of leverage with Apple14:23:55
@emilazy:matrix.orgemilybasically my fear is that this linker doesn't look at any env variables14:24:27
@emilazy:matrix.orgemilyand that they'll be like14:24:29
@emilazy:matrix.orgemily no this should be an actual flag and go(1) should pass it down 14:24:34
@emilazy:matrix.orgemilyand that would be maddening14:24:40

Show newer messages


Back to Room ListRoom Version: 6