zig icon indicating copy to clipboard operation
zig copied to clipboard

Add the CACHEDIR.TAG file to the cache directory

Open perillo opened this issue 2 years ago • 2 comments

Implement the http://www.brynosaurus.com/cachedir/ specification for the Zig cache directory.

This change will make it easier to exclude Zig cached data from a backup, expecially when the directory is not a well-known cache directory, like ~/.cache/zig or zig-cache.

Closes #8210

perillo avatar Mar 10 '23 16:03 perillo

For @r00ster91: I don't why I don't see your comment here (maybe you deleted it?). I used the link http://www.brynosaurus.com/cachedir/ instead of the actual link after a redirect (https://bford.info/cachedir/) because this is what the specification suggested.

While it is true that the specification has not been updated since 2004, some implementations like Kopia use the original link.

perillo avatar Mar 11 '23 10:03 perillo

On Linux the CI scripts fail with unimplemented. I'm not sure if this is related to this changeset.

perillo avatar Mar 11 '23 10:03 perillo

The error from the CI is

[15/21] Running zig1.wasm to produce /home/ci/actions-runner1/_work/zig/zig/build-new/compiler_rt.c
FAILED: compiler_rt.c 
cd /home/ci/actions-runner1/_work/zig/zig && /home/ci/actions-runner1/_work/zig/zig/build-new/zig1 /home/ci/actions-runner1/_work/zig/zig/lib build-obj lib/compiler_rt.zig -ofmt=c -OReleaseSmall --name compiler_rt -femit-bin="/home/ci/actions-runner1/_work/zig/zig/build-new/compiler_rt.c" --mod build_options::/home/ci/actions-runner1/_work/zig/zig/build-new/config.zig --deps build_options -target x86_64-linux
unimplemented
Aborted
[16/21] Running zig1.wasm to produce /home/ci/actions-runner1/_work/zig/zig/build-new/zig2.c
FAILED: zig2.c 
cd /home/ci/actions-runner1/_work/zig/zig && /home/ci/actions-runner1/_work/zig/zig/build-new/zig1 /home/ci/actions-runner1/_work/zig/zig/lib build-exe src/main.zig -ofmt=c -lc -OReleaseSmall --name zig2 -femit-bin="/home/ci/actions-runner1/_work/zig/zig/build-new/zig2.c" --mod build_options::/home/ci/actions-runner1/_work/zig/zig/build-new/config.zig --deps build_options -target x86_64-linux
unimplemented

Should the tagCacheDirectory function be a no op when the target is wasm?

Thanks.

perillo avatar Mar 24 '23 08:03 perillo

@Vexu I don't think this should be merged as-is because it should not block the rest of the compilation pipeline. I think it should be done as an asynchronous job that gets completed by performAllTheWork().

Anyway, closing this now since it's an abandoned PR that never passed the CI checks. @perillo can ask for help in the issue corresponding to this PR. I like to keep the PR queue filled with only patches that are considered ready for review & merge by their authors.

andrewrk avatar Jun 17 '23 23:06 andrewrk