fontconfig: update 2.10.2 -> 2.11.1#4410
Conversation
|
cc @vcunat |
|
I don't think we should change the default path, because it breaks compatibility with every other system. It requires setting BTW, if fontconfig 2.11 supports the old config files, can't we generate a config file valid to both 2.10 and 2.11? |
|
Well, yes, currently the 2.11 fontconfig seems to work with our 2.10 As a compromise, my WIP is designed in a way that the default config is in |
|
@vcunat it's what this PR does as well, except a little more useful for non-nixos and versioned for later incompatibilities. |
|
Isn't this something upstream should address? Ideally they would come up with a versioned configuration path (like dbus and polkit do). |
|
@vcunat do you remember exactly the bug you encountered when using an old fontconfig with a 2.11 fonts.conf? The dtd changed, but it seems to me it's for specific corner cases. |
|
The diff of changes between 2.10.2 and 2.11.1 DTD: --- a/fonts.dtd
+++ b/fonts.dtd
@@ -140,7 +140,7 @@
if 'target' is 'font', execute the match on the result of a font
selection.
-->
-<!ELEMENT match (test*, edit*)>
+<!ELEMENT match (test|edit)+>
<!ATTLIST match
target (pattern|font|scan) "pattern">
@@ -189,7 +189,7 @@
<!ELEMENT edit (%expr;)*>
<!ATTLIST edit
name CDATA #REQUIRED
- mode (assign|assign_replace|prepend|append|prepend_first|append_last) "assign"
+ mode (assign|assign_replace|prepend|append|prepend_first|append_last|delete|delete_all) "assign"
binding (weak|strong|same) "weak">
<!--
@@ -201,13 +201,14 @@
<!ATTLIST double xml:space (default|preserve) 'preserve'>
<!ELEMENT string (#PCDATA)>
<!ATTLIST string xml:space (default|preserve) 'preserve'>
-<!ELEMENT matrix (double,double,double,double)>
+<!ELEMENT matrix ((%expr;), (%expr;), (%expr;), (%expr;))>
<!ELEMENT bool (#PCDATA)>
<!ELEMENT charset (int|range)*>
<!ELEMENT range (int,int)>
<!ELEMENT langset (string)*>
<!ELEMENT name (#PCDATA)>
-<!ATTLIST name xml:space (default|preserve) 'preserve'>
+<!ATTLIST name xml:space (default|preserve) 'preserve'
+ target (default|font|pattern) 'default'>
<!ELEMENT const (#PCDATA)>
<!ATTLIST const xml:space (default|preserve) 'preserve'>
<!ELEMENT or (%expr;)*>I'm not good in reading DTDs, so e.g. I don't know why the |
|
@edolstra the above diff seems clearly incompatible with version 2.10, how could one e.g. replace an expression in matrix of config 2.11 to be a constant compatible with fontconfig 2.10? Or mode "delete". |
|
In principle this looks good to me, and very similar to what I had in mind anyway. I got deeper into fontconfig issues three weeks ago (time flies too fast), so I would like to integrate my observations into this. It would be nice to stabilize this before the release, so e.g. it does not get locked out of gnome 3.14. I plan to integrate and re-test the ideas tomorrow. Cache
Font dirs
Config inclusion
|
|
I'm ok with most of the things, except using systemPackages to install fonts. It becomes dirty in my opinion, don't please. |
b05be39 to
a7df219
Compare
|
Updated:
Question: instead of using 2.11 as version, should we instead use the fontconfig version used for the cache? For 2.11 is 4, while for 2.10 is 3. I'm not sure the cache versioning follows the config versioning. |
|
That occurred to me, too. They call it "font configureation file version number" in docs. I had tried to find it in the source tree for some minutes to confirm that, but I failed. IMHO it doesn't really matter what the identifier is, as long as we bump it in correct moment. ("2.11" may be more understandable for users, at least until "2.12" is released without config change.) Good point about BTW, you added the font in a wrong place (to get the effect I meant), but I'll fix that easily. The problem is that all standard config is dropped if it finds a mistake on any place, and you only have that configure-time list of font dirs (according to configure help). |
|
On Sat, Oct 18, 2014 at 5:30 PM, Vladimír Čunát notifications@github.com
www.debian.org - The Universal Operating System |
|
Not only. The configure scripts takes |
|
Ah that's nice, I overlooked that. Will update the branch :) On Sat, Oct 18, 2014 at 6:10 PM, Vladimír Čunát notifications@github.com
www.debian.org - The Universal Operating System |
a7df219 to
2641ee3
Compare
|
Added |
|
Thanks for noting! I deleted that misguided post of mine. |
2641ee3 to
d5726d0
Compare
|
Hm, making fontconfig depend on specific fonts seems very strange to me. Is that really necessary? Surely fonts are runtime configuration, not build time dependencies. |
|
It's a default one font, just to make sure on any case (especially Are you suggesting using propagatedUserEnvPkg? On Sun, Oct 19, 2014 at 2:58 PM, Eelco Dolstra notifications@github.com
www.debian.org - The Universal Operating System |
|
@edolstra: when loading font config fails for some reason, you get that font. If you don't specify it, you get no font at all... |
|
@vcunat so what about merging in staging? |
|
Merging staging into master? Not all rebuilds finished yet, and there are a few regressions. http://hydra.nixos.org/eval/1156552?compare=1156478&full=1#tabs-now-fail The pypy stuff is probably just random, but a few problems are reproducible. Especially #4419, but we can revert that one if need be and it's not a mass-rebuild on Linux. |
|
@vcunat no merging the fontconfig upgrade into staging, iirc you have it only in your branch. EDIT: sorry I missed the merge into staging of the change. |
|
Yes, well, github does not show the change, presumably because it was in exactly the same commit hash, only pushed into the official repo. |
|
Sorry, but I'm pretty unenthusiastic about this change (using a different /etc/fonts directory and generating 2.10 fonts.conf). It breaks compatibility with non-NixOS systems and is going to produce headaches into the indefinite future. (For instance, how long are we going to keep generating fonts.conf for older versions?) And I don't think fontconfig should provide fonts. So I think we should just bump fontconfig from 2.10 to 2.11 (assuming we actually need 2.11) and leave it at that (and maybe for the time being generate a 2.10 compatible /etc/fonts.conf). Going forward we could introduce environment variables (BTW, we've had incompatible fontconfig changes in the past - at some point old fontconfig binaries crashed due to incompatible changes in the format of the fontconfig cache.) |
|
I don't understand the "incompatibility with non-NixOS" part. Why do we need get font config from the other distro? |
|
When you run a Nixpkgs application on another distribution, it needs to respect the |
|
Another possibility is to set On a side note, I don't see how the fontconfig cache could be a problem since it's versioned. I'm open to reverting the change, still thinking more about it. |
|
What we could do:
This way, 2.10 binaries would still work on NixOS, and 2.11 binaries would use Such a patch might even be acceptable upstream. |
|
That seems sensible to me. |
|
Yes, now that it kida works even with wrong config, that approach sounds good... except that I don't much like to pollute the global NixOS env with another variable, so from that point of view I'd prefer @lethalman's suggestion to set |
|
Hmm, I do have a trivial fontconfig patch for that @edolstra's suggestion, but I think this order will be better: Against @edolstra's suggestion we lose the ability to have one environment for mixed 2.10 + 2.11 that need non-standard |
|
Sounds good to me. |
|
👍 |
|
Done and tested c0e2ace. I just wonder why a "command not found" error in |
|
Maybe the generation of the legacy fonts.conf should be conditional on some option and disabled by default. After all it's only needed if you have old packages installed via nix-env. |
|
@edolstra I don't think keeping it there even if there's no user is a problem either. It can still be peeked by some statically built program. In this regard, I think |
|
Well, it pulls in |
|
@edolstra yes, it's not that it's such a big binary either |
|
I thought about extracting only the config part, which is small enough. |
Reference: #2050
/etc/fonts/2.11$fontconfig/etc/fonts.confinstead of/etc/fonts/fonts.confmakeFontsConf. This allows applications usingmakeFontsConf, nixos and non-nixos to find fonts in the nix profile in all cases.Nixos
/etc/fonts/2.11/conf.d/00-nixos.confis being created with options plus <dir> for each font./etc/fonts/fonts.confis created for fontconfig 2.10.Non-nixos
/etc/fonts/fonts.conf.FONTCONFIG_FILE=/etc/fonts/fonts.confTested
FONTCONFIG_FILE=/etc/fonts/fonts.confUntested
Whether apps with custom
makeFontsConfwork properly. I see no reason for which they shouldn't.