hendrikmuhs / ccache-action

github action to speedup building using ccache
MIT License
114 stars 52 forks source link

can't save ccache in window #144

Closed sunflower-knight closed 1 year ago

sunflower-knight commented 1 year ago

Cache location Local disk: "D:\a\yalantinglibs\yalantinglibs/.sccache" Save cache using key "sccache-windows_msvc-Debug-ssl( OFF )-arch-amd64-2023-04-16T00:17:33.507Z". Warning: Saving cache failed: Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

after compile , ccache can't be saved in right way

sunflower-knight commented 1 year ago

I use windows+msvc+cmake+sccach after building, my cache can't be save.

sunflower-knight commented 1 year ago

I fork it and change something I try to modify the path

async function configure(ccacheVariant : 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`);
    core.info("Cccache config:");
    await execBash("ccache -p");
  } else {
    const options = `SCCACHE_IDLE_TIMEOUT=0 SCCACHE_DIR='${ghWorkSpace}\\.sccache' SCCACHE_CACHE_SIZE='${maxSize}'`;
    await execBash(`env ${options} sccache --start-server`);
  }

}
  const options = `SCCACHE_IDLE_TIMEOUT=0 SCCACHE_DIR='${ghWorkSpace}\\.sccache' SCCACHE_CACHE_SIZE='${maxSize}'`;

And here is the output in the end

Cache location                  Local disk: "D:\\a\\yalantinglibs\\yalantinglibs\\.sccache"
  Version (client)                0.4.1
Save cache using key "sccache-windows_msvc-Debug-ssl( OFF )-arch-x86-20[23](https://github.com/sunflower-knight/yalantinglibs/actions/runs/4712621535/jobs/8357780757#step:17:23)-04-16T09:43:41.001Z".
Warning: Saving cache failed: Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.