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

Show progress while downloading package index #1223

Closed
hdgarrood opened this issue Oct 24, 2015 · 8 comments
Closed

Show progress while downloading package index #1223

hdgarrood opened this issue Oct 24, 2015 · 8 comments

Comments

@hdgarrood
Copy link

Here is a part of my terminal session directly after installing stack for the first time:

$ stack install purescript-0.7.5
Run from outside a project, using implicit global project config
Using latest snapshot resolver: lts-3.10
Writing implicit global project config file to: /home/harry/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Downloaded lts-3.10 build plan.    
Caching build plan
Updating package index Hackage (mirrored at https://github.com/commercialhaskell
Fetching package index ...

I happen to have an extremely slow internet connection at the moment, so fetching the package index took a long time. I think it might be nice to show progress (eg, X MiB / Y MiB, Z% downloaded) here, like stack setup does when it is downloading GHC.

Also, in case it's important, I'm using the deb package on Ubuntu 14.04.

$ stack --version
Version 0.1.6.0, Git revision e22271f5ce9afa2cb5be3bad9cafa392c623f85c (2313 commits) x86_64
@borsboom
Copy link
Contributor

I agree that would be nice, sometimes it takes a long time to download the index on an overloaded connection and it's hard to tell whether anything is happening. In the case of fetching the index using git, we maybe we could display git clone's own output (at least when running on a terminal). In the case of HTTP download, perhaps reusing Stack.Setup.chattyDownload (but with retry logic?) would make sense.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 3, 2016

Implemented!

mgsloan@computer:~$ stack install sym-0.12.0
Run from outside a project, using implicit global project config
Using resolver: lts-3.19 from implicit global project's config file: /home/mgsloan/.stack/global-project/stack.yaml
Didn't see sym-0.12.0 in your package indices.
Updating and trying again.
Fetching package index ...remote: Counting objects: 14, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 14 (delta 3), reused 14 (delta 3), pack-reused 0
Unpacking objects: 100% (14/14), done.
From https://github.com/commercialhaskell/all-cabal-hashes
 - [tag update]      current-hackage -> current-hackage                                        Fetched package index.    
Populated index cache.    
While constructing the BuildPlan the following exceptions were encountered:

--  Failure when adding dependencies:    
      vector: needed (>=0.11), 0.10.12.3 found (latest applicable is 0.11.0.0)
    needed for package sym-0.12.0

@beojan
Copy link

beojan commented Nov 17, 2016

It seems this may be a problem again. with stack install pandoc -v, I get

[warn] Shallow package index repo detected, transitioning to a full clone...  
@(Stack/PackageIndex.hs:254:15)
2016-11-17 22:13:14.451684: [debug] Run process: /usr/bin/git fetch --unshallow                           
@(System/Process/Read.hs:277:3)
Updating package index Hackage (mirrored at https://github.com/commercialhaskell/all-cabal-hashes.git) ...

@ntc2
Copy link
Contributor

ntc2 commented Jan 20, 2017

I just experienced this. I saw

 stack init
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- QuickCheck.cabal

Selecting the best among 9 snapshots...

Downloaded lts-7.16 build plan.    
Shallow package index repo detected, transitioning to a full clone... 

and then a 5 minute wait with no output before getting

Fetching package index ...remote: Counting objects: 16667, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 16667 (delta 5947), reused 5940 (delta 5940), pack-reused 10687
Receiving objects: 100% (16667/16667), 9.74 MiB | 332.00 KiB/s, done.
Resolving deltas: 100% (7270/7270), completed with 2011 local objects.
From https://github.com/commercialhaskell/all-cabal-hashes
 - [tag update]      current-hackage -> current-hackage                                                                                                                                                             Fetched package index.    
Populated index cache.    
* Matches lts-7.16

Selected resolver: lts-7.16
Initialising configuration using resolver: lts-7.16
Total number of user packages considered: 1
Writing configuration to file: stack.yaml
All done.

@bollu
Copy link
Contributor

bollu commented Feb 10, 2017

I'm having the same experience. Running with --verbose at least shows what git clone is running

--verbose output

╰─$ stack init --verbose                                                                                                                           1 ↵
Version 1.3.0 x86_64 hpack-0.15.0
2017-02-10 20:10:40.435453: [info] Looking for .cabal or package.yaml files to use to init the project.
@(Stack/Init.hs:80:5)
2017-02-10 20:10:40.438341: [info] Using cabal packages:
@(Stack/Solver.hs:539:5)
2017-02-10 20:10:40.438412: [info] - simplexcc.cabal

@(Stack/Solver.hs:540:5)
2017-02-10 20:10:40.439479: [debug] Downloading snapshot versions file from https://s3.amazonaws.com/haddock.stackage.org/snapshots.json
@(Stack/Config.hs:169:5)
2017-02-10 20:10:42.876880: [debug] Done downloading and parsing snapshot versions file
@(Stack/Config.hs:171:5)
2017-02-10 20:10:42.877017: [info] Selecting the best among 9 snapshots...

@(Stack/BuildPlan.hs:764:5)
2017-02-10 20:10:42.877133: [debug] Trying to decode /Users/bollu/.stack/build-plan-cache/x86_64-osx/lts-7.19.cache
@(Data/Store/VersionTagged.hs:68:5)
2017-02-10 20:10:42.877269: [debug] Exception ignored when attempting to load /Users/bollu/.stack/build-plan-cache/x86_64-osx/lts-7.19.cache: /Users/bollu/.stack/build-plan-cache/x86_64-osx/lts-7.19.cache: openBinaryFile: does not exist (No such file or directory)
@(Data/Store/VersionTagged.hs:86:9)
2017-02-10 20:10:42.877669: [debug] Failure decoding /Users/bollu/.stack/build-plan-cache/x86_64-osx/lts-7.19.cache
@(Data/Store/VersionTagged.hs:75:13)
2017-02-10 20:10:42.877811: [debug] Decoding build plan from: /Users/bollu/.stack/build-plan/lts-7.19.yaml
@(Stack/BuildPlan.hs:496:5)
2017-02-10 20:10:44.482696: [debug] Trying to decode /Users/bollu/.stack/indices/Hackage/00-index.cache
@(Data/Store/VersionTagged.hs:68:5)
2017-02-10 20:10:44.623453: [debug] Success decoding /Users/bollu/.stack/indices/Hackage/00-index.cache
@(Data/Store/VersionTagged.hs:72:13)
2017-02-10 20:10:44.781960: [debug] Run process: /usr/local/bin/git clone https://github.com/commercialhaskell/all-cabal-hashes.git all-cabal-hashes/ -b display

@alexanderkjeldaas
Copy link
Contributor

My stack gets stuck for 3 hours until the CI times out now:

2017-11-12 23:12:42.201343: [info] Didn't see JuicyPixels-3.2.9.1 in your package indices.
Updating and trying again.
@(Stack/Fetch.hs:426:33)
2017-11-12 23:12:42.202082: [info] Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
@(Stack/PackageIndex.hs:422:23)
2017-11-12 23:12:42.204643: [info] Downloading timestamp
@(Stack/PackageIndex.hs:422:23)
2017-11-12 23:12:42.733632: [info] No updates to your package list were found
@(Stack/PackageIndex.hs:458:25)
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpcomplete.com/) ...

@isovector
Copy link
Contributor

I'm hitting this on Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2:

$ stack build --verbose
...
2019-06-15 14:12:02.435225: [info] Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
2019-06-15 14:12:02.439797: [info] Downloading timestamp
2019-06-15 14:12:02.813054: [info] Downloading snapshot
2019-06-15 14:12:02.867316: [info] Downloading mirrors
2019-06-15 14:12:02.923504: [info] Cannot update index (no local copy)
2019-06-15 14:12:02.923759: [info] Downloading index

where stack appears to hang.

@code2828
Copy link

code2828 commented Mar 5, 2020

Me too. Same problem with @isovector. Tried to install GLFW using stack, but also get stuck at [Info] Downloading index.

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

9 participants