-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add possibility to set vcpkg ref #5837
Conversation
Looks cool. Too bad I don't understand how this caching thing works, so I don't think I should be the one to approve it. Do I get it right that this could be quite useful in the long run too, because with this in place we would be able to pin vcpkg versions, so not only would we be more resistant to random breakages, but also we could spare a lot of rebuilding the cache? One possible improvement: Could the pinned vcpkg commit be stored in a repo variable instead of committing it into the repo on every update? |
Thanks for pointing this out. I was thinking about a way to store the ref outside the source, but didn't know about repo variables. I changed it now, however I do not have the rights in this repo to create one. |
Yes, we can pin it to a working version to keep reusing existing caches until we update the ref.
Let me try to explain the concept:
|
I don't have the right to access repo vars either. Thanks for the explanation. I've also read about caching in the workflow docs. |
👍
done |
Doesn't seem to work :(
|
That's a shame. It also doesn't seem to take the variables from the respective fork, as I also added it to mine...
|
I vote for this. I didn't expect that variables would be protected so hard. There's another thing I don't understand though. The vcpkg commit IDs in the cache IDs (6f7b416c7 for the good one, b81bc3a83 for the failed one) are different from any commit IDs I see in the vcpkg repo. The PR was 69efe9c, and I can't see any b81bc3a in the history of their master either. Can this be because of the shallow checkout? But then there wouldn't have been cache hits in the builds.
Do you mean creating a new cache that only stores the vcpkg commit ID? |
microsoft/vcpkg@b81bc3a83 is the current version used in the runner images (also see Windows2022-Readme.md)
Yes, to transfer the information into pull request workflows. But for now we can use the file approach. |
This reverts commit 7d7c823.
Ah, I see, it's on page 3. My mistake, I thought the other commits were older.
Let's hope we won't often have to rely on PRs... I believe it would be best to always store the commit hash. So for now, we may use microsoft/vcpkg@69efe9c (vcpkg master after merging microsoft/vcpkg#30546). How often should we update it later? Stay on one as long as it works? |
Ok, it should run through now. The workflow already picked up the correct version
We can think about creating a workflow which runs once a week on the latest commit. If it runs through it could automatically create a PR to update the version. |
👍
Why not just commit it directly? |
That would be too easy 😆. Of course this is also possible. |
Well, if you want to update so often and automatically, would it be possible to try the latest deployed one? But do we really want commits changing a minor config file almost every week? (OK, I know, I'm the one on Debian oldstable… ;) |
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's through all cache uses now without problems.
Thank you for fixing it.
@Noordfrees Can we merge it as it is to be able to get all PRs green? I guess the auto-update can go in a separate PR. That will be harder to validate.
And otherwise, when it fails, open a bug, so that we don't miss when manual action may be needed. |
After merging to master, I suggest to wait for the "Build vcpkg packages" job to finish, before merging into other branches, so they can then use the new cache. |
Type of change
New feature
Issue(s) closed
Fixes #5836
New behavior
Added a file
vcpkg_ref
to manually select a vcpkg version to use. ATM it is set to thecommit of the last successful binary cache, so it should at least allow buildingpull request which points to a working archive.Additional context
Once the packages are fixed,
vcpkg_ref
can be changed to an empty file to re-enable the standard runner version.