unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: bug#30435: libreoffice: Fonts don't show up after install
       [not found] <bad1fc034ed4a0a4dbf14f74d431b7ae@posteo.de>
@ 2020-04-02  9:09 ` Pierre Neidhardt
  2020-04-02  9:19   ` Nicolò Balzarotti
  2020-04-02 15:46   ` Ludovic Courtès
  0 siblings, 2 replies; 9+ messages in thread
From: Pierre Neidhardt @ 2020-04-02  9:09 UTC (permalink / raw)
  To: hmk; +Cc: 30435, guix-devel

I can reproduce this on guix ce226e9d8d52d2530f057f2000d36c0d55380ade.

But libreoffice is not the only victim: it seems that most applications
fail to see the fonts installed in the user profile (on Guix System).
Emacs is one example.

Running

--8<---------------cut here---------------start------------->8---
fc-cache -fv
--8<---------------cut here---------------end--------------->8---

fixes the issue.

Should we run this command in a profile hook?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2020-04-02  9:09 ` bug#30435: libreoffice: Fonts don't show up after install Pierre Neidhardt
@ 2020-04-02  9:19   ` Nicolò Balzarotti
  2020-04-02  9:37     ` John Soo
  2020-04-02 15:47     ` Ludovic Courtès
  2020-04-02 15:46   ` Ludovic Courtès
  1 sibling, 2 replies; 9+ messages in thread
From: Nicolò Balzarotti @ 2020-04-02  9:19 UTC (permalink / raw)
  To: Pierre Neidhardt, hmk; +Cc: 30435, guix-devel

Pierre Neidhardt <mail@ambrevar.xyz> writes:

Hi, I wanted to add that the opposite is also true: removing a font
without running fc-cache always makes my emacs die on start, so I agree
that running the command automatically makes sense.

Are there any unwanted side-effects?

Thanks, Nicolò

> I can reproduce this on guix ce226e9d8d52d2530f057f2000d36c0d55380ade.
>
> But libreoffice is not the only victim: it seems that most applications
> fail to see the fonts installed in the user profile (on Guix System).
> Emacs is one example.
>
> Running
>
> --8<---------------cut here---------------start------------->8---
> fc-cache -fv
> --8<---------------cut here---------------end--------------->8---
>
> fixes the issue.
>
> Should we run this command in a profile hook?
>
> -- 
> Pierre Neidhardt
> https://ambrevar.xyz/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2020-04-02  9:19   ` Nicolò Balzarotti
@ 2020-04-02  9:37     ` John Soo
  2020-04-02 15:47     ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: John Soo @ 2020-04-02  9:37 UTC (permalink / raw)
  To: Nicolò Balzarotti; +Cc: 30435, guix-devel, hmk

Hi there,

I think this is the same issue as 26877.

Can font information be compiled into a fonts.conf?

- John

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2020-04-02  9:09 ` bug#30435: libreoffice: Fonts don't show up after install Pierre Neidhardt
  2020-04-02  9:19   ` Nicolò Balzarotti
@ 2020-04-02 15:46   ` Ludovic Courtès
  2020-04-02 15:59     ` Pierre Neidhardt
  2023-02-20 16:05     ` Maxim Cournoyer
  1 sibling, 2 replies; 9+ messages in thread
From: Ludovic Courtès @ 2020-04-02 15:46 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 30435, guix-devel, hmk

Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> Running
>
> fc-cache -fv
>
> fixes the issue.
>
> Should we run this command in a profile hook?

Profile hooks are normal derivations; as such, they don’t have access to
anything but their dependencies and their output(s).

There’s currently no infrastructure to run arbitrary code upon package
installation (which I think is a feature more than a bug :-)).  We could
make an exception, but it’s kinda ugly.

I wonder if, instead, we could have Fontconfig realize that the cache is
stale somehow.

Alternately, we could generate the cache in a profile hook and have
Fontconfig use that cache instead of the one in ~/.cache.  However,
Fontconfig would need to be able to:

  1. Be told which cache to use, not just the one from ~/.guix-profile,
     so that it works equally well with other profiles.

  2. Merge several caches, so it can also account for fonts installed in
     /run/current-system/profile.

We discussed all this several times in the past but I don’t think it
went further.

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2020-04-02  9:19   ` Nicolò Balzarotti
  2020-04-02  9:37     ` John Soo
@ 2020-04-02 15:47     ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2020-04-02 15:47 UTC (permalink / raw)
  To: Nicolò Balzarotti; +Cc: 30435, guix-devel, hmk

Hi Nicolò,

Nicolò Balzarotti <anothersms@gmail.com> skribis:

> Hi, I wanted to add that the opposite is also true: removing a font
> without running fc-cache always makes my emacs die on start, so I agree
> that running the command automatically makes sense.

