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

cabal will download from hackage.haskell.org even when remote-repo is set #3914

Closed
caizixian opened this issue Sep 29, 2016 · 2 comments
Closed

Comments

@caizixian
Copy link

I added remote-repo: mirrors.tuna.tsinghua.edu.cn:http://mirrors.tuna.tsinghua.edu.cn/hackage to .cabal/config to speed up downloading.

However, there are still some temp download files at /home/me/.cabal/packages/hackage.haskell.org whose size is increasing during cabal update, for example, 00-index.tar18042893831714636915.gz1957747793424238335.tmp .

The cabal update seems hung after

Downloaded to
/home/me/.cabal/packages/mirrors.tuna.tsinghua.edu.cn/00-index.tar.gz
Updating index cache file
/home/me/.cabal/packages/mirrors.tuna.tsinghua.edu.cn/00-index.cache

This renders the mirror repo useless because cabal need to wait the downloadings from hackage.haskell.org to complete which is slow.

Here is the output of cabal update -v3

cabal update -v3
Downloading the latest package lists from:
- hackage.haskell.org
- mirrors.tuna.tsinghua.edu.cn
Searching for curl in path.
Found curl at /usr/bin/curl
Searching for powershell in path.
Cannot find powershell on the path
Searching for wget in path.
Found wget at /usr/bin/wget
Selected http transport implementation: curl
Sending:
GET /hackage/00-index.tar.gz HTTP/1.1
Sending:
Host: mirrors.tuna.tsinghua.edu.cn
GET /00-index.tar.gz HTTP/1.1
User-Agent: cabal-install/1.24.0.0 (linux; arm)
Host: hackage.haskell.org

User-Agent: cabal-install/1.24.0.0 (linux; arm)

Creating new connection to mirrors.tuna.tsinghua.edu.cn
Creating new connection to hackage.haskell.org
Received:
HTTP/1.1 200 OK
Server: nginx/1.10.1
Date: Thu, 29 Sep 2016 12:38:32 GMT
Content-Type: application/octet-stream
Content-Length: 12903195
Last-Modified: Thu, 29 Sep 2016 12:31:53 GMT
Connection: keep-alive
ETag: "57ed09b9-c4e31b"
Strict-Transport-Security: max-age=31536000
Accept-Ranges: bytes

Received:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.1
Content-Type: text/plain; charset=UTF-8
Location: /packages/index.tar.gz
Via: 1.1 varnish
Fastly-Debug-Digest:
87d259557af1d7cacf2306a6fafc4d767c244d79f3c234fa484796d7d8659ccb
Content-Length: 0
Accept-Ranges: bytes
Date: Thu, 29 Sep 2016 12:41:27 GMT
Via: 1.1 varnish
Age: 64
Connection: keep-alive
X-Served-By: cache-dfw1825-DFW, cache-lcy1128-LCY
X-Cache: HIT, HIT
X-Cache-Hits: 1, 1
X-Timer: S1475152887.662176,VS0,VE0

301 - redirect
Redirecting to http://hackage.haskell.org/packages/index.tar.gz ...
Sending:
GET /packages/index.tar.gz HTTP/1.1
Host: hackage.haskell.org
User-Agent: cabal-install/1.24.0.0 (linux; arm)

Recovering connection to hackage.haskell.org
Received:
HTTP/1.1 200 OK
Server: nginx/1.10.1
Content-Type: application/x-gzip
Cache-Control: public, no-transform, max-age=300
Content-MD5: 9UOoU+ZZ0Edd3vnXeU6MUw==
ETag: "f543a853e659d0475ddef9d7794e8c53"
Last-Modified: Thu, 29 Sep 2016 10:27:24 GMT
Via: 1.1 varnish
Fastly-Debug-Digest:
f8e6108609419bcce324ffc55abb81b577ac9e1f074da985d98deec148e72b15
Content-Length: 12903195
Accept-Ranges: bytes
Date: Thu, 29 Sep 2016 12:41:31 GMT
Via: 1.1 varnish
Connection: keep-alive
X-Served-By: cache-dfw1833-DFW, cache-lcy1128-LCY
X-Cache: HIT, HIT
X-Cache-Hits: 0, 0
X-Timer: S1475152891.312478,VS0,VE1

Downloaded to
/home/me/.cabal/packages/mirrors.tuna.tsinghua.edu.cn/00-index.tar.gz
Updating index cache file
/home/me/.cabal/packages/mirrors.tuna.tsinghua.edu.cn/00-index.cache

Here is my cabal version

cabal --version
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library 
@dcoutts
Copy link
Contributor

dcoutts commented Oct 1, 2016

Ah, I'm afraid you've misunderstood what the remote-repo does. If you provide multiple ones then these are not treated as mirrors of each other, rather they are independent repos and cabal gets both and takes the union of them.

You can see this hinted at when it says:

Downloading the latest package lists from:
- hackage.haskell.org
- mirrors.tuna.tsinghua.edu.cn

If you want to use a mirror then specify that one only.

Note that the new secure repo format also includes the ability to use mirrors and do quick incremental updates of the package list (though the initial download is a little larger). cabal-install-1.24 can opt-in to use this, and it's the default in 1.25.

@dcoutts dcoutts closed this as completed Oct 1, 2016
@caizixian
Copy link
Author

So how do I modify my cabal config to use the url as mirror?

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

2 participants