update-golang
update-golang copied to clipboard
Fails in curl-only environment, possibly after switched to go.dev
Hello, Today I realized that my CI starts to fails when it tries to un-tar the .tar.gz file. (e.g. go1.19.linux-amd64.tar.gz) (which means I'm using your work pretty much every day. I appreciate it so much)
I found that curl -o https://go.dev/dl/go*.tar.gz (e.g. https://go.dev/dl/go1.19.linux-amd64.tar.gz) seems to download an HTML file that contains a tagged hyperlink text to the tar.gz in it, in stead of the tar.gz itself.
On the other hand, executing wget -O seems to download decent tar.gz itself for some reason.
Although I successfully worked around that problem by just installing and using wget instead of curl so that it never bothers me anymore, I'm just here to let you know it just in case you haven't noticed.
Thanks
Hi,
Thanks for reporting!
I have reverted the change in the default download URLs.
Can you please confirm whether the old URLs work better for you?
Thanks!
Hi,
With your latest version, both curl and wget seem to work fine now.
(since wget are working fine in previous version, I don't think it was "wrong URL" though...)
Anyway, thank you for the quick revert patch. Hope you could find the real cause and safely switch to go.dev soon.
Thanks
p.s. You can decide whether close this issue now, or keep it open as an issue tracker until this gets really solved
Can you share the version of curl you are using?
Sory for the waiting, I reproduced the issue by checking out an old commit and got this.
It is running on Gitlab runner by the way
......
$ git clone https://github.com/udhos/update-golang
Cloning into 'update-golang'...
$ cd update-golang
$ git checkout 5c2ad1202aa73bb0f387a2ca663c80bda63c93b9
Note: switching to '5c2ad1202aa73bb0f387a2ca663c80bda63c93b9'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 5c2ad12 Withstand missing sha256sum tool.
$ cd ..
$ curl --version
curl 7.79.1 (x86_64-koji-linux-gnu) libcurl/7.79.1 OpenSSL/1.0.2k-fips zlib/1.2.7 libidn2/2.3.0 libssh2/1.4.3 nghttp2/1.41.0 OpenLDAP/2.4.44
Release-Date: 2021-09-22
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL UnixSockets
$ sudo ./update-golang/update-golang.sh
update-golang.sh: version 0.25
update-golang.sh: find_latest: found last release: 1.19
./update-golang/update-golang.sh: line 184: file: command not found
./update-golang/update-golang.sh: line 184: file: command not found
./update-golang/update-golang.sh: line 184: file: command not found
./update-golang/update-golang.sh: line 184: file: command not found
ln: failed to create symbolic link '.git/hooks/pre-commit': No such file or directory
update-golang.sh: user: uid=0(root) gid=0(root) groups=0(root)
update-golang.sh: RELEASE_LIST=https://go.dev/dl/
update-golang.sh: SOURCE=https://go.dev/dl
update-golang.sh: DESTINATION=/usr/local
update-golang.sh: RELEASE=1.19
update-golang.sh: OS=linux
update-golang.sh: ARCH_PROBE=uname -m
update-golang.sh: ARCH=amd64
update-golang.sh: PROFILED=/etc/profile.d/golang_path.sh
update-golang.sh: CACHE=/usr/local
update-golang.sh: GOPATH=
update-golang.sh: DEBUG=
update-golang.sh:
update-golang.sh: will install golang go1.19.linux-amd64 as: /usr/local/go
update-golang.sh: https://go.dev/dl/go1.19.linux-amd64.tar.gz is remote
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 73 100 73 0 0 241 0 --:--:-- --:--:-- --:--:-- 240
update-golang.sh: remove_old_link: not found symlink for old install
update-golang.sh: untar: tar -x -f /usr/local/go1.19.linux-amd64.tar.gz
tar: This does not look like a tar archive
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
update-golang.sh: die: untar: failed: /usr/local/go1.19.linux-amd64.tar.gz
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
......