[IDE 2.3.4] Change of cache directory?

I had a shortcut in windows pointing to the cache C:\Users\bugge\AppData\Local\Temp\arduino
Since IDE 2.3.4, the location seems to have changed to C:\Users\bugge\AppData\Local\arduino

  1. Have I been wrong all the time?
  2. Was the change intentional or by accident?

I think I heard of another folder change as well. Perhaps the release notes make mention of it.

I could not find release notes (except for the info in the pinned topic).

I also could not find it reading through Comparing 2.3.3...2.3.4 · arduino/arduino-ide · GitHub; I did however did not dig through all the links in there.

Since it's not something the average user would care about maybe they just didn't bother documenting it.

There have been cases where users do care. Like when wants to access the directory, like maybe look at map file, or when the cached data gets messed up, and instructions have been to go to that directory and erase it…

Also before the disk cleanup utilities would clean it up, which was a blessing and a curse. As sometimes it would do so while sketch still open.

This change, released with arduino-cli v1.1.1, appears to be intentional

* Use default user's cache dir instead of tmp for build cache

which is this addition in internal/cli/configuration/configuration.go further down

// getDefaultBuildCacheDir returns the full path to the default build cache folder
func getDefaultBuildCacheDir() string {
	var cacheDir *paths.Path
	if p, err := os.UserCacheDir(); err == nil {
		cacheDir = paths.New(p)
	} else {
		// fallback to /tmp
		cacheDir = paths.TempDir()
	}
	return cacheDir.Join("arduino").String()
}

os.UserCacheDir says

2 Likes

Thanks @kenb4 for the link.

@KurtE, that's one of the reasons. And as long as the IDE does not have a "clean build" option, I use it to make sure that I can build from scratch.

Thanks @kenb4!

This change should provide a significant performance improvement for Linux and macOS users. Those operating systems automatically clear the temporary folder, which would cause the loss of the cached compiled core, library, and sketch objects and thus a full recompile when the cache was stored there. By moving it to the cache folder, it allows Arduino CLI to exclusively manage its cache (it does have its own automatic clean up mechanism).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.