Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5d43cdb02a14
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8d66f5f1107f
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 21, 2021

  1. Make nix shell fallback to static outputs when needed

    In case of pure input-addressed derivations, the build loop doesn't
    guaranty that the realisations are stored in the db (if the output paths
    are already there or can be substituted, the realisations won't be
    registered). This caused `nix shell` to fail in some cases because it
    was assuming that the realisations were always existing.
    
    A better (but more involved) fix would probably to ensure that we always
    register the realisations, but in the meantime this patches the surface
    issue.
    
    Fix #4721
    thufschmitt committed Apr 21, 2021
    Copy the full SHA
    8d66f5f View commit details
Showing with 12 additions and 3 deletions.
  1. +12 −3 src/libcmd/installables.cc
15 changes: 12 additions & 3 deletions src/libcmd/installables.cc
Original file line number Diff line number Diff line change
@@ -736,9 +736,18 @@ std::set<RealisedPath> toRealisedPaths(
output.first);
auto outputId = DrvOutput{outputHashes.at(output.first), output.first};
auto realisation = store->queryRealisation(outputId);
if (!realisation)
throw Error("cannot operate on an output of unbuilt content-addresed derivation '%s'", outputId.to_string());
res.insert(RealisedPath{*realisation});
if (!realisation) {
// TODO: remove this check once #4725 is fixed
// as we’ll have the guaranty that if
// `output.second` exists, then the realisation
// will be there too
if (output.second)
res.insert(*output.second);
else
throw Error("cannot operate on an output of unbuilt content-addresed derivation '%s'", outputId.to_string());
} else {
res.insert(RealisedPath{*realisation});
}
}
else {
// If ca-derivations isn't enabled, behave as if