NixOS / NixOS/hydra

Rebuilds of substitutable dependencies

Open
#799 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PLpgSQL
Stars
1.6k
Forks
358
Avg merge
20h 30m
Merged PRs (30d)
27

Description

Some days ago, the Hydra instance I'm using suddenly started doing mass rebuilds of derivations that should be substitutable, despite use-substitutes being enabled. What's more, these builds are not performed as separate build steps. Instead, Hydra only creates steps for a few high-level drvs (which in itself is correct, the triggering commit only affected high-level drvs), and the mass rebuilds are performed by the daemon inside these steps. When I try to build the corresponding drvs using nix-build on the command line, substitution works.

I'm neither exactly sure what happened nor how the build step logic works, but my current best guess is that there was an accidental garbage collection and maybe an invalidation of some of Hydra's GC roots that removed some of the dependencies from the local store. They are however still available in the destination store, a file:// binary cache. Therefore, this check in queue-monitor.c succeeds for almost all drvs, which are therefore not refetched from the binary cache to the local store. I'm only building on localhost, so there is no “send the dependency closure to the build machine” step that might notice this.

I'm probably going to run nix-build for all jobs manually to work around this issue pretty soon – I kind of depend on the builds working – so let me know if there's anything I can do before that to help diagnose the issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/hydra-queue-runner/queue-monitor.cc around line 459 and compare Hydra's localhost build-step dependency handling with the successful nix-build substitution path. Reproduce using the file:// binary cache and inspect when dependencies already in the destination store are fetched. Done means missing substitutable dependencies are restored instead of rebuilt inside high-level steps.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.