Created attachment 224670 [details] XDG_CACHE_HOME.patch Currently XDG_DATA_HOME and XDG_CONFIG_HOME are set in CONFIGURE_ENV and MAKE_ENV. The attached patch also sets XDG_CACHE_HOME. Without XDG_CACHE_HOME some software (for ex. https://github.com/coursier/coursier) still writes into /home/{user}/.cache. My guess is that they compute the string /home/{user}/.cache based on the current user name, because it isn't mentioned anywhere else in the environment. XDG_CACHE_HOME is described in the XDG Base Directory Specification (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). Setting XDG_CACHE_HOME along with CONFIGURE_ENV and MAKE_ENV is a natural thing to do.
So is an exp-run the next step here?
This breaks editors/vscode: http://package18.nyi.freebsd.org/data/122amd64-default-foo/2021-06-16_20h32m55s/logs/errors/vscode-1.56.2.log
(In reply to Antoine Brodin from comment #2) So AFAICT the easiest solutions to this are to either a) replace ${WRKDIR}/.cache with ${WRKDIR} in editors/vscode b) move XDG_CACHE_HOME to ${WRKDIR}/.cache generally. Part of the spec is that applications should create that directory if it does not exist, so I guess we do not have to create it. Maybe this is also slightly less messy than dumping the cache straight into ${WRKDIR} Any preferences?
Created attachment 225950 [details] XDG_CACHE_HOME-with-cache-subdir.patch Updating the patch to use XDG_CACHE_HOME=${WRKDIR}/.cache
Ping about exp-run with new patch?
Exp-run looks fine
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=79ac62f35b153e536185a32d12366dc0ccdc1245 commit 79ac62f35b153e536185a32d12366dc0ccdc1245 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2021-10-06 08:58:20 +0000 Commit: Tobias Kortkamp <tobik@FreeBSD.org> CommitDate: 2021-10-06 12:01:52 +0000 Mk/bsd.port.mk: Export XDG_CACHE_HOME This adds XDG_CACHE_HOME to the set of XDG_* variables exported in CONFIGURE_ENV and MAKE_ENV. Without XDG_CACHE_HOME in the environment some software (for ex. https://github.com/coursier/coursier) falls back to using /home/{user}/.cache during the build and writes outside the working directory. XDG_CACHE_HOME is described in the XDG Base Directory Specification: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html PR: 255600 Exp-run by: antoine Mk/Uses/gnome.mk | 2 +- Mk/bsd.port.mk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)