From a75c0278db652c7265f205f1a529632e6b050157 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 20 Aug 2020 02:52:57 +0100 Subject: refactor(tvix): Remove some default values from virtual methods This is not actually legal code, but it kind of ... works. There are more of these around, these were just the ones Griffin stumbled upon while working on the build logs. Change-Id: Iff9821d8fe145dd426648a8ff4510a73f67c9b7d Reviewed-on: https://cl.tvl.fyi/c/depot/+/1795 Tested-by: BuildkiteCI Reviewed-by: kanepyork Reviewed-by: glittershark --- third_party/nix/src/libstore/rpc-store.hh | 4 ++-- third_party/nix/src/libstore/store-api.hh | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/third_party/nix/src/libstore/rpc-store.hh b/third_party/nix/src/libstore/rpc-store.hh index 4bf417ad1e..b1c2945323 100644 --- a/third_party/nix/src/libstore/rpc-store.hh +++ b/third_party/nix/src/libstore/rpc-store.hh @@ -68,11 +68,11 @@ class RpcStore : public LocalFSStore, public virtual Store { RepairFlag repair = NoRepair) override; virtual absl::Status buildPaths(const PathSet& paths, - BuildMode buildMode = bmNormal) override; + BuildMode buildMode) override; virtual BuildResult buildDerivation(const Path& drvPath, const BasicDerivation& drv, - BuildMode buildMode = bmNormal) override; + BuildMode buildMode) override; virtual void ensurePath(const Path& path) override; diff --git a/third_party/nix/src/libstore/store-api.hh b/third_party/nix/src/libstore/store-api.hh index 1d81b228f2..bb2f1a950b 100644 --- a/third_party/nix/src/libstore/store-api.hh +++ b/third_party/nix/src/libstore/store-api.hh @@ -348,8 +348,12 @@ class Store : public std::enable_shared_from_this, public Config { public: /* Query which of the given paths is valid. Optionally, try to substitute missing paths. */ - virtual PathSet queryValidPaths( - const PathSet& paths, SubstituteFlag maybeSubstitute = NoSubstitute); + virtual PathSet queryValidPaths(const PathSet& paths, + SubstituteFlag maybeSubstitute); + + PathSet queryValidPaths(const PathSet& paths) { + return queryValidPaths(paths, NoSubstitute); + } /* Query the set of all valid paths. Note that for some store backends, the name part of store paths may be omitted @@ -452,14 +456,22 @@ class Store : public std::enable_shared_from_this, public Config { recursively building any sub-derivations. For inputs that are not derivations, substitute them. */ [[nodiscard]] virtual absl::Status buildPaths(const PathSet& paths, - BuildMode buildMode = bmNormal); + BuildMode buildMode); + + [[nodiscard]] absl::Status buildPaths(const PathSet& paths) { + return buildPaths(paths, bmNormal); + } /* Build a single non-materialized derivation (i.e. not from an on-disk .drv file). Note that ‘drvPath’ is only used for informational purposes. */ virtual BuildResult buildDerivation(const Path& drvPath, const BasicDerivation& drv, - BuildMode buildMode = bmNormal) = 0; + BuildMode buildMode) = 0; + + BuildResult buildDerivation(const Path& drvPath, const BasicDerivation& drv) { + return buildDerivation(drvPath, drv, bmNormal); + } /* Ensure that a path is valid. If it is not currently valid, it may be made valid by running a substitute (if defined for the -- cgit 1.4.1