fix(3p/overlays): work around buildkite agent issues with nixpkgs

Buildkite introduced a weird check that determines whether the bootstrap agent
path (?) matches the binary that the agent was started from:

https://github.com/buildkite/agent/pull/3123

They did this to work around some internal development flow problems. However,
this check is toggled by whether or not the `buildNumber` compile-time variable
is set to the special `x` sentinel value.

In their publicly released binaries (which we do not use, of course), this is
set to some other value. In Nix builds they are at the default sentinel value,
causing crashes at startup because of the wrapper script not matching the binary
path:

```
buildkite-agent: fatal: check binary paths: mismatched buildkite-agent paths: host="/nix/store/rmp9g00bppi8yimr0ngnx6490w196in8-buildkite-agent-3.89.0/bin/.buildkite-agent-wrapped" bootstrap="/nix/store/rmp9g00bppi8yimr0ngnx6490w196in8-buildkite-agent-3.89.0/bin/buildkite-agent"
```

To work around this we just set the build "number" to `nix`.

Change-Id: I794861aeaf63764689148cae841ce56f88752186
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13205
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2025-03-02 19:12:52 +03:00 committed by clbot
parent 3f94a09648
commit d76d699a53

View file

@ -33,6 +33,14 @@ depot.nix.readTree.drvTargets {
withAWS = false; withAWS = false;
}); });
# see b/439; this fix will be upstreamed in nixpkgs
buildkite-agent = super.buildkite-agent.overrideAttrs (old: {
# once PR#386414 propagates here (& len(ldflags) = 2), we can delete this
ldflags = assert (builtins.length old.ldflags) == 1; old.ldflags ++ [
"-X github.com/buildkite/agent/v3/version.buildNumber=nix"
];
});
# No longer builds with Nix 2.3 after # No longer builds with Nix 2.3 after
# https://github.com/nixos/nixpkgs/commit/5f9d2d95721cdf20ace744f2db75ad70a7aedd3a # https://github.com/nixos/nixpkgs/commit/5f9d2d95721cdf20ace744f2db75ad70a7aedd3a
nixos-option = super.nixos-option.override { nixos-option = super.nixos-option.override {