diff options
author | Qyriad <qyriad@qyriad.me> | 2024-05-25 19:37:38 -0600 |
---|---|---|
committer | Qyriad <qyriad@qyriad.me> | 2024-05-25 19:37:38 -0600 |
commit | ebd00b2d0b7a9cc753acc6de9572ac112a3492a7 (patch) | |
tree | e78d5d884ee01ccdc9aa5869103fbc20cf9a5860 | |
parent | dd53bce476805b41f2e9858e64e38574a88db77f (diff) |
libfetchers: fix URL logging
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
-rw-r--r-- | src/libfetchers/fetchers.cc | 10 |
1 files changed, 6 insertions, 4 deletions
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<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); + // *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) { |