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

"Fetching package index ..." never stops. #774

Closed
MarcosPividori opened this issue Aug 13, 2015 · 6 comments
Closed

"Fetching package index ..." never stops. #774

MarcosPividori opened this issue Aug 13, 2015 · 6 comments
Milestone

Comments

@MarcosPividori
Copy link

Hi, running:

$> sudo apt-get remove stack
$> rm -rf ~/.stack
$> sudo apt-get update && sudo apt-get install stack -y
$> stack --version
Version 0.1.3.1, Git revision 908b04205e6f436d4a5f420b1c6c646ed2b804d7
$> stack setup
Downloaded lts-2.18 build plan.    
Caching build plan
Fetching package index ...

Never finishes...

@MarcosPividori
Copy link
Author

Well, it finishes, but it took 57 minutes:

$> time stack setup
Caching build plan
Fetched package index.                                                                                    
Populated index cache.    
Downloaded ghc-7.8.4.                                     
Installed GHC.     
stack will use a locally installed GHC
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec

real    56m33.452s
user    1m7.898s
sys 0m19.055s

Do you know why the connection is too low?

@snoyberg
Copy link
Contributor

I don't know. Running with -v is a good way to get extra information. The three possibly time consuming things happening there are:

  1. Cloning the Git repository with the .cabal files from Github
  2. Populating the index cache (CPU intensive)
  3. Downloading GHC from S3

@snoyberg snoyberg added this to the Support milestone Aug 13, 2015
@MarcosPividori
Copy link
Author

Hi! Thanks for your response.
It performs far faster today (4 minutes):
´´´
$ time stack setup -v
Version 0.1.3.1, Git revision 908b042
2015-08-13 14:02:10.019423: [debug] Checking for project config at: /tmp/stacki/stack.yaml @(stack-0.1.3.1:Stack.Config src/Stack/Config.hs:459:9)
2015-08-13 14:02:10.019789: [debug] Loading project config file stack.yaml @(stack-0.1.3.1:Stack.Config src/Stack/Config.hs:482:13)
2015-08-13 14:02:10.021771: [debug] Decoding build plan from: /home/marcos/.stack/build-plan/lts-2.18.yaml @(stack-0.1.3.1:Stack.BuildPlan src/Stack/BuildPlan.hs:476:5)
2015-08-13 14:02:10.878769: [info] Caching build plan @(stack-0.1.3.1:Stack.BuildPlan src/Stack/BuildPlan.hs:216:5)
2015-08-13 14:02:10.880655: [debug] Run process: git fetch --tags --depth=1 @(stack-0.1.3.1:System.Process.Read src/System/Process/Read.hs:255:3)
Fetched package index.
2015-08-13 14:03:11.135306: [debug] Exporting a tarball to /home/marcos/.stack/indices/Hackage/00-index.tar @(stack-0.1.3.1:Stack.PackageIndex src/Stack/PackageIndex.hs:291:13)
2015-08-13 14:03:11.135555: [debug] Could not delete cache: /home/marcos/.stack/indices/Hackage/00-index.cache: removeLink: does not exist (No such file or directory) @(stack-0.1.3.1:Stack.PackageIndex src/Stack/PackageIndex.hs:356:19)
2015-08-13 14:03:11.135717: [debug] Run process: git archive --format=tar -o /home/marcos/.stack/indices/Hackage/00-index.tar.tmp current-hackage @(stack-0.1.3.1:System.Process.Read src/System/Process/Read.hs:255:3)
Populated index cache.
2015-08-13 14:03:24.236973: [debug] Run process: ldd /usr/bin/stack @(stack-0.1.3.1:System.Process.Read src/System/Process/Read.hs:255:3)
2015-08-13 14:03:24.476168: [debug] Downloading from https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-x86_64-unknown-linux-deb7.tar.xz to /home/marcos/.stack/programs/x86_64-linux/ghc-7.8.4.tar.xz ... @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:829:5)
2015-08-13 14:03:24.476565: [debug] Will check against sha1 hash: 11aec12d4bb27f6fa59dcc8535a7a3b3be8cb787 @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:839:13)
Downloaded ghc-7.8.4.
2015-08-13 14:05:20.788575: [debug] menv = fromList [........] @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:676:5)
2015-08-13 14:05:20.948416: [debug] ziptool: xz @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:687:5)
2015-08-13 14:05:20.948497: [debug] make: make @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:688:5)
2015-08-13 14:05:20.94854: [debug] tar: tar @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:689:5)
2015-08-13 14:05:20.948817: [debug] Unpacking /home/marcos/.stack/programs/x86_64-linux/ghc-7.8.4.tar.xz @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:696:9)
2015-08-13 14:05:20.948943: [debug] Run process: tar xf /home/marcos/.stack/programs/x86_64-linux/ghc-7.8.4.tar.xz @(stack-0.1.3.1:System.Process.Read src/System/Process/Read.hs:255:3)
2015-08-13 14:05:36.587405: [debug] Run process: /tmp/stack-setup22980/ghc-7.8.4/configure --prefix=/home/marcos/.stack/programs/x86_64-linux/ghc-7.8.4/ @(stack-0.1.3.1:System.Process.Read src/System/Process/Read.hs:255:3)
2015-08-13 14:05:45.744115: [debug] Run process: make install @(stack-0.1.3.1:System.Process.Read src/System/Process/Read.hs:255:3)
Installed GHC.
2015-08-13 14:06:30.263828: [debug] GHC installed to /home/marcos/.stack/programs/x86_64-linux/ghc-7.8.4/ @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:707:9)
2015-08-13 14:06:30.77279: [debug] Performing a sanity check on: /home/marcos/.stack/programs/x86_64-linux/ghc-7.8.4/bin/ghc @(stack-0.1.3.1:Stack.Setup src/Stack/Setup.hs:957:5)
2015-08-13 14:06:30.77297: [debug] Run process: ghc /tmp/stack-sanity-check22980/Main.hs -no-user-package-db @(stack-0.1.3.1:System.Process.Read src/System/Process/Read.hs:255:3)
2015-08-13 14:06:33.462196: [info] stack will use a locally installed GHC @(main:Main src/main/Main.hs:538:29)
2015-08-13 14:06:33.462437: [info] For more information on paths, see 'stack path' and 'stack exec env' @(main:Main src/main/Main.hs:539:15)
2015-08-13 14:06:33.462595: [info] To use this GHC and packages outside of a project, consider using: @(main:Main src/main/Main.hs:540:15)
2015-08-13 14:06:33.462743: [info] stack ghc, stack ghci, stack runghc, or stack exec @(main:Main src/main/Main.hs:541:15)

