Seems to be because I installed curl
via snap
, and there's some sandboxing happening that prevents it from putting things into .
files (by design, it appears). I reinstalled curl
via apt
, and now it works.
As Ubuntu is moving to snap
away from apt
, this is likely to start happening to others too.
However, as
ghcup
is a shell scriptghcup is a 10k LOC haskell program.
Oops, got confused with the old one - sorry, I stand corrected!
So it does seem like my curl
is busted. I'll indeed investigate. Thanks for the advice on using wget
, that will tide me over for now.
I guess only one remaining question: is it worth doing some 'defensive programming' to more gracefully deal with a busted curl
? If not, feel free to close this issue.
So the bug isn't 'in' ghcup
, but rather due to curl
. However, as ghcup
is a shell script, IMHO this should still be handled at this level. In other words, a failing curl
should not cause ghcup
to fail, but rather to switch to wget
itself.
That last command worked correctly. So I should proceed to install the recommended versions by hand? [And: why is curl
failing?]
I just checked that, with wget
, I can download the file above, so it is currently available (one guess was that it was a temporary issue with unavailability of the source rather than the destination).
Others hint that it might be an issue with permissions on /tmp
:
carette@jacques-XPS-15:~$ ls -ld /tmp
drwxrwxrwt 21 root root 4096 Sep 20 15:02 /tmp
but that doesn't seem to be a problem either.
carette@jacques-XPS-15:~$ ls -la ~/.ghcup/cache
total 8
drwxrwxr-x 2 carette carette 4096 Sep 19 22:22 .
drwxrwxrwx 7 carette carette 4096 Sep 19 21:34 ..
I tried again just now, here's the full output
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 22.5M 100 22.5M 0 0 18.9M 0 0:00:01 0:00:01 --:--:-- 18.9M
[ Info ] downloading: https://www.haskell.org/ghcup/data/ghcup-0.0.6.yaml as file /home/carette/.ghcup/cache/ghcup-0.0.6.yaml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0Warning: Failed to create the file
Warning: /home/carette/.ghcup/cache/ghcup-0.0.6.yaml.tmp: Permission denied
13 121k 13 16366 0 0 66465 0 0:00:01 --:--:-- 0:00:01 66528
curl: (23) Failure writing output to destination
[ Warn ] Could not get download info, trying cached version (this may not be recent!)
[ Error ] JSON decoding failed with: YAML exception:
[ ... ] Yaml file not found: /home/carette/.ghcup/cache/ghcup-0.0.6.yaml
[ ... ] Consider removing "/home/carette/.ghcup/cache/ghcup-0.0.6.yaml" manually.
cachec
was a typo - I wrote this report on a different computer, so could not cut-and-paste. I'll fill in the answer to the second question from my other computer.
When I run curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org
on a very fresh install of Ubuntu 20.04, I get the error
Warning: /home/carette/.ghcup/cache/ghcup-0.0.6.yaml.tmp: Permission denied
even though ghcup
was the one to successfully create the directories .ghcup
and .ghcup/cache
.