How can I change GNOME Builder's `cache_dir`?

I keep my projects on a different drive from the default cache directory. As a result, I can’t build any of them.

The state dir (/home/demna/Storage/Projects/Rust/tungsten-gtk/.flatpak-builder) is not on the same filesystem as the target dir (/home/demna/.var/app/org.gnome.Builder/cache/gnome-builder/projects/tungsten-gtk/flatpak/staging)

This could be solved by moving the cache directory to the same drive, but I can’t figure out how to do that.

Alternative solutions are welcome.

This is:

The best available workaround is a symlink, apparently.

2 Likes

That doesn’t seem to work. I created a symlink at the project root called .cache targeting the project directory over at cache_dir (~/.var/app/org.gnome.Builder/cache/gnome-builder/projects/tungsten-gtk), but that hasn’t changed anything. Did I misunderstand?

.
├── .cache -> /home/demna/.var/app/org.gnome.Builder/cache/gnome-builder/projects/tungsten-gtk
├── Cargo.toml
├── data
│   ├── ...
├── .flatpak-builder
│   ├── ...
├── meson.build
├── org.demna.Tungsten.json
├── po
│   ├── ...
├── README.md
└── src
    ├── ...

Perhaps this is because the project/state directory is a bind mount? Frankly, I don’t remember what bind mounts really do—I just went along with a tutorial to get it to work—but the project drive is mounted at ~/Storage, so that may be messing with things. The issue you linked had the projects at a wholly different location (/c/...).

Builder Nightly has support to set the cache directory in Preferences → Build & Tooling → Storage. Set it to a directory on the same file system as your projects. By default, Nightly will use whatever your configured projects directory is /.gnome-builder. (See Preferences → Projects → Project Creation for projects directory).