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

Stack clean command should not go out stubbornly downloading things #4181

Closed
xiaopong opened this issue Jul 28, 2018 · 8 comments
Closed

Stack clean command should not go out stubbornly downloading things #4181

xiaopong opened this issue Jul 28, 2018 · 8 comments

Comments

@xiaopong
Copy link

The stack clean command should be really simple: Clean up the object files in the project.

But what it does is, start up and sit there, pondering about life for a long time, and then decide that it wants to download a bunch things and rebuild. But it keeps getting connection timeout issue, even if curl can perfectly fetch the package.

Even if you have just upgraded stack, the stack clean should just be a simple command to do the clean up.

@xiaopong
Copy link
Author

Here's part of a very frustrating daily life using stack:

xp @ λ ★ stack clean
Preparing to install GHC (tinfo6) to an isolated location.
This will not interfere with any system-level installation.
                                          
Warning: Retry number 0 after a total delay of 0 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510
                                          
Warning: Retry number 1 after a total delay of 100000 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510
                                          
Warning: Retry number 2 after a total delay of 200000 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510
                                          
Warning: Retry number 3 after a total delay of 300000 us
         If you see this warning and stack fails to download, but running the command again solves the problem,
         please report here: https://github.com/commercialhaskell/stack/issues/3510
Preparing to download ghc-tinfo6-8.2.2 ...
HttpExceptionRequest Request {
  host                 = "github.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/commercialhaskell/ghc/releases/download/ghc-8.2.2-release/ghc-8.2.2-x86_64-fedora27-linux-patch1.tar.xz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 ConnectionTimeout
xp @ λ ★ stack clean
HttpExceptionRequest Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = [("User-Agent","The Haskell Stack")]
  path                 = "/fpco/stackage-content/master/stack/stack-setup-2.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 ConnectionTimeout

@Blaisorblade
Copy link
Collaborator

@Renzhi #3510 is a really unfortunate issue (no clue myself what to do there).

It seems stack is trying to setup GHC, does passing --no-install-ghc or --system-ghc help?

Maybe Stack will insist on having a properly setup environment even for clean; while that's unnecessary, even if clean was changed it seems stack would still not work for you without a GHC, so changes there would not be very useful it seems.
At best, it'd be good to have clean work without a network connection and that's sometimes useful — as a workaround, removing .stack-work should help. I'm hence tagging with P3.

@xiaopong
Copy link
Author

Thing is, for this specific project, I am very sure that the GHC (and ghc-tinfo6 and all the required packages) are all in ~/.stack and all compiled properly, because it's a very old project that used 8.0.2, and it will not be upgraded to new version of GHC because of some other requirements.

And I have a couple of projects that used 8.2.2 (which also have all the packages built), and I'm trying out new things with 8.4.3, I'm not sure what I have done to trigger that download-and-rebuild craze, probably something to do with 8.4.3, or some intero thing (as intero does not build with 8.4.3). But it really should not mess with any other versions, that's the whole point of reproducibility, as far as I can understand.

And now, I'm not sure what a clean state consists of for stack anymore. That's why I recently forked the stack codes to try to understand its internal logic. I'll try to set up a new environment to see if I can find a consistent way to reproduce this problem, after some projects currently on hands, that is.

I just want to say, you guys have done a really good job with Stack, now if Stack could be more reliable in http connection, that would be perfect. At least, it would make this issue less of an issue.

@dbaynard
Copy link
Contributor

#3510 has received a fix — it's in the current master branch.

@Renzhi Have you had any success with reproducing this issue?

stack should be able to clean without making network requests… If anybody wishes to make a PR, follow up here, and one of us can dig out more details.

@xiaopong
Copy link
Author

@dbaynard Unfortunately was busy with some projects recently, didn't have time to keep up with this one yet :(

@dbaynard
Copy link
Contributor

This is just waiting on me submitting a PR to fix the integration test

@dbaynard dbaynard self-assigned this Dec 11, 2018
@snoyberg
Copy link
Contributor

snoyberg commented Apr 1, 2019

stack clean no longer requires GHC to be installed, closing

@snoyberg snoyberg closed this as completed Apr 1, 2019
@dbaynard
Copy link
Contributor

dbaynard commented Apr 2, 2019

Thanks, @snoyberg

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