feature: write CACHEDIR.TAG into program folder#2311
Conversation
This PR suggest to write a `CACHEDIR.TAG` file into the program folder. The tag is an attempt to signal (e.g. to backup software) that the containing folder contains no archival value. While the convention started with cache directories for things like thumbnails of a webbrowser, I'd argue the same argumentation (no archival value, frequent changes, un-suiteable to be located in `/var/cache` or `/tmp`) apply for build folders. We could also a library like https://pypi.org/project/cachedir-tag/. I thoght writing a file is simple enough.
CACHEDIR.TAG into program folder
dace/codegen/compiler.py
Outdated
| hfile.write(contents) | ||
|
|
||
| # Write cachedir tag | ||
| with open(os.path.join(out_path, "CACHEDIR.TAG"), "w") as f: |
There was a problem hiding this comment.
please add if not identical_file_exists or even os.path.exists (cheaper, better) so that we avoid extraneous I/O. This was also a pertinent discussion item in the original CACHEDIR.TAG pull requests.
There was a problem hiding this comment.
It sounds like this was discussed before? I've checked old PRs/issues and I couldn't find a reference. I also was at the DaCe meeting today and Yakup wouldn't remember so he deferred to your historic knowledge.
Let me know what you think about the current state of the PR. I've changed it to only write the CACHEDIR.TAG if not already present. In the end, I think this is minor and I am fine either way.
There was a problem hiding this comment.
It sounds like this was discussed before? I've checked old PRs/issues and I couldn't find a reference. I also was at the DaCe meeting today and Yakup wouldn't remember so he deferred to your historic knowledge.
Let me know what you think about the current state of the PR. I've changed it to only write the CACHEDIR.TAG if not already present. In the end, I think this is minor and I am fine either way.
|
cscs-ci run |
This PR suggest to write a
CACHEDIR.TAGfile into the program folder. The tag is an attempt to signal (e.g. to backup software) that the containing folder contains no archival value, see http://www.brynosaurus.com/cachedir/.While the convention started with cache directories for things like thumbnails of a webbrowser, I'd argue the same argumentation (no archival value, frequent changes, un-suiteable to be located in
/var/cacheor/tmp) apply for build folders.Instead of writing the file by hand, we could also a library like https://pypi.org/project/cachedir-tag/.