From 3e6b9f9357e4573740a4d9e477c4f4fa69c74fa5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 16 Oct 2023 01:17:33 -0400 Subject: [PATCH 1/2] Remove `prevInfos` as its dead code It is unused since 8e0946e8df968391d1430af8377bdb51204e4666 removed support for the repeat and enforce-determinism options. --- src/libstore/build/local-derivation-goal.hh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libstore/build/local-derivation-goal.hh b/src/libstore/build/local-derivation-goal.hh index 0a05081c7..8191af7a6 100644 --- a/src/libstore/build/local-derivation-goal.hh +++ b/src/libstore/build/local-derivation-goal.hh @@ -120,14 +120,6 @@ struct LocalDerivationGoal : public DerivationGoal */ OutputPathMap scratchOutputs; - /** - * Path registration info from the previous round, if we're - * building multiple times. Since this contains the hash, it - * allows us to compare whether two rounds produced the same - * result. - */ - std::map prevInfos; - uid_t sandboxUid() { return usingUserNamespace ? (!buildUser || buildUser->getUIDCount() == 1 ? 1000 : 0) : buildUser->getUID(); } gid_t sandboxGid() { return usingUserNamespace ? (!buildUser || buildUser->getUIDCount() == 1 ? 100 : 0) : buildUser->getGID(); } From 862d16436b7606bba9064e2bf2a4c48bd883bb42 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 16 Oct 2023 01:22:34 -0400 Subject: [PATCH 2/2] Remove the `ValidPathInfo` `==` operator It is dead code. It was added in 8e0946e8df968391d1430af8377bdb51204e4666 as part of the repeated / enforce-determinism feature, but that was removed in 8fdd156a650f9b2ce9ae8cd74edcf16225478292. It is not good because it skips many fields. For testing purposes we will soon want to add a new one that doesn't skip fields, but we want to make sure making == sensitive to those fields won't change how Nix works. Proving in this commit that the old version is dead code achieves that. --- src/libstore/path-info.hh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libstore/path-info.hh b/src/libstore/path-info.hh index 221523622..fea6d0e5f 100644 --- a/src/libstore/path-info.hh +++ b/src/libstore/path-info.hh @@ -72,14 +72,6 @@ struct ValidPathInfo */ std::optional ca; - bool operator == (const ValidPathInfo & i) const - { - return - path == i.path - && narHash == i.narHash - && references == i.references; - } - /** * Return a fingerprint of the store path to be used in binary * cache signatures. It contains the store path, the base-32