Skip to content

libstore: Fix dev environments with CA derivations - #9

Merged
domenkozar merged 1 commit into
devenv-2.34from
agent/fix-ca-derivations-build-environment
Jul 29, 2026
Merged

libstore: Fix dev environments with CA derivations#9
domenkozar merged 1 commit into
devenv-2.34from
agent/fix-ca-derivations-build-environment

Conversation

@domenkozar

Copy link
Copy Markdown
Member

Summary

  • port NixOS/nix@801cb16's type-aware development-environment output handling to BuildEnvironment::getDevEnvironment
  • preserve content-addressed and deferred output types and populate their paths with fillInOutputPaths()
  • add a functional regression for an input-addressed shell derivation while ca-derivations is enabled

Root cause

The fork moved development-environment extraction from src/nix/develop.cc into libstore after the upstream fix had landed, but the extracted implementation retained the older CA feature branch. When ca-derivations was enabled for an otherwise input-addressed derivation, that branch put Nix's deferred hash placeholder in out. Derivation validation then rejected the generated environment because the variable did not match its computed store path.

Impact

Consumers of BuildEnvironment::getDevEnvironment, including devenv's C API integration, can now obtain development environments when ca-derivations is enabled.

Fixes cachix/devenv#2364.
Related devenv change: cachix/devenv#3044.

Validation

  • built the fork and ran nix-functional-tests:ca / develop-input-addressed: 1 passed, 0 failed
  • Clang formatting check on the changed C++ range
  • Meson formatting check on the changed test registration
  • ShellCheck and bash -n on the new test
  • Git whitespace checks

The repository-wide pre-commit derivation still reports pre-existing formatting drift in unrelated files; the changed files pass their targeted formatters.

@domenkozar
domenkozar marked this pull request as ready for review July 29, 2026 18:27
@domenkozar
domenkozar merged commit f33db89 into devenv-2.34 Jul 29, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant