The urllib version used a `FancyURLOpener` which use urllib. But urllib does not not handle proxies with SSL well.
A better solution would be to use `requests` but I prefer to stay with the "no-dependency" approach.
Bootstrapping automatically downloads new Rust and Cargo snapshots
as needed into versioned directories,
but do not remove now-unused versions.
This is the desired behavior for `git bisect` to be usable.
However, this means that old version keep accumulating, taking up disk space.
This adds a mach command to remove snapshots other than the ones
currently being used.
It is never run automatically.
To be safe, the command defaults to only printing what would be removed,
and only removes stuff when run with a `-f` argument.
That way, whenever rust-snapshot-hash changes, mach will look for
the Rust snapshot in a different directory and re-boostrap as needed.
However, older rust version will be left behind never cleaned up.
This is good for git-bisect, but not for disk space:
the current snapshot is 618 MB.
In the future, we may want `mach clean` or some other comment
to remove unused Rust snapshots.
CC #3388
Dumb terminals can only interpret a limited number of control codes,
and rewriting the terminal buffer will make `./mach build` very talkative
on these terminals.
This can be tested by setting the environment variable TERM to "dumb"
as such:
TERM=dumb ./mach build