-
Notifications
You must be signed in to change notification settings - Fork 846
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
Better support for bad connection #3088
Comments
This one also appears some time
|
Hmm, that's strange! It should only do that if the hackage info is missing, or if you need to build a package version that it doesn't know about. So, not sure what could cause this. |
If there are some debug options (like debug log output) i could try those next time i run into the problem. |
@domenkozar That might be relevant, but there
Stack has the |
same here. I guess part of the reason is I'm in mainland China, but even download from GitHub can run pretty fast for me, usually 200~300 kb/s |
@quentin-l You could try configuring Sadly I don't know the ideal config to use—at some point I had this:
which should be no worse than |
@mgsloan There are enough users with problems with S3 that we should have docs on how to avoid it (did I say this already)? Is my previous comment still good nowadays?
|
@Blaisorblade Thanks! It only took me four minutes to download the package!! Finally I can enjoy Stack LOL |
@Blaisorblade Is there anyway to work around the ghc downloading? I installed ghc 8.0.2 through home-brew and linked it to stack, but a project I forked uses ghc 8.0.1 so stack suggests me to use |
I am not sure there... There are ways to use a custom set of GHC download URLs... And bindists from the GHC website should work. The comment below has an example (see the setup-info section of config.yaml). Sorry these are very incomplete instructions, but I'm on my phone. |
@Blaisorblade After some unsuccessful attempt, I finally found the easiest way is to download ghc distribution manually, copy it to stack directories, and tell stack to compile it. |
@QuRyu Could you please show me more detailed instructions? Specifically, where to download ghc? What are the stack directories? How to tell stack to compile this ghc distribution? Great thanks. |
@hengxin I was on macOS so I used brew to install stack. I am under the impression that by typing "stack ghc" you would get instructions on how to install ghc, since stack does not come bundled with ghc. |
I’m not on a computer right now (so can’t give good instructions), but you don’t need to compile GHC, EDIT: see below. |
Correction: you need to place a GHC bindist tarball into the right subdirectory of (Correct files are available at https://github.com/commercialhaskell/ghc/releases, not sure about a good mirror for China). |
@QuRyu @Blaisorblade Thanks. It works now. |
@hengxin Would you mind adding details on what worked for you? My instructions were vague (couldn’t test much), it might help others 😉 |
@Blaisorblade I am using Ubuntu. Following the instructions given by @QuRyu , I have added
to Now, Following @Blaisorblade , I have checked the
|
@hengxin Thanks! I’m confused that this helped for downloading GHC in |
@hengxin glad it helps. |
@QuRyu Ah, but one also needs extra configuration:
I can’t read your link but the snippet seems clear. I didn’t know Stack accepted configuration for mirrors. For info: https://groups.google.com/forum/m/#!topic/haskell-stack/LHG9DSrz8k8 has details, and https://github.com/ndmitchell/offline-stack shows how to use Stack offline (after downloading enough material), which probably helps with the original issue. I’m tempted to now mark this whole issue as duplicate, though I’m not sure which issues discuss the remaining annoyances. |
OK, closing as duplicate of #2982 which has progress on using Stack offline. |
@Blaisorblade, what about using stackage instead?
|
@samandarr I’m afraid I’m not sure what’s your question? Stack uses stackage by default, that config looks like it fixes a particular snapshot, and that is... not good I guess? |
@Blaisorblade I had same sort of issue above. Then I used the configuration suggested by you and it changed my life :D
I think it changes pkg mirror from S3 to hackage.haskell.org ? I had really bad connection with S3. |
@Blaisorblade I highly appreciate your help. It (your configuration) just works now. Could you tell me magic behind it :D? Does Stack indeed uses stackage by default? In my case, it seemed as its downloading from https://s3.amazonaws.com/hackage.fpcomplete.com which was really really slow. |
@samandarr Sorry, let me clarify — Stack downloads (a copy of) Hackage, by default from a mirror on S3. If Stack then uses Stackage elsewhere to pick sets of compatible package versions — if my But I fear such a Worse, if I include a EDIT: TL;DR. Using |
Hmmm - I put the following into ${STACK_ROOT}/config.yaml
But
Using s3.amazonaws.com is a really, really bad idea! |
FWIW, your log shows a timeout downloading GHC from GitHub, and GitHub’s using S3 — it’s not just GitHub. So, blocking S3 seems a really bad idea; nevertheless, I agree that Stack (and maybe GitHub?) should ideally support using mirrors. And stack does! So somebody should follow the example by Tsinghua.edu.cn (link below) and set up a mirror. The GitHub URL comes from stack-setup-2.yaml, and customizing that requires using the |
What's the status of this bad connection handling issue? This is a really important issue to resolve. This makes me avoid using stack whenever possible. I'm in Shanghai, so the default S3 repository is simply not accessible. I have http proxy to an "external" machine, but stack can't handle http proxy :( Sure, there's the Tsinghua mirror, it works find when stars are aligned, but a lot of times, I just get the same connection timeout issue. Another issue with stack is, it does not know that a package is already downloaded. It downloads a package, runs into some issue unpacking it, and exits. You re-run the command, it will stubbornly tries to download again. And that will take forever, as you keep running into connection timeout. I've been stuck with this issue for two days now, trying to upgrade to ghc-8.4.3. |
I like to use stack -- online with a bad connection -- Using it offline is not a good solution because then it doesn't check for newer versions and i have to remember to update it all the time. Fallback to offline version when connection is down is acceptable though. Please reopen because i don't think offline is the solution for this problem. |
One of the reasons for pantry is to support multiple mirrors and offline support. |
When i travel by train i can get free wifi in the train, but the connection is really slow. But i still would like to do some coding with GHCI. Normally i just launch
stack ghci
, all the dependencies were already loaded in at home so it should just start right away. Instead i see thisAfter a 20 minutes or so, this gets added
recv: resource vanished (Connection reset by peer)
and the program abort. And i can't code in the train this way.The text was updated successfully, but these errors were encountered: