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: 9161e02039e6
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d3df747cb681
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 23, 2021

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    6ea9c65 View commit details
  2. Revert "Make nix shell fallback to static outputs when needed"

    This reverts commit 8d66f5f.
    
    This fix isn't needed anymore now that the realisations are always
    properly registered
    thufschmitt committed Apr 23, 2021

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    d3df747 View commit details
Showing with 9 additions and 13 deletions.
  1. +3 −12 src/libcmd/installables.cc
  2. +6 −1 tests/ca/substitute.sh
15 changes: 3 additions & 12 deletions src/libcmd/installables.cc
Original file line number Diff line number Diff line change
@@ -736,18 +736,9 @@ std::set<RealisedPath> toRealisedPaths(
output.first);
auto outputId = DrvOutput{outputHashes.at(output.first), output.first};
auto realisation = store->queryRealisation(outputId);
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});
}
if (!realisation)
throw Error("cannot operate on an output of unbuilt content-addresed derivation '%s'", outputId.to_string());
res.insert(RealisedPath{*realisation});
}
else {
// If ca-derivations isn't enabled, behave as if
7 changes: 6 additions & 1 deletion tests/ca/substitute.sh
Original file line number Diff line number Diff line change
@@ -36,7 +36,12 @@ nix build --file ../simple.nix -L --no-link --post-build-hook ../push-to-store.s
clearStore
rm -r "$REMOTE_STORE_DIR/realisations"
nix build --file ../simple.nix -L --no-link --substitute --substituters "$REMOTE_STORE" --no-require-sigs -j0
if [[ $(sqlite3 "$NIX_STATE_DIR/db/db.sqlite" 'select count(*) from Realisations') -eq 0 ]]; then
# There's no easy way to check whether a realisation is present on the local
# store − short of manually querying the db, but the build environment doesn't
# have the sqlite binary − so we instead push things again, and check that the
# realisations have correctly been pushed to the remote store
nix copy --to "$REMOTE_STORE" --file ../simple.nix
if [[ -z "$(ls "$REMOTE_STORE_DIR/realisations")" ]]; then
echo "Realisations not rebuilt"
exit 1
fi