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

Add to FAQ how to trick stack to install a GHC binary archive on Windows #1920

Closed
louy2 opened this issue Mar 17, 2016 · 11 comments
Closed

Add to FAQ how to trick stack to install a GHC binary archive on Windows #1920

louy2 opened this issue Mar 17, 2016 · 11 comments

Comments

@louy2
Copy link

louy2 commented Mar 17, 2016

Due to connection issues it is extremely slow to stack setup here. I tried to set http_proxy but got a segfault instead.

Is there a place I can download the exact same thing as stack setup and put it manually into where it is supposed to be?

@louy2
Copy link
Author

louy2 commented Mar 17, 2016

So I've got this: https://www.haskell.org/ghc/download_ghc_7_10_3#windows64
And I found in FAQ:

Note that stack setup installs GHC into ~/.stack/programs/$platform/ghc-$version/ and not a global location.

But it is not clear what are the $platform's. On the other hand, it is also stated

stack is fully aware of all GHCs that it has installed itself.

So I am unsure if putting file there can trick stack into thinking it has installed that one.

@louy2
Copy link
Author

louy2 commented Mar 17, 2016

Success! Hail the power of Everything.

By searching ghc in Everything I found that the temporary folder holding the download progress is %APPDATA%/Local/Programs/stack/x86_64-windows. I downloaded http://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3b-x86_64-unknown-mingw32.tar.xz and renamed it to ghc-7.10.3.tar.xz, and put it in there. A subsequent stack setup regards it as downloaded GHC and installed it normally.

Maybe this is worth mentioning in FAQ?

@louy2 louy2 changed the title How to Install GHC manually into the isolated location on Windows? Add to FAQ how to trick stack to install a GHC binary archive on Windows Mar 17, 2016
@louy2
Copy link
Author

louy2 commented Mar 17, 2016

I am so confused. I have full control of the home dir for sure, but I get Access Denied at the end.

Full error:

C:\Users\yang\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.3-tmp4660\ghc-7.10.3\: MoveFileEx "C:\\Users\\yang\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-7.10.3-tmp4660\\ghc-7.10.3\\" "C:\\Users\\yang\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-7.10.3\\": permission denied (Access is denied.)

@mgsloan
Copy link
Contributor

mgsloan commented Mar 17, 2016

Not exactly a frequent question, so I'm not sure if it belongs in the FAQ. It might be worth having something document the folder structure, though, including the programs folder. Just having this issue is good for letting people know how to do it in the future.

Note that this isn't very windows specific. The tarballs just go in stack path --ghc-paths.

RE the Acess Denied, seems like the same issue as #1917

@mgsloan mgsloan closed this as completed Mar 17, 2016
@mgsloan mgsloan added this to the Support milestone Mar 17, 2016
@snoyberg snoyberg removed this from the Support milestone Mar 17, 2016
@mgsloan mgsloan added this to the Support milestone Mar 17, 2016
@reverofevil
Copy link

Great advice. Until #2240 gets fixed, this should be in the manual.

@mgsloan
Copy link
Contributor

mgsloan commented Jun 6, 2017

Sure, by popular demand I'd accept a PR adding a note about this to the manual.

@mgsloan mgsloan reopened this Jun 6, 2017
@KiaraGrouwstra
Copy link

KiaraGrouwstra commented Jun 10, 2017

~/.stack/programs/x86_64-linux/ keeps putting a ghc-8.0.2.tar.xz.tmp that takes ages, so now I've put a manually downloaded/renamed ghc-8.0.2.tar.xz in there, alongside a manually extracted ghc-8.0.2 folder.
stack setup appears to keep starting a new download though, apparently contradicting @louy2's account. I wonder if I might've done anything wrong... Stack version 0.1.10.0 x86_64.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 7, 2017

@tycho01 The issue is that is an ancient version of stack.

@KiaraGrouwstra
Copy link

@msgloan: thanks! 😄

@dtaskoff
Copy link

Is there a place I can download the exact same thing as stack setup and put it manually into where it is supposed to be?

I think that this is a bad idea.

Due to connection issues it is extremely slow to stack setup here.

Then download the ghc locally and set it in your stack.yaml like that:

setup-info:
  ghc:
    linux64-integersimple:
      8.0.2:
        url: /home/me/ghc/ghc-8.0.2-x86_64-unknown-linux.tar.xz

Of course, you should modify the above to fit your case, but note that the url field should be an absolute path.

@rgrinberg
Copy link

@tycho01's work around doesn't work for me. stack keeps trying to redownload things.

Here's my ghc dir:

[rgrinberg:~/.stack/programs/x86_64-osx] % ls
ghc-8.0.2               ghc-8.0.2.installed     ghc-8.0.2.tar.bz2       ghc-8.2.2               ghc-8.2.2.tar.bz2       ghc-8.2.2.tar.bz2.tmp

@mpilgrem mpilgrem closed this as completed Apr 9, 2023
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

8 participants