Actually, if you can capture a stack trace of Emacs, that may tell us
what part of Fontconfig to look at if we want to change it to gracefully
handle stale cache entries.

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2020-04-02 15:46   ` Ludovic Courtès
@ 2020-04-02 15:59     ` Pierre Neidhardt
  2023-02-20 16:05     ` Maxim Cournoyer
  1 sibling, 0 replies; 9+ messages in thread
From: Pierre Neidhardt @ 2020-04-02 15:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 30435, guix-devel, hmk

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

OK, thanks for the details.

So the solution is the same as the one we discussed
previously about installing fonts to the non-default profile.
Makes sense.

I might give it a shot when I find the time ;)

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2020-04-02 15:46   ` Ludovic Courtès
  2020-04-02 15:59     ` Pierre Neidhardt
@ 2023-02-20 16:05     ` Maxim Cournoyer
  2023-02-20 17:32       ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  1 sibling, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2023-02-20 16:05 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Pierre Neidhardt, 30435, guix-devel, hmk

Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Pierre Neidhardt <mail@ambrevar.xyz> skribis:
>
>> Running
>>
>> fc-cache -fv
>>
>> fixes the issue.
>>
>> Should we run this command in a profile hook?
>
> Profile hooks are normal derivations; as such, they don’t have access to
> anything but their dependencies and their output(s).
>
> There’s currently no infrastructure to run arbitrary code upon package
> installation (which I think is a feature more than a bug :-)).  We could
> make an exception, but it’s kinda ugly.
>
> I wonder if, instead, we could have Fontconfig realize that the cache is
> stale somehow.
>
> Alternately, we could generate the cache in a profile hook and have
> Fontconfig use that cache instead of the one in ~/.cache.  However,
> Fontconfig would need to be able to:
>
>   1. Be told which cache to use, not just the one from ~/.guix-profile,
>      so that it works equally well with other profiles.

That's possible since adding support to XDG_DATA_DIRS in fontconfig
itself (see c738a054cac00441a4f697f0b40705d0b3f4a7a7, "gnu: fontconfig:
Add a search path for XDG_DATA_DIRS.").

>   2. Merge several caches, so it can also account for fonts installed in
>      /run/current-system/profile.

There was also something contributed that should have improved/fix cache
invalidity in 6f12880a76a6c91058718d15845f8b9d9b529a5a ("gnu:
fontconfig: Use (locally) deterministic caching").

I haven't seen this problem in a long while, so I'm inclined to think
it's been resolved.

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2023-02-20 16:05     ` Maxim Cournoyer
@ 2023-02-20 17:32       ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  2023-02-20 18:22         ` Maxim Cournoyer
  0 siblings, 1 reply; 9+ messages in thread
From: Felix Lechner via Development of GNU Guix and the GNU System distribution. @ 2023-02-20 17:32 UTC (permalink / raw)
  To: Maxim Cournoyer
  Cc: Ludovic Courtès, Pierre Neidhardt, 30435, guix-devel, hmk

Hi,

On Mon, Feb 20, 2023 at 8:06 AM Maxim Cournoyer
<maxim.cournoyer@gmail.com> wrote:
>
> I haven't seen this problem in a long while, so I'm inclined to think
> it's been resolved.

I think I had that issue with a fresh install within the last year and
based on advice in IRC (thanks nckx!) ran 'fc-cache -fv'.

For what it's worth, I believe Debian's packaging tools (in this case,
Debhelper) detect changes to the font directories and add a font
update hook to the package installation scripts. Since we do not have
such scripts—and I am with Ludo' that it's probably a feature worth
preserving—maybe our package manager could run the hook?

Kind regards
Felix Lechner


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bug#30435: libreoffice: Fonts don't show up after install
  2023-02-20 17:32       ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
@ 2023-02-20 18:22         ` Maxim Cournoyer
  0 siblings, 0 replies; 9+ messages in thread
From: Maxim Cournoyer @ 2023-02-20 18:22 UTC (permalink / raw)
  To: Felix Lechner
  Cc: Ludovic Courtès, Pierre Neidhardt, 30435, guix-devel, hmk

Hi Felix,

Felix Lechner <felix.lechner@lease-up.com> writes:

> Hi,
>
> On Mon, Feb 20, 2023 at 8:06 AM Maxim Cournoyer
> <maxim.cournoyer@gmail.com> wrote:
>>
>> I haven't seen this problem in a long while, so I'm inclined to think
>> it's been resolved.
>
> I think I had that issue with a fresh install within the last year and
> based on advice in IRC (thanks nckx!) ran 'fc-cache -fv'.

OK, thanks for the information; let's leave this bug open then.

> For what it's worth, I believe Debian's packaging tools (in this case,
> Debhelper) detect changes to the font directories and add a font
> update hook to the package installation scripts. Since we do not have
> such scripts—and I am with Ludo' that it's probably a feature worth
> preserving—maybe our package manager could run the hook?

Another idea: modify fontconfig so that it never creates or uses cache.
Revisit later if it causes performance problems (I doubt it would).

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-02-20 18:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bad1fc034ed4a0a4dbf14f74d431b7ae@posteo.de>
2020-04-02  9:09 ` bug#30435: libreoffice: Fonts don't show up after install Pierre Neidhardt
2020-04-02  9:19   ` Nicolò Balzarotti
2020-04-02  9:37     ` John Soo
2020-04-02 15:47     ` Ludovic Courtès
2020-04-02 15:46   ` Ludovic Courtès
2020-04-02 15:59     ` Pierre Neidhardt
2023-02-20 16:05     ` Maxim Cournoyer
2023-02-20 17:32       ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-02-20 18:22         ` Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).