diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 747eb205e..faabe4170 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1076,6 +1076,10 @@ void LocalStore::querySubstitutablePathInfos(const StorePathCAMap & paths, Subst if (!settings.useSubstitutes) return; for (auto & sub : getDefaultSubstituters()) { for (auto & path : paths) { + if (infos.find(path.first) != infos.end()) + // choose first succeeding substituter + continue; + auto subPath(path.first); // recompute store path so that we can use a different store root diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 4fb6c40c7..54471bdf2 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -430,9 +430,10 @@ public: virtual StorePathSet querySubstitutablePaths(const StorePathSet & paths) { return {}; }; /* Query substitute info (i.e. references, derivers and download - sizes) of a map of paths to their optional ca values. If a path - does not have substitute info, it's omitted from the resulting - ‘infos’ map. */ + sizes) of a map of paths to their optional ca values. The info + of the first succeeding substituter for each path will be + returned. If a path does not have substitute info, it's omitted + from the resulting ‘infos’ map. */ virtual void querySubstitutablePathInfos(const StorePathCAMap & paths, SubstitutablePathInfos & infos) { return; };