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

Include image version in computed cache key #75

Merged
merged 1 commit into from
Feb 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/vcpkg-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ export class Utils {
}

key += "-args=" + Utils.hashCode(core.getInput(runvcpkglib.vcpkgArguments));
key += "-os=" + Utils.hashCode(process.platform);
key += "-os=" + Utils.hashCode(process.env.ImageOS ? process.env.ImageOS : process.platform);

if (process.env.ImageVersion) {
key += "-imageVer=" + Utils.hashCode(process.env.ImageVersion);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Owner

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.

}

key += "-appendedKey=" + Utils.hashCode(appendedCacheKey);

// Add the triplet only if it is provided.
Expand Down