New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/fontconfig: Fix compatibility with unstable apps #97441
Conversation
Fontconfig 2.14 from unstable reverted back to using /etc/fonts/fonts.conf for its configuration. Unfortunately, on NixOS 20.03, this still points to configuration for Fontconfig 2.10, with cache version 3. When an app linked against Fontconfig 2.14 reads the config and does not find a compatible cache, it writes a new cache entries to ~/.cache/fontconfig. Unfortunately, the fontconfig 2.14 uses the same cache version as 2.12 in 20.03 (7) so when the apps from 20.03 later read the cache, they cannot make much sense of it and are unable to find any fonts. I added a new fonts.fontconfig.disableVersionedFontConfiguration option, which, when enabled, makes /etc/fonts/fonts.conf point to the configuration file for the latest fontconfig, instead of the ancient 2.10 version. This is necessary to prevent packages from Nixpkgs unstable breaking apps from 20.03. Enabling this should not cause any issues as there are no programs using the legacy fontconfig version since NixOS 15.03. Unfortunately, if a person already ran an app from unstable before applying this patch, they will need to delete ~/.cache/fontconfig manually.
I confirmed in 20.03 VM with this patch, that running piper from unstable no longer creates the cache in user's profile. (And running it with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially stumbled upon this yesterday. Can confirm that this patch fixes the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post commit I am approving 👍 thanks.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/all-fonts-suddenly-inaccessible/8994/2 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-can-i-fix-my-broken-gtk-fonts/10358/6 |
I have met the same problem when I run pywebio with deepin-linux. |
Fontconfig 2.14 from unstable reverted back to using /etc/fonts/fonts.conf
for its configuration. Unfortunately, on NixOS 20.03, this still points
to configuration for Fontconfig 2.10, with cache version 3.
When an app linked against Fontconfig 2.14 reads the config and does not
find a compatible cache, it writes a new cache entries to ~/.cache/fontconfig.
Unfortunately, the fontconfig 2.14 uses the same cache version as 2.12 in 20.03 (7)
so when the apps from 20.03 later read the cache, they cannot make much sense
of it and are unable to find any fonts.
I added a new fonts.fontconfig.disableVersionedFontConfiguration option, which,
when enabled, makes /etc/fonts/fonts.conf point to the configuration file
for the latest fontconfig, instead of the ancient 2.10 version.
This is necessary to prevent packages from Nixpkgs unstable breaking apps
from 20.03.
Enabling this should not cause any issues as there are no programs
using the legacy fontconfig version since NixOS 15.03.
Unfortunately, if a person already ran an app from unstable
before applying this patch, they will need to delete ~/.cache/fontconfig manually.
Closes: #97418
cc @worldofpeace @samueldr