Skip to content

Document what sysroot really does.

Ben Wagner requested to merge bungeman/fontconfig:sysroot into master

The previous documentation documented what the original patches for sysroot did, which was to interpret all file paths as based on the sysroot path. However, the actual implementation simply removes the sysroot prefix if a path lexically begins with it. This leads to a situation where an FcConfig may have a mix of sysroot and non-sysroot paths. As a result, users should look for a file by first resolving against the sysroot, but they should also look for the file without the sysroot.

Note that the behavior of FcConfigSetSysRoot is to set the sysroot to some absolute path, so the sysroot (the one returned from FcConfigGetSysRoot) may not be lexically the same as the string passed to FcConfigSetSysRoot.

Note that the current behavior of FcConfigAppFontAddFile is that if the passed file lexically begins with the sysroot path then the sysroot will be removed, otherwise the entire path will be placed in the pattern. Note the "lexically" part, since the path passed to FcConfigAppFontAddFile isn't made absolute the way the FcConfigSetSysRoot does. A relative file path passed to FcConfigAppFontAddFile will never begin with the absolute sysroot, even if the path itself after resolving would be in the sysroot.

It isn't clear if this behavior is intended. If it isn't intended then a behavior change may be better than accepting this documentation change.

Merge request reports