You are not logged in.

#1 2025-11-10 11:27:25

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,482

CCACHE_NAMESPACE in PKGBUILD ?

Recently I noticed that afrer running a large bisect packages I had built before the bisect didn't benefit from ccache anymore .
I asked for help on ccache github , see https://github.com/ccache/ccache/discus … discussion .

I prefer the namespace method and see 2 methods to implement it :

- create a wrapper for makepkg that includes export CCACHE_NAMESPACE=$PWD

- add export CCACHE_NAMESPACE=$PWD in the body of the PKGBUILD

Most of the packages that would benefit from this are aur packages I maintain .

How do you feel about aur packages that have such an envvar in them ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 2025-11-12 11:18:39

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,482

Re: CCACHE_NAMESPACE in PKGBUILD ?

I've thought more about this and now feel a wrapper for makepkg is more flexible and has the advantage of keeping the aur PKGBUILDS independent of my settings.

A case statement should help to clarify what exactly happens.
Aliases/wrappers for manual cleaning will also help.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2025-11-12 11:52:19

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,606
Website

Re: CCACHE_NAMESPACE in PKGBUILD ?

Your wrapper could probably just be:

alias makepkg='CCACHE_NAMESPACE=$pwd makepkg'

or slightly more complex...

alias makepkg='makedir -p cache; CCACHE_NAMESPACE=$pwd/cache makepkg'

I don't use ccache so not sure if making a directory is needed.

Offline

#4 2025-11-13 08:35:16

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,482

Re: CCACHE_NAMESPACE in PKGBUILD ?

I don't use ccache so not sure if making a directory is needed

No, NAMESPACE stores everything in the same location , usually at $XDG_CONFIG_HOME/ccache/

alias makepkg='CCACHE_NAMESPACE=$pwd makepkg'

The mechanism used in bash to determinbe whether to pass envvars evades me.
Will CCACHE_NAMESPACE be passed from makepkg to the PKGBUILD and to commands run from within the PKGBUILD ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2025-11-13 09:10:58

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,606
Website

Re: CCACHE_NAMESPACE in PKGBUILD ?

Lone_Wolf wrote:

Will CCACHE_NAMESPACE be passed from makepkg to the PKGBUILD and to commands run from within the PKGBUILD ?

I think so...   I have used such an approach for configure in PKGBUILDs to pick up CC=clang.   Only one way to find out!

Offline

#6 2025-11-13 12:59:05

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,482

Re: CCACHE_NAMESPACE in PKGBUILD ?

It appears CCACHE_NAMESPACE in an alias is working.
The --evict-namespace and --evict-older-than are also functional.

Sofar i have not found  a way to get details about which namespaces are used or how big they are.
the -s , -sv and -svv options for ccache give lots of detail, but nothing about namespaces.

Will try with a freshly created cache dir next time I build stuff.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB