Harden _fetch_repository_tools_deps against repository renames (#369)
Harden _fetch_repository_tools_deps against repository renames (#369)

_fetch_repository_tools_deps is used to fetch
github.com/bazelbuild/buildtools (née buildifier) and
golang.org/x/tools into GOPATH so we can bootstrap fetch_repo and
gazelle. Previously, it used repository_ctx.download_and_extract to
download zip files and strip the first directory component.
The first directory component depends on the real name of the
repository, not the name we fetched it as. Bazel fails with an
IOException if the name doesn't match.

With this change, we download an archive with repository_ctx.download,
then use tar to remove the first component of the path, ignoring the
actual name of that component.

Fixes #361 (this is a more robust fix).
linuxerwang/rules_go,bazelbuild/rules_go,Xjs/rules_go,linuxerwang/rules_go,linuxerwang/rules_go,Xjs/rules_go,Xjs/rules_go,bazelbuild/rules_go,Xjs/rules_go,bazelbuild/rules_go,bazelbuild/rules_go,bazelbuild/rules_go,Xjs/rules_go,linuxerwang/rules_go,linuxerwang/rules_go