-
Notifications
You must be signed in to change notification settings - Fork 4
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
Misc improvements #27
Conversation
dbb1906
to
4340477
Compare
.github/workflows/build.yml
Outdated
- name: wasm-cabal-cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: nix-build-cache-${{ github.run_id }} | ||
restore-keys: nix-build-cache- | ||
path: | | ||
~/.ghc-wasm/.cabal/store | ||
dist-newstyle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of cache is probably good enough for this repo (we also use it for Ormolu Live), but it has the notorious unbounded cache growth problem because nothing is ever deleted from the Cabal store. (Usually, this doesn't end up being a big problem because of a combination of sufficiently slow growth, cache expiry and manual deleting cache entries.)
I have been wanting to try out @andreabedini's https://github.com/andreabedini/cabal-cache-native that promises to do this properly, we could try it here. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea! And TIL cabal-cache-native
, I'll give it a try instead of the home cooked cache here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately the action doesn't seem to work for our case yet: https://github.com/tweag/ghc-wasm-miso-examples/actions/runs/11872593951
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense to revert to actions/cache
in that case. Thanks for putting in the effort for trying it out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries! The time is not wasted, given we have an extra step to generate plan.json
now I'm hashing plan.json
as cache key to avoid uploading the whole store each single time, let's see if that'll work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works! I'm landing this patch. You might want to do something similar in ormolu. There's a slight downside that if plan.json
doesn't change but home module source is changed, then there won't be a new cache with updated dist-newstyle
and home modules may see more recompilation in ci. I think that's not a big deal though.
6a8fc1c
to
9a082d7
Compare
eb7e8ff
to
fddf4b0
Compare
-H64m
toGHCRTS
to reduce amortized gc overhead