Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to install GHC 7.10: fatal error with tar command. #841

Closed
wismill opened this issue Aug 24, 2015 · 10 comments
Closed

Failed to install GHC 7.10: fatal error with tar command. #841

wismill opened this issue Aug 24, 2015 · 10 comments

Comments

@wismill
Copy link

wismill commented Aug 24, 2015

Hi, I cannot install GHC 7.10 on ArchLinux 64 bits running on a VPS. However, it works well for GHC 7.8.4.

I have the following output, the last line repeating for a lot of files:

stack setup      
Run from outside a project, using implicit global config
Using resolver: lts-3.2 from global config file: /home/user123/.stack/global/stack.yaml
Downloaded ghc-7.10.2.                                     
Unpacking GHC ...Running /usr/bin/tar xf /home/user123/.stack/programs/x86_64-linux/ghc-7.10.2.tar.xz exited with ExitFailure 2
/usr/bin/tar: ghc-7.10.2/libraries/base/dist-install/doc/html/base/base.haddock: Wrote only 9216 of 10240 bytes
/usr/bin/tar: ghc-7.10.2/libraries/base/dist-install/doc/html/base/mini_Text-Show-Functions.html: Cannot write: No space left on device
[...]

There is enough space on the device (see below). I can extract manually the tar.xz file downloaded by stack without problem using tar xf ~/.stack/programs/x86_64-linux/ghc-7.10.2.tar.xz.

df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             970M     0  970M   0% /dev
run             979M  304K  979M   1% /run
/dev/vda1       9.9G  3.0G  6.5G  32% /
tmpfs           979M     0  979M   0% /dev/shm
tmpfs           979M     0  979M   0% /sys/fs/cgroup
tmpfs           979M     0  979M   0% /tmp
tmpfs           196M     0  196M   0% /run/user/0
tmpfs           196M     0  196M   0% /run/user/1000
stack --version
Version 0.1.3.1, Git revision b3cc241f68576bb50dc472953ea73f4be8b11954
@wismill wismill changed the title Failed to install GHC 7.10: error with tar command. Failed to install GHC 7.10: fatal error with tar command. Aug 24, 2015
@borsboom
Copy link
Contributor

@drwebb as our resident Arch user, is this something you might be able to help with?

@borsboom
Copy link
Contributor

@wismill, have you tried installing GHC 7.10.2 manually to see if you have the same problem?

  1. Download http://downloads.haskell.org/~ghc/7.10.2/ghc-7.10.2-x86_64-unknown-linux-deb7.tar.xz
  2. Extract it: tar xf ghc-7.10.2-x86_64-unknown-linux-deb7.tar.xz
  3. Change to the extracted directory: cd ghc-7.10.2
  4. Run ./configure --prefix=/opt/ghc/7.10.2 (change the path to suit your preference)
  5. Run sudo make install

@drwebb
Copy link
Contributor

drwebb commented Aug 28, 2015

I've just upgraded stack to master 7a03614f3a, and reinstall 7.10.2. In the past upgrading was smooth. I would guess you need about 1.0 GB of space for ghc-7.10.2.

So something strange is happening here, I've no real ideas. As a work around you can install 7.10.1 from the official Extra repo, and hope the version is bumped to 7.10.2 soon.

@wismill
Copy link
Author

wismill commented Aug 29, 2015

@borsboom I tried your method and it works.

@wismill
Copy link
Author

wismill commented Aug 29, 2015

Ok, got it:

mkdir ~/tmp
TMPDIR=~/tmp stack setup
rm -r ~/tmp

Explanation: extraction in Setup.hs uses withSystemTempDirectory that uses on Linux TMPDIR, or default to /tmp. I am in the latter case, and my /tmp has less than 1GiB (see df -h output in the first message). So setting another temporary directory does the trick. That was my first suspicion, but I misread the output of df. Still a lot of experience to get in Linux's world ;-)

Conclusion: I do not think stack itself should fix this case, but could stack first check if there is enough space before to install? A much better error message is definitely needed.

I would like to add an element of context: I want to use Yesod and contrary to PHP, Python, Ruby, etc. there is no turnkey provider. So one needs a server with root access and VPS is a very good solution. But often these "machines" will have limited resources and my issue could then show up often.

@borsboom
Copy link
Contributor

I don't think it's worth checking for disk space beforehand, but including the location it's trying to extract the tarball in would help users determine where the problem is. This would be a good task for a newcomer who wants to get their hands in the code, so pull requests are most welcome.

@bixuanzju
Copy link
Contributor

@wismill Do you think it can be closed?

@Decoherence
Copy link

mkdir ~/tmp
TMPDIR=~/tmp stack setup
rm -r ~/tmp

@wismill Thanks for the tip! This fixed the issue on a fresh Arch install.

@wismill
Copy link
Author

wismill commented Sep 28, 2015

@bixuanzju thanks for the commit but I am not fully convinced and there is also an ongoing discussion on issues #623 and #996.

@borsboom
Copy link
Contributor

borsboom commented Oct 1, 2015

Closing in favour of #996

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants