I really don’t see why all this requires adding third party files to
font directories (which will break other software). The container tech,
not fontconfig, decides what it wants to reuse from the host. The
container tech, not fontconfig knows it exposed all the host font
directories or just some of them. The container tech, not fontconfig,
knows how it remapped directories. The container tech, not fontconfig,
knows it exposes a cache format that may be incompatible with the
container fontconfig version.
So the container tech is creating a situation where host files can not
be reused as-is, and it needs to tell fontconfig all this, instead of
trying to pretend this is business as usual and hope nothing will break.
ie provide fontconfig a map file that says "you can use the additional
cache file located here if its format is compatible with the container
fontconfig version. When using this additional cache, only take into
account those file paths and map them to container paths this way"
You can't seriously suggest adding UUID files to every host directory
you remapped and that matter somewhere, just to avoid telling apps you
remapped things in the first place. Because if you actually think this
would be a good idea, the whole thing belongs in the container
filesystem namespace, not in per-app kludges. If you want to do that add
a "get dir uuid" syscall there and then ask apps to use it.
Fontconfig mailing list