Ravenports / ravenadm

Administration tool for Ravenports
http://www.ravenports.com
ISC License
17 stars 3 forks source link

More verbose output of distinfo generation (in case of fetch failure) #78

Open kraileth opened 5 months ago

kraileth commented 5 months ago

The distinfo subcommand of dev is completely silent until it's done and either all fetching is finished or something failed. In the first case, it will eventually output something like this:

% doas ravenadm dev distinfo

=> anyhow-1.0.80.tar.gz doesn't seem to exist in /distfiles.

=> Attempting to fetch https://crates.io/api/v1/crates/anyhow/1.0.80/download?dummy=/a
nyhow-1.0.80.tar.gz

anyhow-1.0.80.tar.gz                                    44 kB 8663 kBps    00s

=> cargo-config2-0.1.19.tar.gz doesn't seem to exist in /distfiles.

=> Attempting to fetch https://crates.io/api/v1/crates/cargo-config2/0.1.19/download?d
ummy=/cargo-config2-0.1.19.tar.gz

cargo-config2-0.1.19.tar.gz                             59 kB   10 MBps    00s
[...]

Outputting this directly to stdout could be useful to indicate some progress (especially when fetching huge distfiles like texlive) but that would only be a nice to have. The actual problem is when fetching fails. Ravenadm will then output this:

% doas ravenadm dev distinfo
####### MAKESUM COMMAND FAILED #######
hint 1: Check SITES array contents are valid and accessible
hint 2: Check that all distfile names are correct.

For single distfile ports that is fair enough, but when working on a Rust port with several hundred crates, knowing which one failed to fetch is crucial. Commenting out half of the distfiles in the specification to figure out if the offending one is in the first or in the second half and then halving again and again gets old pretty quickly. Go ports of course suffer from the same problem.

Right now upgrading certain ports with dozens or more distfiles is a pain and unreasonably time-consuming if there's even just one invalid URL involved. It would help tremendously to at least include the URL attempted to fetch from in any case of failure, even if the successful ones are not getting printed in that case. Maybe also mentioning the distfile number as used in the manifest isn't a bad idea as it would make finding the problematic one in the specification pretty convenient.

jrmarino commented 3 months ago

the workaround is:

> env ENTERAFTER=fetch ravenadm test <testport>

when you get the prompt:

> cd /port
> make makesum

Then you see the output

jrmarino commented 1 month ago

it might be possible to do something like this:

  1. store the output in a local text file
  2. if fetch is successful, no change
  3. if fetch fails, display the contents of the output file