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

Use custom snapshots #597

Merged
merged 2 commits into from
Feb 2, 2019
Merged

Use custom snapshots #597

merged 2 commits into from
Feb 2, 2019

Conversation

neongreen
Copy link
Contributor

This uses Stack's custom snapshot feature (https://docs.haskellstack.org/en/stable/custom_snapshot/). A custom snapshot extends the set of packages in the resolver and can be used from any other project (including other Wire repos). No more copying parts of stack.yaml from one project to another.

Custom snapshots are stored in ~/.stack. This has several benefits:

  • They survive stack clean. (Well, Git deps have to be cloned anyway because of a bug in Stack, but they won't be recompiled, only recloned, and for the biggest deps I've switched to using tarballs so that should be faster.)

  • They survive branch switches (i.e. if different package versions are used in different branches, no recompiling is necessary when switching between the two).

  • We no longer need to cache both .stack and .stack-work on CI.

A thing to keep in mind is that snapshots are immutable. A snapshot can be based on the previous version of the snapshot, but Stack takes a bit of time to symlink everything from the older snapshot to the newer one, so having a new snapshot every day would be inadvisable. For that reason packages that change frequently (like hscim) should remain in stack.yaml.

snapshots/wire-1.0.yaml Outdated Show resolved Hide resolved
@neongreen
Copy link
Contributor Author

Should be updated after the SCIM PR is merged

@neongreen neongreen merged commit 9fac523 into develop Feb 2, 2019
@neongreen neongreen deleted the snapshot branch February 2, 2019 19:47
This was referenced Feb 14, 2019
@neongreen neongreen mentioned this pull request Feb 18, 2019
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.

3 participants