* [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME)
2026-10-20 12:06 [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command Thomas Petazzoni via buildroot
@ 2026-10-20 12:06 ` Thomas Petazzoni via buildroot
2026-10-20 12:55 ` Fiona Klute via buildroot
2026-10-20 16:43 ` Peter Korsgaard
2026-10-20 18:26 ` [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command François PERRAD
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-20 12:06 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni, Francois Perrad
By default, hare will store its cache directory in $(HOME)/.cache,
which is a problem as we don't want a Buildroot build to write outside
of its output directory (to the exception of DL_DIR, of course). The
build of hare-package packages currently fails with:
Error creating /home/br-user/.cache/hare: Permission denied
make[2]: *** [Makefile:15: dbus-introspector] Error 255
Error creating make[2]: *** Waiting for unfinished jobs....
/home/br-user/.cache/hare: Permission denied
make[2]: *** [Makefile:19: dbus-scanner] Error 255
due to this issue.
We fix this by passing XDG_CACHE_HOME when building hare-package
packages.
Fixes: 44d38432343e65ec7a6d898cf982985cc2bc1e88 ("package/pkg-hare.mk: new infrastructure")
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
package/pkg-hare.mk | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/package/pkg-hare.mk b/package/pkg-hare.mk
index 15dc769311..6494d2651c 100644
--- a/package/pkg-hare.mk
+++ b/package/pkg-hare.mk
@@ -51,7 +51,11 @@ define $(2)_BUILD_CMDS
if grep "^all:" $$($(2)_SRCDIR)Makefile > /dev/null; then \
target=all ; \
fi ; \
- $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)" HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" $${target}
+ $(MAKE) -C $$($(2)_SRCDIR) \
+ HARE="$$(HARE_RUN_CMD)" \
+ HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" \
+ XDG_CACHE_HOME="$$($(2)_SRCDIR)/.cache" \
+ $${target}
endef
endif
--
2.56.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME)
2026-10-20 12:06 ` [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME) Thomas Petazzoni via buildroot
@ 2026-10-20 12:55 ` Fiona Klute via buildroot
2026-10-20 13:17 ` Thomas Petazzoni via buildroot
2026-10-20 16:43 ` Peter Korsgaard
1 sibling, 1 reply; 11+ messages in thread
From: Fiona Klute via buildroot @ 2026-10-20 12:55 UTC (permalink / raw)
To: Thomas Petazzoni, buildroot; +Cc: Francois Perrad
Am 20.10.26 um 14:06 schrieb Thomas Petazzoni via buildroot:
> By default, hare will store its cache directory in $(HOME)/.cache,
> which is a problem as we don't want a Buildroot build to write outside
> of its output directory (to the exception of DL_DIR, of course). The
And CCACHE_DIR, if enabled. Not really critical, but might give someone
who's new to Buildroot a wrong idea. ;-)
> build of hare-package packages currently fails with:
>
> Error creating /home/br-user/.cache/hare: Permission denied
> make[2]: *** [Makefile:15: dbus-introspector] Error 255
> Error creating make[2]: *** Waiting for unfinished jobs....
> /home/br-user/.cache/hare: Permission denied
> make[2]: *** [Makefile:19: dbus-scanner] Error 255
>
> due to this issue.
>
> We fix this by passing XDG_CACHE_HOME when building hare-package
> packages.
I'm not familiar with Hare, what does it store in its cache dir? The
default path suggests it's intended as a global cache, so I'm wondering
if something like $(BUILD_DIR)/.hare-cache might be better than a
per-package cache. But of course that depends on what goes in there.
Best regards,
Fiona
> Fixes: 44d38432343e65ec7a6d898cf982985cc2bc1e88 ("package/pkg-hare.mk: new infrastructure")
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> package/pkg-hare.mk | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/package/pkg-hare.mk b/package/pkg-hare.mk
> index 15dc769311..6494d2651c 100644
> --- a/package/pkg-hare.mk
> +++ b/package/pkg-hare.mk
> @@ -51,7 +51,11 @@ define $(2)_BUILD_CMDS
> if grep "^all:" $$($(2)_SRCDIR)Makefile > /dev/null; then \
> target=all ; \
> fi ; \
> - $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)" HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" $${target}
> + $(MAKE) -C $$($(2)_SRCDIR) \
> + HARE="$$(HARE_RUN_CMD)" \
> + HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" \
> + XDG_CACHE_HOME="$$($(2)_SRCDIR)/.cache" \
> + $${target}
> endef
> endif
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME)
2026-10-20 12:55 ` Fiona Klute via buildroot
@ 2026-10-20 13:17 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-20 13:17 UTC (permalink / raw)
To: Fiona Klute; +Cc: buildroot, Francois Perrad
On Tue, Oct 20, 2026 at 02:55:04PM +0200, Fiona Klute wrote:
> Am 20.10.26 um 14:06 schrieb Thomas Petazzoni via buildroot:
> > By default, hare will store its cache directory in $(HOME)/.cache,
> > which is a problem as we don't want a Buildroot build to write outside
> > of its output directory (to the exception of DL_DIR, of course). The
>
> And CCACHE_DIR, if enabled. Not really critical, but might give someone
> who's new to Buildroot a wrong idea. ;-)
True.
> I'm not familiar with Hare, what does it store in its cache dir? The default
> path suggests it's intended as a global cache, so I'm wondering if something
> like $(BUILD_DIR)/.hare-cache might be better than a per-package cache. But
> of course that depends on what goes in there.
I must say I'm not sure. On the package/hare patch, I asked the
feedback from François Perrad precisely for this reason. For what I
can see, it contains "object files" for each source file that has been
compiled, along with a bunch of other things.
See:
https://paste.ack.tf/3839b9@raw
(from this I can see the path within
output/build/hare-dbus-e9a89f8bc5ce783fa25f0eb67d7d8932db90bcc2/.cache
seems a bit crazy though.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME)
2026-10-20 12:06 ` [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME) Thomas Petazzoni via buildroot
2026-10-20 12:55 ` Fiona Klute via buildroot
@ 2026-10-20 16:43 ` Peter Korsgaard
2026-10-20 18:03 ` François PERRAD
2026-10-20 18:19 ` Thomas Petazzoni via buildroot
1 sibling, 2 replies; 11+ messages in thread
From: Peter Korsgaard @ 2026-10-20 16:43 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni, Francois Perrad
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> By default, hare will store its cache directory in $(HOME)/.cache,
> which is a problem as we don't want a Buildroot build to write outside
> of its output directory (to the exception of DL_DIR, of course). The
> build of hare-package packages currently fails with:
> Error creating /home/br-user/.cache/hare: Permission denied
> make[2]: *** [Makefile:15: dbus-introspector] Error 255
> Error creating make[2]: *** Waiting for unfinished jobs....
> /home/br-user/.cache/hare: Permission denied
> make[2]: *** [Makefile:19: dbus-scanner] Error 255
> due to this issue.
> We fix this by passing XDG_CACHE_HOME when building hare-package
> packages.
Do we have reasons to think that this environment variable will only
ever be used by hare packages? If not, then we should perhaps rather do
it globally / in pkg-generic.mk, similar to E.G. how we set GIT_DIR=. ?
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME)
2026-10-20 16:43 ` Peter Korsgaard
@ 2026-10-20 18:03 ` François PERRAD
2026-10-20 18:19 ` Thomas Petazzoni via buildroot
1 sibling, 0 replies; 11+ messages in thread
From: François PERRAD @ 2026-10-20 18:03 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 1403 bytes --]
Le mar. 20 oct. 2026 à 18:43, Peter Korsgaard <peter@korsgaard.com> a
écrit :
> >>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org>
> writes:
>
> > By default, hare will store its cache directory in $(HOME)/.cache,
> > which is a problem as we don't want a Buildroot build to write outside
> > of its output directory (to the exception of DL_DIR, of course). The
> > build of hare-package packages currently fails with:
>
> > Error creating /home/br-user/.cache/hare: Permission denied
> > make[2]: *** [Makefile:15: dbus-introspector] Error 255
> > Error creating make[2]: *** Waiting for unfinished jobs....
> > /home/br-user/.cache/hare: Permission denied
> > make[2]: *** [Makefile:19: dbus-scanner] Error 255
>
> > due to this issue.
>
> > We fix this by passing XDG_CACHE_HOME when building hare-package
> > packages.
>
> Do we have reasons to think that this environment variable will only
> ever be used by hare packages? If not, then we should perhaps rather do
> it globally / in pkg-generic.mk, similar to E.G. how we set GIT_DIR=. ?
>
>
in fact, `hare` has its own variable HARECACHE, see
https://manpages.ubuntu.com/manpages/stonking/man1/hare-build.1.html#environment
HARECACHE="$$($(2)_SRCDIR).cache" works fine.
no needs to set a desktop XDG environment variable.
François
> --
> Bye, Peter Korsgaard
>
[-- Attachment #1.2: Type: text/html, Size: 2329 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME)
2026-10-20 16:43 ` Peter Korsgaard
2026-10-20 18:03 ` François PERRAD
@ 2026-10-20 18:19 ` Thomas Petazzoni via buildroot
2026-10-20 18:32 ` Peter Korsgaard
1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-20 18:19 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: Thomas Petazzoni via buildroot, Francois Perrad
On Tue, Oct 20, 2026 at 06:43:49PM +0200, Peter Korsgaard wrote:
> Do we have reasons to think that this environment variable will only
> ever be used by hare packages? If not, then we should perhaps rather do
> it globally / in pkg-generic.mk, similar to E.G. how we set GIT_DIR=. ?
That is certainly an option. Initially I only saw the problem on
host-hare, but then I saw that the hare packages themselves can be
affected as well. The question is of course whether there will be an
impact on other packages, but if we decide that $HOME should be
read-only, then it makes sense to divert XDG_CACHE_HOME to
BUILD_DIR/.cache, and see whether it causes issues for some packages.
Should I respin a patch in that direction?
Independently from that I believe
https://patchwork.buildroot.org/project/buildroot/patch/20261020120646.1306735-1-thomas.petazzoni@bootlin.com/
can still be a good small refactoring to merge.
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME)
2026-10-20 18:19 ` Thomas Petazzoni via buildroot
@ 2026-10-20 18:32 ` Peter Korsgaard
0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2026-10-20 18:32 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Thomas Petazzoni via buildroot, Francois Perrad
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> On Tue, Oct 20, 2026 at 06:43:49PM +0200, Peter Korsgaard wrote:
>> Do we have reasons to think that this environment variable will only
>> ever be used by hare packages? If not, then we should perhaps rather do
>> it globally / in pkg-generic.mk, similar to E.G. how we set GIT_DIR=. ?
> That is certainly an option. Initially I only saw the problem on
> host-hare, but then I saw that the hare packages themselves can be
> affected as well. The question is of course whether there will be an
> impact on other packages, but if we decide that $HOME should be
> read-only, then it makes sense to divert XDG_CACHE_HOME to
> BUILD_DIR/.cache, and see whether it causes issues for some packages.
> Should I respin a patch in that direction?
I think that would be a good idea, yes.
> Independently from that I believe
> https://patchwork.buildroot.org/project/buildroot/patch/20261020120646.1306735-1-thomas.petazzoni@bootlin.com/
> can still be a good small refactoring to merge.
Sure, I will apply it now.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command
2026-10-20 12:06 [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command Thomas Petazzoni via buildroot
2026-10-20 12:06 ` [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME) Thomas Petazzoni via buildroot
@ 2026-10-20 18:26 ` François PERRAD
2026-10-20 18:34 ` Peter Korsgaard
2026-10-20 18:42 ` Peter Korsgaard
3 siblings, 0 replies; 11+ messages in thread
From: François PERRAD @ 2026-10-20 18:26 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 1413 bytes --]
Acked-by: Francois Perrad <francois.perrad.86@gmail.com>
Le mar. 20 oct. 2026 à 14:07, Thomas Petazzoni <thomas.petazzoni@bootlin.com>
a écrit :
> In order to avoid duplicating the build command, use an intermediate
> "target" shell variable to store the make target to be invoked for the
> build. This is in preparation to extending the build command.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> package/pkg-hare.mk | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/package/pkg-hare.mk b/package/pkg-hare.mk
> index 14e0cfce5a..15dc769311 100644
> --- a/package/pkg-hare.mk
> +++ b/package/pkg-hare.mk
> @@ -49,10 +49,9 @@ ifndef $(2)_BUILD_CMDS
> # but in real world, the target "all" is not always the default one
> define $(2)_BUILD_CMDS
> if grep "^all:" $$($(2)_SRCDIR)Makefile > /dev/null; then \
> - $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)"
> HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" all; \
> - else \
> - $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)"
> HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)"; \
> - fi
> + target=all ; \
> + fi ; \
> + $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)"
> HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" $${target}
> endef
> endif
>
> --
> 2.56.0
>
>
[-- Attachment #1.2: Type: text/html, Size: 2481 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command
2026-10-20 12:06 [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command Thomas Petazzoni via buildroot
2026-10-20 12:06 ` [Buildroot] [PATCH 2/2] package/pkg-hare: move cache directory outside of $(HOME) Thomas Petazzoni via buildroot
2026-10-20 18:26 ` [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command François PERRAD
@ 2026-10-20 18:34 ` Peter Korsgaard
2026-10-20 18:42 ` Peter Korsgaard
3 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2026-10-20 18:34 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni, Francois Perrad
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> In order to avoid duplicating the build command, use an intermediate
> "target" shell variable to store the make target to be invoked for the
> build. This is in preparation to extending the build command.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command
2026-10-20 12:06 [Buildroot] [PATCH 1/2] package/pkg-hare: refactor build command Thomas Petazzoni via buildroot
` (2 preceding siblings ...)
2026-10-20 18:34 ` Peter Korsgaard
@ 2026-10-20 18:42 ` Peter Korsgaard
3 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2026-10-20 18:42 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni, Francois Perrad
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> In order to avoid duplicating the build command, use an intermediate
> "target" shell variable to store the make target to be invoked for the
> build. This is in preparation to extending the build command.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> package/pkg-hare.mk | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
> diff --git a/package/pkg-hare.mk b/package/pkg-hare.mk
> index 14e0cfce5a..15dc769311 100644
> --- a/package/pkg-hare.mk
> +++ b/package/pkg-hare.mk
> @@ -49,10 +49,9 @@ ifndef $(2)_BUILD_CMDS
> # but in real world, the target "all" is not always the default one
> define $(2)_BUILD_CMDS
> if grep "^all:" $$($(2)_SRCDIR)Makefile > /dev/null; then \
> - $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)" HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" all; \
> - else \
> - $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)" HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)"; \
> - fi
> + target=all ; \
> + fi ; \
> + $(MAKE) -C $$($(2)_SRCDIR) HARE="$$(HARE_RUN_CMD)" HAREFLAGS="$$(HARE_ARCH_OPT) $$(HARE_LIBDIR_OPT)" $${target}
I already pushed, but this presumably will break quite badly if someone
has a 'target' environment variable set. Maybe we should explicitly set
it to the empty string in the else clause?
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 11+ messages in thread