aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-05-23 22:48:36 -0600
committerQyriad <qyriad@qyriad.me>2024-05-24 15:15:42 -0600
commit8c06b7b431d73431d8872c28d1ec5009cecd5d03 (patch)
tree45b54b124ac339dafc653d2ce164940f77bdfbf1
parentadfc22c3e300b8e0dd7ddfe9543125ca7efc3f98 (diff)
libfetchers: log fetches by URL just before they happen
Addresses but does not close #305, as we still need an indicator for frozen fetches. Change-Id: Iba34ad42dc1c8772f7da249b90fe794b041bbf73
-rw-r--r--src/libfetchers/fetchers.cc4
-rw-r--r--tests/functional/nix-profile.sh1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc
index dc8df2217..210912cb6 100644
--- a/src/libfetchers/fetchers.cc
+++ b/src/libfetchers/fetchers.cc
@@ -133,6 +133,10 @@ std::pair<Tree, Input> Input::fetch(ref<Store> store) const
}
auto [storePath, input] = [&]() -> std::pair<StorePath, Input> {
+ // *sighs*, we print the base URL, rather than the full URL because the Nixpkgs
+ // fileset lib tests assume that fetching shallow and non-shallow prints exactly the
+ // same stderr...
+ printInfo("fetching %s input '%s'", this->getType(), this->toURL().base);
try {
return scheme->fetch(store, *this);
} catch (Error & e) {
diff --git a/tests/functional/nix-profile.sh b/tests/functional/nix-profile.sh
index ed014f9ef..13a73ead9 100644
--- a/tests/functional/nix-profile.sh
+++ b/tests/functional/nix-profile.sh
@@ -155,6 +155,7 @@ diff -u <(
nix --offline profile install $flake2Dir 2>&1 1> /dev/null \
| grep -vE "^warning: " \
| grep -vE "^error \(ignored\): " \
+ | grep -vE "^fetching .+ input" \
|| true
) <(cat << EOF
error: An existing package already provides the following file: