From ebd00b2d0b7a9cc753acc6de9572ac112a3492a7 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Sat, 25 May 2024 19:37:38 -0600 Subject: libfetchers: fix URL logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8c06b7b43ยน made libfetchers log the URL being fetched just before the actual fetch, particularly in case something freezes. This used the base URL, to not include query parameters, as the Nixpkgs lib tests assume that stderr logs will be equal across shallow and non-shallow git fetches (and shallow fetches have the ?shallow=1 query parameter). 8c06b7b43 assumed that the `base` field of ParsedURL would be populated, as the comment simply says "URL without query/fragment"... but apparently it is not populated when the URL being fetched is *already* fetched, which caused libfetchers to log things like fetching gitlab input '' which is. silly. but you know, busted lix be busted. Anyway, with this commit we just remove the query params before printing instead, which seems to do the right thing [1]: 8c06b7b431d73431d8872c28d1ec5009cecd5d03 Change-Id: I9b9988992029aa6abef786f20b66e68c2ebb97d4 --- src/libfetchers/fetchers.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index 210912cb6..e09513d8f 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -133,10 +133,12 @@ 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); + // *sighs*, we print the URL without query params, rather than the full URL + // because the Nixpkgs fileset lib tests assume that fetching shallow and + // non-shallow prints exactly the same stderr... + ParsedURL withoutParams = this->toURL(); + withoutParams.query.clear(); + printInfo("fetching %s input '%s'", this->getType(), withoutParams.to_string()); try { return scheme->fetch(store, *this); } catch (Error & e) { -- cgit v1.2.3