zig icon indicating copy to clipboard operation
zig copied to clipboard

default local cache directory to `.zig-cache` instead of `zig-cache`

Open andrewrk opened this issue 1 year ago • 4 comments

This plays nicely with more tooling. For example, text editors will typically exclude this directory from "find in files" features. It communicates to new users of Zig that these files are ephemeral. I apologize for not getting this right the first time.

zig-out is unchanged.

andrewrk avatar May 26 '24 17:05 andrewrk

and zig-out is unchanged, right?

thejoshwolfe avatar May 26 '24 18:05 thejoshwolfe

Normally you would add zig-cache and zig-out to .gitignore (or any other vcs ignore file) and most editors automatically ignore anything in .gitignore, this change might not be necessary.

AshishBhattarai avatar May 27 '24 04:05 AshishBhattarai

Some points against this change:

  1. In frontend development, node_modules directory does not have leading . still everything works out
  2. Makes it slightly harder to clean all build artifacts as you can't do rm -rf zig-*

par5er avatar May 27 '24 08:05 par5er

I fully support this change, and it would definitely be a minor QoL improvement.

  • Adding to .gitignore, while widely supported by most editors, only works for projects that utilize a VCS. Sometimes one is just pumping out a throwaway script to accomplish a one-time task, and does not want to create a repo and configuration files just to navigate their files efficiently.
  • More importantly, it expresses intent better: with a few exceptions, a cache containing generated files that are of no relevance to a human are in a dot-directory. This change would make Zig compliant with that common convention.

ForeverZer0 avatar May 28 '24 06:05 ForeverZer0