# One Zig folder to store them all?

**URL:** <https://ziggit.dev/t/one-zig-folder-to-store-them-all/8361>\
**Category:** Brainstorming\
**Tags:** build-system\
**Created:** [February 4, 2025, 5:07pm UTC](https://ziggit.dev/t/one-zig-folder-to-store-them-all/8361 "2025-02-04T17:07:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![matklad](https://ziggit.dev/user_avatar/ziggit.dev/matklad/32/2462_2.png) [@matklad](https://ziggit.dev/u/matklad)\
**Post date:** [February 4, 2025, 5:07pm UTC](https://ziggit.dev/t/one-zig-folder-to-store-them-all/8361/1 "2025-02-04T17:07:31Z")

</div>

This is a crazy idea, and I am not a priori claiming that it is useful, but I keep coming back to it every once in a while, so I figured I might as well write it down, if only to get rid of an intrusive thought!

# Problem

Today, Zig typically needs a bunch of stuff in the root of the project to work:

```zig
/build.zig
/build.zig.zon
/zig-out
/zig-cache

```

This isn’t a big problem at all, but it is still inconvenient for those who like to keep the root tidy. Plus, there’s usually a number of related files — `zls` config, a script to download a zig compiler or a configuration for zig version manager.

# Solution

So, what if we do the following?

```zig
/zig/build.zig
/zig/build.zig.zon
/zig/out
/zig/.cache
/zig/zls.json
/zig/.gitignore

```

And if, four example, you have a script to fetch a zig compiler, and you prefer to _not_ install `zig` globally and use it per-project, you can do

```zig
./zig/download.sh 
./zig/zig build

```

(any resemblance to TigreBeetle’s build process is purely coincidental)

Any thoughts on how terrible this would be in practice?

---

_[View the full topic](https://ziggit.dev/t/one-zig-folder-to-store-them-all/8361)._