real 4m23.513s
user 0m49.872s
sys 0m15.023s
´´´
I will close this.

@wdanilo
Copy link

wdanilo commented Apr 3, 2016

Hello! I've just hit the same issue:

$ stack --stack-yaml ./build/stack-develop.yaml build -v

Version 1.0.4 x86_64
2016-04-03 03:34:35.556309: [debug] Loading project config file build/stack-develop.yaml @(stack_4dvKIEntzDN7ESZC7K4r0G:Stack.Config src/Stack/Config.hs:779:13)
2016-04-03 03:34:35.557739: [debug] Trying to decode /Users/wdanilo/.stack/build-plan-cache/x86_64-osx/lts-5.10.cache @(stack_4dvKIEntzDN7ESZC7K4r0G:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-04-03 03:34:35.557822: [debug] Failure decoding /Users/wdanilo/.stack/build-plan-cache/x86_64-osx/lts-5.10.cache @(stack_4dvKIEntzDN7ESZC7K4r0G:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:59:13)
2016-04-03 03:34:35.564513: [debug] Decoding build plan from: /Users/wdanilo/.stack/build-plan/lts-5.10.yaml @(stack_4dvKIEntzDN7ESZC7K4r0G:Stack.BuildPlan src/Stack/BuildPlan.hs:445:5)
2016-04-03 03:34:36.510641: [info] Caching build plan @(stack_4dvKIEntzDN7ESZC7K4r0G:Stack.BuildPlan src/Stack/BuildPlan.hs:220:5)
2016-04-03 03:34:36.510770: [debug] Trying to decode /Users/wdanilo/.stack/indices/Hackage/00-index.cache @(stack_4dvKIEntzDN7ESZC7K4r0G:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-04-03 03:34:36.510891: [debug] Failure decoding /Users/wdanilo/.stack/indices/Hackage/00-index.cache @(stack_4dvKIEntzDN7ESZC7K4r0G:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:59:13)
2016-04-03 03:34:36.511397: [debug] Run process: git fetch --tags --depth=1 @(stack_4dvKIEntzDN7ESZC7K4r0G:System.Process.Read src/System/Process/Read.hs:269:3)
Fetching package index ...```

I've run it an hour ago and it freezed in this place for an hour until I killed it. Now I cleaned all the configuration and run it again and it freezed the same way.

@wdanilo
Copy link

wdanilo commented Apr 3, 2016

Ok, I think the github transfer was really slow when I was writing the previous comment, now fetching was done in about 5 minutes. I was trying to manually pull the repo from github and indeed it was going about 20kb/s. I think it would be great to add to stack information about the progress of the fetching process.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 3, 2016

I've implemented #1223, so hopefully there will be clearer messaging about what's going wrong.

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

No branches or pull requests

4 participants