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-setup-2.yaml gets out of date #99

Open
judah opened this issue Aug 30, 2018 · 1 comment
Open

stack-setup-2.yaml gets out of date #99

judah opened this issue Aug 30, 2018 · 1 comment

Comments

@judah
Copy link
Owner

judah commented Aug 30, 2018

The stack-setup-2.yaml file occasionally gets out of date -- in particular, every time there's a new version of GHC:

$ pier build haskell-src-exts
Error when running Shake build system:
* Library haskell-src-exts
* GHC StackageGhc, version 8.4.3, built-in packages containers, ghc-prim, ghc-boot, ghci, template-haskell, terminfo, ghc-boot-th, binary, deepseq, base, filepath, hpc, ghc, rts, unix, array, process, pretty, transformers, bytestring, directory, integer-gmp, time
Couldn't find GHC version8.4.3

To fix it, currently you need to delete ~/.pier/downloads/stackage/setup/stack-setup-2.yaml and then run pier clean.

Other downloaded files (e.g. LTS versions, package tarballs) have version numbers in their names (and are in theory supposed to be frozen) so are less vulnerable to this issue.

We'll have to look into what Stack does. Some possible workarounds:

  • At minimum, we we should be able to give a better error message when this occurs (and potentially not require an explicit pier clean).
  • We could download it for every (non-clean?) build, and save it somewhere (with the git hash in its filename). Unfortunately this breaks "airplane mode".
  • We could provide an explicit command (maybe pier setup or pier refresh?) that "invalidates" it, i.e., causes pier to re-download it again the next time. And, perhaps, mark downloads by whether or not they need to be re-downloaded.
@bergey
Copy link

bergey commented Jul 1, 2019

Is it safe to assume that this yaml file is append-only? That is, any entry in the local copy is valid, but the server copy may include more entries that we don't yet know about. Then we can handle the common cases by checking the local copy first, fetching the remote if we don't have the requested key locally, and fetch at most once per invocation. I think this is how stack handles the Hackage index.

If this seems like the right approach, I'm happy to take a stab at implementing it.

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