-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Include image version in computed cache key #75
Conversation
@@ -116,6 +116,11 @@ export class Utils { | |||
|
|||
key += "-args=" + Utils.hashCode(core.getInput(runvcpkglib.vcpkgArguments)); | |||
key += "-os=" + Utils.hashCode(process.platform); | |||
|
|||
if (process.env.ImageVersion) { | |||
key += "-imageVer=" + Utils.hashCode(process.env.ImageVersion); |
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.
Should IMAGE_VERSION
be used instead, given this context?
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.
Ah, I'd missed that - yes, I suspect so.
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 switched this to use IMAGE_VERSION
, and have also added a preference for IMAGE_OS
instead of process.platform
in the "os" key.
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.
Hm, no, I think those variables are only used when configuring the VMs, but are not accessible at “runtime”. ImageVersion / ImageOs seem to be the intended variables to use. I’ll fix this 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.
The only side-effect of these changes is that the existing cached artifacts are all invalidated. This means I will publish a run-vcpkg@v7
, i.e. bumpoing the major version, as this going to force existing workflows to regenerate all cached artifacts.
9e67bba
to
0264890
Compare
0264890
to
d547a12
Compare
@orudge Looks good to me, thanks! |
This hopefully offers a fix for #69, which we have been encountering. The latest update fixed the issue not being reported, but we still had issues because the version that had been cached was too old and was throwing compile errors.
ImageOS
is also exported as an environment variable (for all of Windows, Linux, macOS on GitHub Actions) though I haven't used it here. It may be worth incorporating it too, or replacing the use ofprocess.platform
withprocess.env.ImageOS
.(It may be the
if
statement is also redundant, and we can always assume these variables are present.)