From 8c06b7b431d73431d8872c28d1ec5009cecd5d03 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Thu, 23 May 2024 22:48:36 -0600 Subject: [PATCH 1/2] 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 --- src/libfetchers/fetchers.cc | 4 ++++ tests/functional/nix-profile.sh | 1 + 2 files changed, 5 insertions(+) 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 Input::fetch(ref store) const } auto [storePath, input] = [&]() -> std::pair { + // *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: From d0390b5cf2d232febaa89aa6d8b07c547513a460 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Thu, 23 May 2024 22:55:46 -0600 Subject: [PATCH 2/2] nix3: always use the same verbosity default (info) Change-Id: I3ab84cc583e3e8b1c05a8ae1a7a087204f513d03 --- src/nix/main.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/nix/main.cc b/src/nix/main.cc index 64755d445..83d697326 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -363,11 +363,6 @@ void mainWrapped(int argc, char * * argv) setLogFormat("bar"); settings.verboseBuild = false; - if (isatty(STDERR_FILENO)) { - verbosity = lvlNotice; - } else { - verbosity = lvlInfo; - } NixArgs args;