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

Stop truncating all-cabal-hashes repo (#2175) #2464

Merged
merged 1 commit into from
Aug 13, 2016

Conversation

Blaisorblade
Copy link
Collaborator

@Blaisorblade Blaisorblade commented Aug 9, 2016

Fixes #2175.
This fix is quite minimal, and it comes with a significant slowdown for the first stack update, which is why I used "type: discuss" for this PR.

$ ./.stack-work/install/x86_64-osx/lts-6.0/7.10.3/bin/stack update
remote: Counting objects: 797395, done.
remote: Compressing objects: 100% (449683/449683), done.
remote: Total 797395 (delta 337171), reused 797302 (delta 337078), pack-reused 0
Receiving objects: 100% (797395/797395), 193.46 MiB | 4.16 MiB/s, done.
Resolving deltas: 100% (337171/337171), completed with 1 local object.

However, local tests confirm that #2175 disappers. Note that to see the results, one needs to remove various caches and the repo:

rm -f ~/.stack/build-plan-cache/x86_64-linux/lts-6.0.cache
rm ~/.stack/indices/Hackage/00-index.cache
rm -rf ~/.stack/indices/Hackage/git-update
stack update
stack setup --resolver lts-6.0 -v

I'd hope stack update would be enough without rm -rf ~/.stack/indices/Hackage/git-update, but I'm not sure.

EDIT: The AppVeyor failures are due to #2457; but for now I'd wait for a fix and a clean AppVeyor build just to be sure.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 12, 2016

I'd hope stack update would be enough without rm -rf ~/.stack/indices/Hackage/git-update, but I'm not sure.

I don't think it'll be sufficient. Gotta do git fetch --unshallow - http://stackoverflow.com/questions/6802145/convert-shallow-clone-to-full-clone

@Blaisorblade
Copy link
Collaborator Author

Thanks, didn't know that existed! Turns out I have to do --unshallow iff .git/shallow exists. Can do.

$ ls .git/
HEAD         config       description  hooks/       index        info/        logs/        objects/     packed-refs  refs/        shallow
$ git fetch --unshallow
remote: Counting objects: 54, done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 54 (delta 37), reused 42 (delta 26), pack-reused 0
Unpacking objects: 100% (54/54), done.
pgiarrusso [bluevelvet: ~/AeroFS/Repos/phd-thesis: 18:31: 7 (0)]
$ git fetch --unshallow
fatal: --unshallow on a complete repository does not make sense

@Blaisorblade Blaisorblade changed the title Stop truncating all-cabal-hashes repo (#2175) [HOLD] Stop truncating all-cabal-hashes repo (#2175) Aug 13, 2016
@Blaisorblade
Copy link
Collaborator Author

Testing transition locally by hand in parallel with CI, so don't merge yet (hence [HOLD]).

Fix #2175.

* Fetch full history of tags (in particular, `current-hackage`).
* Before fetching tags, transition previously shallow repos to be
  non-shallow with `fetch --unshallow`.
* Fetch full history in initial clone, otherwise, we immediately
  afterwards use `fetch --unshallow`.

This means that the initial fetch and later updates require more data,
proportional to the entire repository history; however, reducing data
usage again is not trivial and would require changes in the layout of
all-cabal-hashes, as discussed in #2175.
@Blaisorblade Blaisorblade changed the title [HOLD] Stop truncating all-cabal-hashes repo (#2175) Stop truncating all-cabal-hashes repo (#2175) Aug 13, 2016
@Blaisorblade Blaisorblade merged commit 54368c1 into master Aug 13, 2016
@Blaisorblade Blaisorblade deleted the 2175-dont-truncate-repo branch August 13, 2016 13:23
@Blaisorblade
Copy link
Collaborator Author

Local and CI testing completed, and no opposition heard, hence merging.

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

Successfully merging this pull request may close these issues.

"Right Nothing" printed to the console during setup
4 participants