-
Notifications
You must be signed in to change notification settings - Fork 238
Build: Cache brew/create-dmg install #2420
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
Build: Cache brew/create-dmg install #2420
Conversation
0223724 to
2fa0a6c
Compare
|
Doesn't work yet, probably some path missing: |
29c78fb to
1167911
Compare
This comment was marked as outdated.
This comment was marked as outdated.
3420e35 to
276fb61
Compare
|
Mac installs mean nothing to me. Was there something specific you were thinking of? |
276fb61 to
8afb73c
Compare
Hm, if I only knew... I might have confused this PR with another one. Sorry. Will ping softins once all problems with this PR are fixed. |
df9c00a to
10b6e8f
Compare
mac/deploy_mac.sh
Outdated
| brew extract --version="${create_dmg_version}" create-dmg homebrew/cask | ||
| brew install --build-bottle --formula "${formula}" | ||
| brew bottle "${formula}" |
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.
Isn't it duplicate work if we run reinstall?
Why can't we just use an if/else?
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.
The problem is that --build-bottle seems to disable postinst scripts. I'm not sure if aqt uses those at all, but it might at some point, so I'd rather be on the safe side here.
There's also the option of running the postinst scripts explicitly. I chose the reinstall path though as it most closely ensures that both paths are really similar.
I should probably add a comment though.
The plain (re)install is really small, btw. Cloning the repo and searching for the right version seems to be the resource-intensive part.
Side note: The PR still doesn't work as it should, therefore it's still a draft again. When testing with a fake build (no compile), the logic works, while in the real build it doesn't (= always a fresh build). I'm probably missing something.
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.
Changed that part now to make it clearer (uninstall package & add comment + regular install later).
Testing still not finalized, will continue tomorrow.
9cf292f to
10c6cdc
Compare
|
Finally. Please do not squash-merge. First run:
Second run:
|
pljones
left a comment
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.
I can't find the Action in hoffie:actions-cache-create-dmg for this to check but it seems clean in the PR build.
ann0see
left a comment
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.
To me it still seems a bit strange to install and then uninstall the thing. But I'll probably need to be happy with that. Another possible step would be to ask on the brew forum how they do caching.
The links I provided pointed to two different runs as part of this PR.
If you felt better with the other path (
The cache part isn't that complex at all. What makes most of the lines is the version-specific download, build and packaging. |
|
Hmm. If your approach is better performance wise, we should go with that (and make the comment even clearer why we didn't choose the other approach). |
mac/deploy_mac.sh
Outdated
| # uninstall again to ensure that we can install the package freshly without leftovers afterwards: | ||
| brew uninstall "${pkg_version}" |
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.
Something like "since brew install doesn't run postinst scripts, we are uninstalling it before later on installing it again [...]"
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.
I've reworked the comment again.
(It's not about performance, it's more about correctness)
Failing to do so will lead to a missing cache reset when updating e.g. create-dmg's vesion. Related: jamulussoftware#2412
8cd1b29 to
6b48f6d
Compare
softins
left a comment
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.
I looked at the workflow log and could see that on the first run, no cached files were found.
I then selected "Re-run all jobs" and observed the Mac build. This time it found the cached files, and the build continued successfully.
Short description of changes
The Mac build installs create-dmg via brew. The install is already version-pinned.
This PR caches the resulting install and adds the file which does the version pinning to the cache key.
Context: Fixes an issue?
Fixes #2412
Does this change need documentation? What needs to be documented and how?
No
CHANGELOG: SKIP
(I've included this PR in #2207 (comment))
Status of this Pull Request
Ready.
What is missing until this pull request can be merged?
Reviews.
Checklist
My code follows the style guide