Closed qknight closed 10 months ago
I assume that this is the NixOS module and Hydra package from nixpkgs?
In fact, I could reproduce this issue on my Hydra fork, but merging in Hydra master fixed the issue. The following merge did the trick: https://github.com/Ma27/hydra/commit/cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f
I assume that https://github.com/Ma27/hydra/commit/cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f#diff-8e49a5c05bb74b6d179f6a5568f4e22334dd24bec14495ea4052c4e01146d916 is related.
Anyways, if that's the case then this is a nixpkgs bug because the Hydra "version" is too old.
@Ma27 so far I can't get the version you pointed out to run:
nixpkgs.overlays = [(final: prev: {
hydra_unstable = prev.hydra_unstable.overrideAttrs {
src = pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "hydra";
rev = "cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f";
hash = "sha256-6jUNlUr67snI3WijkVZcODxkjT/UxeqC3z0CQY4hrfs=";
};
};
}
)];
Fails with:
config.status: executing executable-scripts commands
building
build flags: -j2 SHELL=/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash
make all-recursive
make[1]: Entering directory '/build/source'
Making all in src
make[2]: Entering directory '/build/source/src'
Making all in hydra-evaluator
make[3]: Entering directory '/build/source/src/hydra-evaluator'
g++ -DHAVE_CONFIG_H -I. -I../.. -std=c++2a -I/nix/store/2iqsv9phqnxl4vqgcci7plr2v7c3k6y8-nix-2.17.1-dev/include/nix -I/nix/store/xyhqn7mhfkzkx58dw74xlxi5fx765df9-boehm-gc-8.2.2-dev/include -Wall -I ../libhydra -Wno-deprecated-declarations -g -O2 -include nix/config.h -c -o hydra_evaluator-hydra-evaluator.o `test -f 'hydra-evaluator.cc' || echo './'`hydra-evaluator.cc
In file included from hydra-evaluator.cc:1:
../libhydra/db.hh:5:10: fatal error: environment-variables.hh: No such file or directory
5 | #include "environment-variables.hh"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:443: hydra_evaluator-hydra-evaluator.o] Error 1
make[3]: Leaving directory '/build/source/src/hydra-evaluator'
make[2]: *** [Makefile:363: all-recursive] Error 1
make[2]: Leaving directory '/build/source/src'
make[1]: *** [Makefile:422: all-recursive] Error 1
make[1]: Leaving directory '/build/source'
make: *** [Makefile:350: all] Error 2
error: builder for '/nix/store/y4hdffacnqkrax8pj21sgz0wkl9anhzv-hydra-2023-11-17.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/m3jr6l9pkmdapkjqarzjiiwvp8iwyn9x-hydra-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6q584dq7x8ipnvx9zs4gr7r74zj4y9fb-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/bk6z1lmdpkhdibn2inpjg41an50fi8dq-unit-hydra-evaluator.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v73pydz30jb8gqmbmnzv7x04xczv54q3-unit-hydra-init.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/93nyimzg3l9gzj5d9vxkhxqv784v2vr5-unit-hydra-notify.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5v59jr6qij0d9sachhg2a9nkmz2a7xdc-unit-hydra-queue-runner.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/zp4ifspcqhv5g60p7ydlwvb58sc14415-unit-hydra-send-stats.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/31xrhnzm5hh7fi05y0p3xm33gzxnr3qc-unit-hydra-server.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kpzhvdw5ibsgm6hhq0dsp1shv8gdd83m-unit-hydra-update-gc-roots.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gvrayyc9ayfgrrr63vpwzg2wi47gw33x-nixos-system-nixos-thinkpad-t530-23.11.2451.2d2ea8eab9e4.drv' failed to build
How to use hydra then? Should I use the hydra flake instead?
Fails with:
Oh sorry I forgot to mention that (because I had the exact same error as well on my upgrade journey). That's because the Hydra master is only compatible with the API from Nix 2.19. I built Hydra against 2.19 and then it worked fine for me.
How to use hydra then? Should I use the hydra flake instead?
That's what I'm doing these days.
Alternatively, Hydra on nixpkgs master seems to build fine, so you may want to request a backport to 23.11 for it (it'll also need 2.19 most likely, but I took care of that backport already in https://github.com/NixOS/nixpkgs/pull/279184#pullrequestreview-1807498750).
EDIT: upon taking a closer look I just realized that I can build /nix/store/f6lfb5617dfr245a7y1da7dqw9s8sa88-hydra-2023-11-17.drv
just fine now oO
I must say I'm a little confused now.
I can't imagine that on nixpkgs 23.11 release, the hydra in nixpkgs would have been released while still failing.
I update the nix-channel once more but still can't build it.
@Ma27 If you backport nix 2.19, this also means that we have to rebuild basically the complete OS, right? Or are you only using a different version for hydra then?
Something else I was considering, maybe we can get a previous version going instead, what do you think?
With nix 2.19 and the https://github.com/Ma27/hydra/commit/cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f I get this now:
all fail
could this be a race condition because my machine is slow?!
{ config, pkgs, lib, callPackage, ... }:
{
nixpkgs.overlays = [(final: prev: {
# cp -r pkgs/tools/package-management/nix/* /etc/nixos/nix
# extend with nix_2_19
# nix_2_19 = prev.nix.common {
# version = "2.19.2";
# hash = "sha256-iA8DqS+W2fWTfR+nNJSvMHqQ+4NpYMRT3b+2zS6JTvE=";
# };
nixVersions = lib.recurseIntoAttrs (pkgs.callPackage /etc/nixos/nix {
storeDir = config.nix.storeDir or "/nix/store";
stateDir = config.nix.stateDir or "/nix/var";
inherit (prev.darwin.apple_sdk.frameworks) Security;
});
# nixos/modules/services/continuous-integration/hydra/default.nix
hydra_unstable_2_19 = final.hydra_unstable_cfcd.override { nix = final.nixVersions.nix_2_19; };
hydra_unstable_cfcd = prev.hydra_unstable.overrideAttrs {
src = pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "hydra";
rev = "cfcd6b6d5a099776a45a7eca06f4534edfe9aa7f";
hash = "sha256-6jUNlUr67snI3WijkVZcODxkjT/UxeqC3z0CQY4hrfs=";
};
};
}
)];
And for the service
services.hydra = {
enable = true;
hydraURL = "http://localhost:3000";
notificationSender = "js@lastlog.de";
buildMachinesFiles = [];
useSubstitutes = true;
package = pkgs.hydra_unstable_2_19;
};
It was really hard to figure out how to get override/overrideAttrs work in conjunction and how to copy the nix source code so i can add the 2.19 version.
@Ma27 thanks for your help. I updated to nixos-unstable now.
If you backport nix 2.19, this also means that we have to rebuild basically the complete OS, right?
The default Nix version won't be touched on a stable release. And even if that'd be the case, that won't cause a full rebuild, not every package depends on Nix.
could this be a race condition because my machine is slow?!
Yes, a few other tests are racy. That's why I usually hit restart when building Hydra on my Hydra for a few times 😅 The failure above was new and reproducible even on my laptop (the other errors usually happen on my builders with a few mroe cores).
It's kinda unfortunate that we don't exactly know what's up there, right?
The .drv
you provided above was buildable for me even though I could reliably reproduce the errors on my own fork. I don't really have the time right now to dive into it, but I guess that should be fine given that it's buildable for you now :)
Describe the bug I'm using nixos 23.11 on a dated t530 lenovo notebook with this configuration from the documentation:
It needs to compile hydra, which usually should be a binary subsitute for reasons I don't understand.
To Reproduce Don't know how.
Expected behavior I expected that hydra subsitute would be downloaded and hydra would be started on my NixOS 23.11 installation.
Hydra Server:
Please fill out this data as well as you can, but don't worry if you can't -- just do your best.