Quoting Dima Kogan (2023-03-16 20:34:14)
> Johannes Schauer Marin Rodrigues <jo...@debian.org> writes:
> 
> > Thank you for your feedback! How about:
> >
> > E: unable to pick chroot mode automatically (use --mode for manual 
> > selection)
> >
> > This will make the user look up the --mode argument and its possible values 
> > in
> > the man page. If the user then selects --mode=unshare, the error message
> > indicates what is wrong.
> 
> That's better. What's the internal logic? I guess mmdebstrap tried
> "unshare", and it didn't work. Did it try all the others too, and they didn't
> work also?

Yes. It tried everything and didn't find anything it's able to use.

> It doesn't hurt to have ridiculously long error messages. We COULD say
> 
>   E: unable to pick chroot mode automatically (use --mode for manual
>   selection). Tried A, which didn't work because X; tried B, which
>   didn't work because Y...

The problem with ridiculously long error messages is, that mmdebstrap currently
has no way to wrap long error messages after 80 columns or so. A very long
error message is hard to read if it doesn't get wrapped similar to how you did
it in your example.

The second reason is, that it would not be easy to store and forward the reason
why the other modes failed. Especially the unshare mode can fail for 26
different reasons if I counted correctly. Letting the test-function silently
fail when checking for the mode but extracting the error message would turn the
code even more into spagetti.

> So if mmdebstrap already knows that --mode=unshare would produce
> 
>   W: no entry in /etc/subuid for dima
>   E: failed to parse /etc/subuid and /etc/subgid
> 
> It could say that initially. Maybe that's overkill and too much typing
> for you. What you have already already tells the user what to read about and
> play with (--mode), so maybe that's fine.

Thank you for your feedback. You are only the second person for whom unshare
mode did not work out-of-the-box so your feedback is very valuable. :)

cheers, josch

Reply via email to