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

Fix #146: use compiler hash instead of volatile mtime #147

Merged
merged 2 commits into from
Sep 8, 2023
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
9 changes: 6 additions & 3 deletions src/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ async function restore(ccacheVariant : string) : Promise<void> {
}
}

async function configure(ccacheVariant : string) : Promise<void> {
async function configure(ccacheVariant : string, platform : string) : Promise<void> {
const ghWorkSpace = process.env.GITHUB_WORKSPACE || "unreachable, make ncc happy";
const maxSize = core.getInput('max-size');

if (ccacheVariant === "ccache") {
await execBash(`ccache --set-config=cache_dir='${path.join(ghWorkSpace, '.ccache')}'`);
await execBash(`ccache --set-config=max_size='${maxSize}'`);
await execBash(`ccache --set-config=compression=true`);
if (platform === "darwin") {
await execBash(`ccache --set-config=compiler_check=content`);
}
core.info("Cccache config:");
await execBash("ccache -p");
} else {
Expand Down Expand Up @@ -189,8 +192,8 @@ async function runInner() : Promise<void> {
await restore(ccacheVariant);
core.endGroup();

core.startGroup(`Configure ${ccacheVariant}`);
await configure(ccacheVariant);
core.startGroup(`Configure ${ccacheVariant}, ${process.platform}`);
await configure(ccacheVariant, process.platform);
await execBash(`${ccacheVariant} -z`);
core.endGroup();
}
Expand Down