public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* postinstall: fontconfig abnormal exit
@ 2020-09-08  6:43 Fergus Daly
  2020-09-08 12:03 ` Hamish McIntyre-Bhatty
  2020-09-08 14:16 ` Andrey Repin
  0 siblings, 2 replies; 29+ messages in thread
From: Fergus Daly @ 2020-09-08  6:43 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'; +Cc: Fergus Daly

Sorry if this has been asked 4 million times already.
During postinstall, both at ground-zero installation and at every update thereafter, and for both Cygwin-32 and -64,
(both using the appropriate setup-x86[_64].exe) I get:
running: {pathToCygwin}\bin\bash.exe --norc --noprofile "/etc/postinstall/fontconfig_dtd.sh"
abnormal exit: exit code=2
Is there something that can be done to address this "error", if that is what it is, or is it just a quirk of setup?
Thank you!


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

* Re: postinstall: fontconfig abnormal exit
  2020-09-08  6:43 postinstall: fontconfig abnormal exit Fergus Daly
@ 2020-09-08 12:03 ` Hamish McIntyre-Bhatty
  2020-09-08 14:16 ` Andrey Repin
  1 sibling, 0 replies; 29+ messages in thread
From: Hamish McIntyre-Bhatty @ 2020-09-08 12:03 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1.1: Type: text/plain, Size: 977 bytes --]

On 08/09/2020 07:43, Fergus Daly via Cygwin wrote:
> Sorry if this has been asked 4 million times already.
> During postinstall, both at ground-zero installation and at every update thereafter, and for both Cygwin-32 and -64,
> (both using the appropriate setup-x86[_64].exe) I get:
> running: {pathToCygwin}\bin\bash.exe --norc --noprofile "/etc/postinstall/fontconfig_dtd.sh"
> abnormal exit: exit code=2
> Is there something that can be done to address this "error", if that is what it is, or is it just a quirk of setup?
> Thank you!
>
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

I have this issue too, at least on first install. I just ignored it and
assumed it wasn't a big deal, but it would be nice to know why this
happens if others experience it too.

Hamish


[-- Attachment #1.1.2: 0x87B761FE07F548D6.asc --]
[-- Type: application/pgp-keys, Size: 3235 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-08  6:43 postinstall: fontconfig abnormal exit Fergus Daly
  2020-09-08 12:03 ` Hamish McIntyre-Bhatty
@ 2020-09-08 14:16 ` Andrey Repin
  2020-09-08 15:18   ` Fergus Daly
  1 sibling, 1 reply; 29+ messages in thread
From: Andrey Repin @ 2020-09-08 14:16 UTC (permalink / raw)
  To: Fergus Daly, cygwin

Greetings, Fergus Daly!

> Sorry if this has been asked 4 million times already.
> During postinstall, both at ground-zero installation and at every update
> thereafter, and for both Cygwin-32 and -64,
> (both using the appropriate setup-x86[_64].exe) I get:
> running: {pathToCygwin}\bin\bash.exe --norc --noprofile "/etc/postinstall/fontconfig_dtd.sh"
> abnormal exit: exit code=2
> Is there something that can be done to address this "error", if that is
> what it is, or is it just a quirk of setup?

Run the same command manually and see where it's failing.
IIRC (as this has been raised before), the problem is that a certain
file/directory not exists.
Check the mailing list archive?


-- 
With best regards,
Andrey Repin
Tuesday, September 8, 2020 17:16:06

Sorry for my terrible english...


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

* RE: postinstall: fontconfig abnormal exit
  2020-09-08 14:16 ` Andrey Repin
@ 2020-09-08 15:18   ` Fergus Daly
  2020-09-08 16:14     ` Brian Inglis
  2020-09-10  5:23     ` Fergus Daly
  0 siblings, 2 replies; 29+ messages in thread
From: Fergus Daly @ 2020-09-08 15:18 UTC (permalink / raw)
  To: cygwin; +Cc: Fergus Daly, Andrey Repin, kbrown

> Greetings, Fergus Daly!

>> Sorry if this has been asked 4 million times already.
>> During postinstall, both at ground-zero installation and at every update
>> thereafter, and for both Cygwin-32 and -64,
>> (both using the appropriate setup-x86[_64].exe) I get:
>> running: {pathToCygwin}\bin\bash.exe --norc --noprofile "/etc/postinstall/fontconfig_dtd.sh"
>> abnormal exit: exit code=2
>> Is there something that can be done to address this "error", if that is
>> what it is, or is it just a quirk of setup?

> Run the same command manually and see where it's failing.
> IIRC (as this has been raised before), the problem is that a certain
> file/directory not exists.
> Check the mailing list archive?

Thank you for this advice.

1
For a long time (years) I have included an empty file
/etc/X11/fontpath.d/thisisafile
in my architecture as a workaround to address some installation problem,
the nature of which I have completely forgotten.
Having incorporated this dummy file, I should then re-install some package,
but precisely which one I have regrettably also forgotten.   

2
This kind suggestion came from Ken Brown. By a strange coincidence, less than a week ago,
https://cygwin.com/pipermail/cygwin/2020-September/246128.html,
I lamented the lack of ease with which one may search this archive. I just searched in a limited way
to try to discover the problem for which Ken's workaround provided the cure, but without success.

3
I also just now added "fontconfig" to my setup using "setup -P fontconfig" and then also ran the command
fc-cache -v
at the bash prompt, and whilst achieving a raft of checks, this has not addressed the original postinstall error
message. 
I did not really think it would, guessing that if the fontconfig package were to successfully address such a
basic (and recurrent) fault, then it would necessarily have been included in Base.

So: nil progress, but thank you for your suggestion.


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

* Re: postinstall: fontconfig abnormal exit
  2020-09-08 15:18   ` Fergus Daly
@ 2020-09-08 16:14     ` Brian Inglis
  2020-09-10  5:23     ` Fergus Daly
  1 sibling, 0 replies; 29+ messages in thread
From: Brian Inglis @ 2020-09-08 16:14 UTC (permalink / raw)
  To: cygwin

On 2020-09-08 09:18, Fergus Daly via Cygwin wrote:
>> Greetings, Fergus Daly!
> 
>>> Sorry if this has been asked 4 million times already.
>>> During postinstall, both at ground-zero installation and at every update
>>> thereafter, and for both Cygwin-32 and -64,
>>> (both using the appropriate setup-x86[_64].exe) I get:
>>> running: {pathToCygwin}\bin\bash.exe --norc --noprofile "/etc/postinstall/fontconfig_dtd.sh"
>>> abnormal exit: exit code=2
>>> Is there something that can be done to address this "error", if that is
>>> what it is, or is it just a quirk of setup?
> 
>> Run the same command manually and see where it's failing.
>> IIRC (as this has been raised before), the problem is that a certain
>> file/directory not exists.
>> Check the mailing list archive?
> 
> Thank you for this advice.
> 
> 1
> For a long time (years) I have included an empty file
> /etc/X11/fontpath.d/thisisafile
> in my architecture as a workaround to address some installation problem,
> the nature of which I have completely forgotten.
> Having incorporated this dummy file, I should then re-install some package,
> but precisely which one I have regrettably also forgotten.   
> 
> 2
> This kind suggestion came from Ken Brown. By a strange coincidence, less than a week ago,
> https://cygwin.com/pipermail/cygwin/2020-September/246128.html,
> I lamented the lack of ease with which one may search this archive. I just searched in a limited way
> to try to discover the problem for which Ken's workaround provided the cure, but without success.
> 
> 3
> I also just now added "fontconfig" to my setup using "setup -P fontconfig" and then also ran the command
> fc-cache -v
> at the bash prompt, and whilst achieving a raft of checks, this has not addressed the original postinstall error
> message. 
> I did not really think it would, guessing that if the fontconfig package were to successfully address such a
> basic (and recurrent) fault, then it would necessarily have been included in Base.
> 
> So: nil progress, but thank you for your suggestion.
$ cygcheck -f /etc/postinstall/fontconfig_dtd.sh
libfontconfig-common-2.13.1-1
$ cygcheck -f /usr/bin/xmlcatalog
libxml2-2.9.10-1
$ cygcheck -f /usr/share/xml/fontconfig/fonts.dtd
libfontconfig-common-2.13.1-1
$ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
                   ==> /etc/postinstall/fontconfig_dtd.sh.done <==
if [ -x /usr/bin/xmlcatalog ] ; then
    /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd"
/usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
fi

==> /etc/postinstall/libxml2.sh.done <==
if test ! -f /etc/xml/catalog; then
        /bin/mkdir -p /etc/xml
        /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
fi
$ llgo /{etc/xml/,usr/bin/xml}catalog /usr/share/xml/fontconfig/fonts.dtd
/etc/postinstall/{fontconfig_dtd,libxml2}.*
-rw-r--r-- 1  152 Jul 28  2019 /etc/postinstall/fontconfig_dtd.sh.done
-rw-r--r-- 1  118 Mar 25  2019 /etc/postinstall/libxml2.sh.done
-rw-r--r-- 1 1.2K Jul 30  2019 /etc/xml/catalog
-rwxr-xr-x 1  18K Aug 15 10:35 /usr/bin/xmlcatalog*
-rw-r--r-- 1 7.1K Jul 28  2019 /usr/share/xml/fontconfig/fonts.dtd

So check the existence of all the files and all the postinstall scripts,
re-execute the latter if necessary, re-install packages if necessary to make
repairs, and ensure the postinstall scripts are renamed with .done appended when
successfully completed.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

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

* RE: postinstall: fontconfig abnormal exit
  2020-09-08 15:18   ` Fergus Daly
  2020-09-08 16:14     ` Brian Inglis
@ 2020-09-10  5:23     ` Fergus Daly
  2020-09-10  5:35       ` Andrey Repin
  1 sibling, 1 reply; 29+ messages in thread
From: Fergus Daly @ 2020-09-10  5:23 UTC (permalink / raw)
  To: cygwin

>> Sorry if this has been asked 4 million times already.


> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
                   ==> /etc/postinstall/fontconfig_dtd.sh.done <==
> if [ -x /usr/bin/xmlcatalog ] ; then
    /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd"
/usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
fi
==> /etc/postinstall/libxml2.sh.done <==
> if test ! -f /etc/xml/catalog; then
        /bin/mkdir -p /etc/xml
        /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
fi
> $ llgo /{etc/xml/,usr/bin/xml}catalog /usr/share/xml/fontconfig/fonts.dtd
/etc/postinstall/{fontconfig_dtd,libxml2}.*

Thank you!
What is llgo in last line? I just get 
bash: llgo: command not found
and nothing from Package Search.

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-10  5:23     ` Fergus Daly
@ 2020-09-10  5:35       ` Andrey Repin
  2020-09-10 10:57         ` Fergus Daly
  0 siblings, 1 reply; 29+ messages in thread
From: Andrey Repin @ 2020-09-10  5:35 UTC (permalink / raw)
  To: Fergus Daly, cygwin

Greetings, Fergus Daly!

>>> Sorry if this has been asked 4 million times already.


>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
>                    ==> /etc/postinstall/fontconfig_dtd.sh.done <==
>> if [ -x /usr/bin/xmlcatalog ] ; then
>     /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd"
> /usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
> fi
==>> /etc/postinstall/libxml2.sh.done <==
>> if test ! -f /etc/xml/catalog; then
>         /bin/mkdir -p /etc/xml
>         /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
> fi
>> $ llgo /{etc/xml/,usr/bin/xml}catalog /usr/share/xml/fontconfig/fonts.dtd
> /etc/postinstall/{fontconfig_dtd,libxml2}.*

> Thank you!
> What is llgo in last line? I just get 
> bash: llgo: command not found
> and nothing from Package Search.

ls -lgo

@Brian, not everybody have same aliases as you ;)


-- 
With best regards,
Andrey Repin
Thursday, September 10, 2020 8:33:21

Sorry for my terrible english...


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

* RE: postinstall: fontconfig abnormal exit
  2020-09-10  5:35       ` Andrey Repin
@ 2020-09-10 10:57         ` Fergus Daly
  2020-09-10 14:40           ` Brian Inglis
  0 siblings, 1 reply; 29+ messages in thread
From: Fergus Daly @ 2020-09-10 10:57 UTC (permalink / raw)
  To: cygwin

>>> Sorry if this has been asked 4 million times already.

>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
>                    ==> /etc/postinstall/fontconfig_dtd.sh.done <==
>> if [ -x /usr/bin/xmlcatalog ] ; then
>     /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd"
> /usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
> fi
==>> /etc/postinstall/libxml2.sh.done <==
>> if test ! -f /etc/xml/catalog; then
>         /bin/mkdir -p /etc/xml
>         /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
> fi
>> $ llgo /{etc/xml/,usr/bin/xml}catalog /usr/share/xml/fontconfig/fonts.dtd
> /etc/postinstall/{fontconfig_dtd,libxml2}.*

> Thank you!

Out of interest:
Is this something that would usually be achieved during setup, as in other instances of 
.sh -> .sh.done, but has just fallen off?
Or (say) would it be achieved if I appended some specific package using setup -P?
Or .. .. ? 

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-10 10:57         ` Fergus Daly
@ 2020-09-10 14:40           ` Brian Inglis
  2020-09-11  6:04             ` briand
  0 siblings, 1 reply; 29+ messages in thread
From: Brian Inglis @ 2020-09-10 14:40 UTC (permalink / raw)
  To: cygwin

On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
>>>> Sorry if this has been asked 4 million times already.
> 
>>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
>>                    ==> /etc/postinstall/fontconfig_dtd.sh.done <==
>>> if [ -x /usr/bin/xmlcatalog ] ; then
>>     /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd"
>> /usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
>> fi
> ==>> /etc/postinstall/libxml2.sh.done <==
>>> if test ! -f /etc/xml/catalog; then
>>         /bin/mkdir -p /etc/xml
>>         /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
>> fi
>>> $ llgo /{etc/xml/,usr/bin/xml}catalog /usr/share/xml/fontconfig/fonts.dtd
>> /etc/postinstall/{fontconfig_dtd,libxml2}.*
> 
>> Thank you!
> 
> Out of interest:
> Is this something that would usually be achieved during setup, as in other instances of 
> .sh -> .sh.done, but has just fallen off?
> Or (say) would it be achieved if I appended some specific package using setup -P?
> Or .. .. ? 

Each of the postinstall scripts are installed as part of a package to perform
some aspect of installation that can not be done statically during the package
build as it may depend on dynamic aspects of each user's installation.
The Cygwin Setup program will normally rename the non-permanent (not starting
[0z][p-t]_...) postinstall scripts with suffix .done after successful execution,
so failure of the postinstall script is the usual reason they are not suffixed,
and that should be captured in /var/log/setup.log and /var/log/setup.log.full at
the end of each Setup run, and may be checked using:

	$ fgrep -B1 'abnormal exit: exit code=' /var/log/setup.log*

showing e.g.

--
/var/log/setup.log-2015/10/18 07:27:14 running:
C:\usr\local\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/
texlive-collection-basic.sh"
/var/log/setup.log:2015/10/18 07:27:26 abnormal exit: exit code=2
--
/var/log/setup.log-2016/03/10 17:33:13 running:
C:\usr\local\cygwin64\bin\dash.exe "/etc/postinstall/0p_update-info-dir.
dash"
/var/log/setup.log:2016/03/10 17:33:14 abnormal exit: exit code=127
--
/var/log/setup.log-2016/03/10 17:33:14 running:
C:\usr\local\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/
zp_fontconfig_cache_1.sh"
/var/log/setup.log:2016/03/10 17:33:33 abnormal exit: exit code=3
--
/var/log/setup.log-2016/06/05 03:53:59 running:
C:\usr\local\cygwin64\bin\bash.exe --norc --noprofile "/etc/postinstall/
zp_fontconfig_cache_1.sh"
/var/log/setup.log:2016/06/05 03:54:33 abnormal exit: exit code=1
--
/var/log/setup.log-2017/04/20 21:34:32 running:
C:\usr\local\cygwin64\bin\bash.exe --norc --noprofile
"/etc/postinstall/postinstalltest.sh"
/var/log/setup.log:2017/04/20 21:34:32 abnormal exit: exit code=2
--
/var/log/setup.log-2017/09/07 18:49:13 running:
C:\usr\local\cygwin64\bin\bash.exe --norc --noprofile
"/etc/postinstall/cygwin-doc.sh"
/var/log/setup.log:2017/09/07 18:49:13 abnormal exit: exit code=2
--
/var/log/setup.log-2017/09/08 23:16:33 running:
C:\usr\local\cygwin64\bin\bash.exe --norc --noprofile "/etc/preremove/cygwin-doc.sh"
/var/log/setup.log:2017/09/08 23:16:34 abnormal exit: exit code=1
--
/var/log/setup.log-2017/09/27 23:29:55 running:
C:\usr\local\cygwin64\bin\bash.exe --norc --noprofile "/etc/preremove/rsnapshot.sh"
/var/log/setup.log:2017/09/27 23:29:55 abnormal exit: exit code=1
--

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-10 14:40           ` Brian Inglis
@ 2020-09-11  6:04             ` briand
  2020-09-11  7:22               ` Fergus Daly
  0 siblings, 1 reply; 29+ messages in thread
From: briand @ 2020-09-11  6:04 UTC (permalink / raw)
  To: cygwin

On Thu, 10 Sep 2020 08:40:24 -0600
Brian Inglis <Brian.Inglis@SystematicSw.ab.ca> wrote:

> On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
> >>>> Sorry if this has been asked 4 million times already.  
> >   
> >>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
> >>                    ==> /etc/postinstall/fontconfig_dtd.sh.done <==

hmmm.  i don't understand exactly what this thread is about, but i do know that on my latest fresh install of cygwin, the fontconfig_dtd install is claiming an error at the end.

is this related to that ?

-- 
Brian


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

* RE: postinstall: fontconfig abnormal exit
  2020-09-11  6:04             ` briand
@ 2020-09-11  7:22               ` Fergus Daly
  2020-09-11  8:32                 ` Hamish McIntyre-Bhatty
  0 siblings, 1 reply; 29+ messages in thread
From: Fergus Daly @ 2020-09-11  7:22 UTC (permalink / raw)
  To: cygwin

> On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
> >>>> Sorry if this has been asked 4 million times already.  
> >   
> >>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
> >>                    ==> /etc/postinstall/fontconfig_dtd.sh.done <==

> hmmm.  i don't understand exactly what this thread is about, but i do know that on my latest fresh install of cygwin,
> the fontconfig_dtd install is claiming an error at the end.
> is this related to that ?

Exactly. On first setup and all subsequent updates this post-installation error recurs.
The cure described depends on the presence of several files including one that the script creates if necessary.

PS Before I enlisted help to cure this glitch "properly", I found it and its recurrence sufficiently intrusive to become an annoyance.
Since nothing was obviously broken I guessed that nothing further would be broken by artificially achieving the post-installation 
sequence as follows:
$ mv /etc/postinstall/fontconfig_dtd.sh /etc/postinstall/fontconfig_dtd.sh.done
And so it transpired: nothing awful seemed to happen, or fail to happen, as a consequence of this "fix"; and the error msg stopped.

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11  7:22               ` Fergus Daly
@ 2020-09-11  8:32                 ` Hamish McIntyre-Bhatty
  2020-09-11 11:31                   ` Marco Atzeri
  0 siblings, 1 reply; 29+ messages in thread
From: Hamish McIntyre-Bhatty @ 2020-09-11  8:32 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1.1: Type: text/plain, Size: 1938 bytes --]

On 11/09/2020 08:22, Fergus Daly via Cygwin wrote:
>> On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
>>>>>> Sorry if this has been asked 4 million times already.  
>>>   
>>>>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
>>>>                    ==> /etc/postinstall/fontconfig_dtd.sh.done <==
>> hmmm.  i don't understand exactly what this thread is about, but i do know that on my latest fresh install of cygwin,
>> the fontconfig_dtd install is claiming an error at the end.
>> is this related to that ?
> Exactly. On first setup and all subsequent updates this post-installation error recurs.
> The cure described depends on the presence of several files including one that the script creates if necessary.
>
> PS Before I enlisted help to cure this glitch "properly", I found it and its recurrence sufficiently intrusive to become an annoyance.
> Since nothing was obviously broken I guessed that nothing further would be broken by artificially achieving the post-installation 
> sequence as follows:
> $ mv /etc/postinstall/fontconfig_dtd.sh /etc/postinstall/fontconfig_dtd.sh.done
> And so it transpired: nothing awful seemed to happen, or fail to happen, as a consequence of this "fix"; and the error msg stopped.

I agree this should be fixed - it is annoying, and I also don't think
it's a new bug by any stretch: I had this last September when I was
first looking at getting wxPython to compile in Cygwin.

Also it's, in my opinion, not a great user experience to have end users
immediately thing something is wrong after the first install. Despite
the fact that it doesn't seem to matter, it doesn't inspire confidence
for first-time users. I haven't followed this very closely so I'm aware
it might be hard to fix, and I very much appreciate all the effort put
in to Cygwin, but I reckon this one would help a lot with the first
impressions & attitude of a new Cygwin user.

Hamish


[-- Attachment #1.1.2: 0x87B761FE07F548D6.asc --]
[-- Type: application/pgp-keys, Size: 3235 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11  8:32                 ` Hamish McIntyre-Bhatty
@ 2020-09-11 11:31                   ` Marco Atzeri
  2020-09-11 13:12                     ` Ken Brown
  2020-09-11 13:18                     ` Fergus Daly
  0 siblings, 2 replies; 29+ messages in thread
From: Marco Atzeri @ 2020-09-11 11:31 UTC (permalink / raw)
  To: cygwin

On 11.09.2020 10:32, Hamish McIntyre-Bhatty via Cygwin wrote:
> On 11/09/2020 08:22, Fergus Daly via Cygwin wrote:
>>> On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
>>>>>>> Sorry if this has been asked 4 million times already.
>>>>    
>>>>>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
>>>>>                     ==> /etc/postinstall/fontconfig_dtd.sh.done <==
>>> hmmm.  i don't understand exactly what this thread is about, but i do know that on my latest fresh install of cygwin,
>>> the fontconfig_dtd install is claiming an error at the end.
>>> is this related to that ?
>> Exactly. On first setup and all subsequent updates this post-installation error recurs.
>> The cure described depends on the presence of several files including one that the script creates if necessary.
>>
>> PS Before I enlisted help to cure this glitch "properly", I found it and its recurrence sufficiently intrusive to become an annoyance.
>> Since nothing was obviously broken I guessed that nothing further would be broken by artificially achieving the post-installation
>> sequence as follows:
>> $ mv /etc/postinstall/fontconfig_dtd.sh /etc/postinstall/fontconfig_dtd.sh.done

this remove the action, does not solve it

what`s happen if you just run

   /etc/postinstall/fontconfig_dtd.sh

any error message ?

>> And so it transpired: nothing awful seemed to happen, or fail to happen, as a consequence of this "fix"; and the error msg stopped.
> 
> I agree this should be fixed - it is annoying, and I also don't think
> it's a new bug by any stretch: I had this last September when I was
> first looking at getting wxPython to compile in Cygwin.
> 
> Also it's, in my opinion, not a great user experience to have end users
> immediately thing something is wrong after the first install. Despite
> the fact that it doesn't seem to matter, it doesn't inspire confidence
> for first-time users. I haven't followed this very closely so I'm aware
> it might be hard to fix, and I very much appreciate all the effort put
> in to Cygwin, but I reckon this one would help a lot with the first
> impressions & attitude of a new Cygwin user.
> 
> Hamish
> 

check on /var/log/setup.log.full for any hints on what is going wrong

Installing just base+fontconfig is not providing any error,
so it must be an interaction of fontconfig with some other package




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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 11:31                   ` Marco Atzeri
@ 2020-09-11 13:12                     ` Ken Brown
  2020-09-11 14:41                       ` Marco Atzeri
  2020-09-11 13:18                     ` Fergus Daly
  1 sibling, 1 reply; 29+ messages in thread
From: Ken Brown @ 2020-09-11 13:12 UTC (permalink / raw)
  To: cygwin

On 9/11/2020 7:31 AM, Marco Atzeri via Cygwin wrote:
> On 11.09.2020 10:32, Hamish McIntyre-Bhatty via Cygwin wrote:
>> On 11/09/2020 08:22, Fergus Daly via Cygwin wrote:
>>>> On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
>>>>>>>> Sorry if this has been asked 4 million times already.
>>>>>>> $ head /etc/postinstall/{fontconfig_dtd,libxml2}.*
>>>>>>                     ==> /etc/postinstall/fontconfig_dtd.sh.done <==
>>>> hmmm.  i don't understand exactly what this thread is about, but i do know 
>>>> that on my latest fresh install of cygwin,
>>>> the fontconfig_dtd install is claiming an error at the end.
>>>> is this related to that ?
>>> Exactly. On first setup and all subsequent updates this post-installation 
>>> error recurs.
>>> The cure described depends on the presence of several files including one 
>>> that the script creates if necessary.
>>>
>>> PS Before I enlisted help to cure this glitch "properly", I found it and its 
>>> recurrence sufficiently intrusive to become an annoyance.
>>> Since nothing was obviously broken I guessed that nothing further would be 
>>> broken by artificially achieving the post-installation
>>> sequence as follows:
>>> $ mv /etc/postinstall/fontconfig_dtd.sh /etc/postinstall/fontconfig_dtd.sh.done
> 
> this remove the action, does not solve it
> 
> what`s happen if you just run
> 
>    /etc/postinstall/fontconfig_dtd.sh
> 
> any error message ?
> 
>>> And so it transpired: nothing awful seemed to happen, or fail to happen, as a 
>>> consequence of this "fix"; and the error msg stopped.
>>
>> I agree this should be fixed - it is annoying, and I also don't think
>> it's a new bug by any stretch: I had this last September when I was
>> first looking at getting wxPython to compile in Cygwin.
>>
>> Also it's, in my opinion, not a great user experience to have end users
>> immediately thing something is wrong after the first install. Despite
>> the fact that it doesn't seem to matter, it doesn't inspire confidence
>> for first-time users. I haven't followed this very closely so I'm aware
>> it might be hard to fix, and I very much appreciate all the effort put
>> in to Cygwin, but I reckon this one would help a lot with the first
>> impressions & attitude of a new Cygwin user.
>>
>> Hamish
>>
> 
> check on /var/log/setup.log.full for any hints on what is going wrong
> 
> Installing just base+fontconfig is not providing any error,
> so it must be an interaction of fontconfig with some other package

You can reproduce the problem by doing a fresh install and choosing 
libfontconfig-common and libxml2.  setup.log.full shows

running: C:\cygwin64temp\bin\bash.exe --norc --noprofile 
"/etc/postinstall/fontconfig_dtd.sh"
could not open /etc/xml/catalog for saving

Marco, libxml2 used to have a postinstall script that would create /etc/xml/catalog:

$ cat /etc/postinstall/libxml2.sh.done
if test ! -f /etc/xml/catalog; then
         /bin/mkdir -p /etc/xml
         /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
fi

But this seems to have disappeared from the most recent release.

Ken

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

* RE: postinstall: fontconfig abnormal exit
  2020-09-11 11:31                   ` Marco Atzeri
  2020-09-11 13:12                     ` Ken Brown
@ 2020-09-11 13:18                     ` Fergus Daly
  1 sibling, 0 replies; 29+ messages in thread
From: Fergus Daly @ 2020-09-11 13:18 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

>> Installing just base+fontconfig is not providing any error,
>> so it must be an interaction of fontconfig with some other package

The problematic package is texlive-connection-latex.
(There might be others too but this seemed the most likely from my own particular setup, and so it proved.)

setup -P texlive-connection-latex -mn
i.e. just Base + TeX + requirements induces  
/etc/postinstall/fontconfig_dtd.sh (i.e. NOT .done)
and the error message.

(The "-mn" saves a lot of time, I think, by avoiding md5sum checks?)

Loading fontconfig AFTER this does not help. Nor does loading fontconfig WITH everything else.
Yes, I checked both of these variants.

However:
setup -P fontconfig -mn
THEN
setup -P {everything else} -mn
sees to everything properly (as far as I can tell).

This two-stage installation is definitely a hassle, but may be better than just renaming font..sh to font..sh.done, my alternative "fix".
Fergus


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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 13:12                     ` Ken Brown
@ 2020-09-11 14:41                       ` Marco Atzeri
  2020-09-11 19:47                         ` Ken Brown
  0 siblings, 1 reply; 29+ messages in thread
From: Marco Atzeri @ 2020-09-11 14:41 UTC (permalink / raw)
  To: cygwin

On 11.09.2020 15:12, Ken Brown via Cygwin wrote:
> On 9/11/2020 7:31 AM, Marco Atzeri via Cygwin wrote:
>> On 11.09.2020 10:32, Hamish McIntyre-Bhatty via Cygwin wrote:
>>> On 11/09/2020 08:22, Fergus Daly via Cygwin wrote:
>>>>> On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
>>>>>>>>> Sorry if this has been asked 4 million times already.

>>
>> Installing just base+fontconfig is not providing any error,
>> so it must be an interaction of fontconfig with some other package
> 
> You can reproduce the problem by doing a fresh install and choosing 
> libfontconfig-common and libxml2.  setup.log.full shows
> 
> running: C:\cygwin64temp\bin\bash.exe --norc --noprofile 
> "/etc/postinstall/fontconfig_dtd.sh"
> could not open /etc/xml/catalog for saving
> 
> Marco, libxml2 used to have a postinstall script that would create 
> /etc/xml/catalog:
> 
> $ cat /etc/postinstall/libxml2.sh.done
> if test ! -f /etc/xml/catalog; then
>          /bin/mkdir -p /etc/xml
>          /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
> fi
> 
> But this seems to have disappeared from the most recent release.

noted.
libxml2-2.9.10-2 on the build stage

> 
> Ken

Thanks
Marco


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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 14:41                       ` Marco Atzeri
@ 2020-09-11 19:47                         ` Ken Brown
  2020-09-11 20:30                           ` Achim Gratz
  2020-09-12 18:16                           ` Andrey Repin
  0 siblings, 2 replies; 29+ messages in thread
From: Ken Brown @ 2020-09-11 19:47 UTC (permalink / raw)
  To: cygwin

On 9/11/2020 10:41 AM, Marco Atzeri via Cygwin wrote:
> On 11.09.2020 15:12, Ken Brown via Cygwin wrote:
>> On 9/11/2020 7:31 AM, Marco Atzeri via Cygwin wrote:
>>> On 11.09.2020 10:32, Hamish McIntyre-Bhatty via Cygwin wrote:
>>>> On 11/09/2020 08:22, Fergus Daly via Cygwin wrote:
>>>>>> On 2020-09-10 04:57, Fergus Daly via Cygwin wrote:
>>>>>>>>>> Sorry if this has been asked 4 million times already.
> 
>>>
>>> Installing just base+fontconfig is not providing any error,
>>> so it must be an interaction of fontconfig with some other package
>>
>> You can reproduce the problem by doing a fresh install and choosing 
>> libfontconfig-common and libxml2.  setup.log.full shows
>>
>> running: C:\cygwin64temp\bin\bash.exe --norc --noprofile 
>> "/etc/postinstall/fontconfig_dtd.sh"
>> could not open /etc/xml/catalog for saving
>>
>> Marco, libxml2 used to have a postinstall script that would create 
>> /etc/xml/catalog:
>>
>> $ cat /etc/postinstall/libxml2.sh.done
>> if test ! -f /etc/xml/catalog; then
>>          /bin/mkdir -p /etc/xml
>>          /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
>> fi
>>
>> But this seems to have disappeared from the most recent release.
> 
> noted.
> libxml2-2.9.10-2 on the build stage

Unfortunately, this doesn't yet fix the problem with fontconfig_dtd.sh.  The 
latter will now succeed if it is run after libxml2.sh, but not if it is run 
first.  I'm not aware of any way to force setup to run one postinstall script 
before another.  So maybe fontconfig_dtd.sh should be modified to include the 
contents of libxml2.sh, like this:

$ cat fontconfig_dtd.sh
if [ -x /usr/bin/xmlcatalog ] ; then
     if [ ! -f /etc/xml/catalog ] ; then
         /bin/mkdir -p /etc/xml
         /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
     fi
     /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd" 
/usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
fi

I can do a non-maintainer update of fontconfig that makes this change if people 
agree that it's a good idea.

Ken

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 19:47                         ` Ken Brown
@ 2020-09-11 20:30                           ` Achim Gratz
  2020-09-11 21:13                             ` Ken Brown
  2020-09-12 18:16                           ` Andrey Repin
  1 sibling, 1 reply; 29+ messages in thread
From: Achim Gratz @ 2020-09-11 20:30 UTC (permalink / raw)
  To: cygwin

Ken Brown via Cygwin writes:
> Unfortunately, this doesn't yet fix the problem with
> fontconfig_dtd.sh.  The latter will now succeed if it is run after
> libxml2.sh, but not if it is run first.  I'm not aware of any way to
> force setup to run one postinstall script before another.

Multiple ways:

1. Make the libxml postinstall script sort lexically before any others
that depend on it.  Obviously this is brittle, but it might work in this
particular instance (autorebase does this).

2.  Make the libxml catalog creation a perpetual postinstall script with
prefix "0p_".  That only works if it doesn't depend on other postinstall
scripts having their work completed.

3. Implement and use the stratified postinstall concept originally
outlined at:
https://sourceware.org/legacy-ml/cygwin-apps/2014-12/msg00148.html

4. Use the package dependency order to order the postinstall script
activation.  With libzypp we should have the correct information, we'd
just need to somehow make the packagemeta iterator use it.  That still
won't work if we have dependency loops.

5. (Try to) Run any failed postinstalls again in setup and bail only if
the number of fails does not decrease from the last iteration.

At the time it was deemed too complicated and so we only use the "end"
strata for the perpetual postinstall scripts.  As said then, there would
need to be some serious discussion on how to coordinate the strata
assignments.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 20:30                           ` Achim Gratz
@ 2020-09-11 21:13                             ` Ken Brown
  2020-09-12  5:18                               ` Brian Inglis
  2020-09-12  6:08                               ` ASSI
  0 siblings, 2 replies; 29+ messages in thread
From: Ken Brown @ 2020-09-11 21:13 UTC (permalink / raw)
  To: cygwin

On 9/11/2020 4:30 PM, Achim Gratz wrote:
> Ken Brown via Cygwin writes:
>> Unfortunately, this doesn't yet fix the problem with
>> fontconfig_dtd.sh.  The latter will now succeed if it is run after
>> libxml2.sh, but not if it is run first.  I'm not aware of any way to
>> force setup to run one postinstall script before another.
> 
> Multiple ways:
> 
> 1. Make the libxml postinstall script sort lexically before any others
> that depend on it.  Obviously this is brittle, but it might work in this
> particular instance (autorebase does this).
> 
> 2.  Make the libxml catalog creation a perpetual postinstall script with
> prefix "0p_".  That only works if it doesn't depend on other postinstall
> scripts having their work completed.
> 
> 3. Implement and use the stratified postinstall concept originally
> outlined at:
> https://sourceware.org/legacy-ml/cygwin-apps/2014-12/msg00148.html
> 
> 4. Use the package dependency order to order the postinstall script
> activation.  With libzypp we should have the correct information, we'd
> just need to somehow make the packagemeta iterator use it.  That still
> won't work if we have dependency loops.
> 
> 5. (Try to) Run any failed postinstalls again in setup and bail only if
> the number of fails does not decrease from the last iteration.
> 
> At the time it was deemed too complicated and so we only use the "end"
> strata for the perpetual postinstall scripts.  As said then, there would
> need to be some serious discussion on how to coordinate the strata
> assignments.

There's no dependency relation between libxml2 and libfontconfig-common, so #4 
wouldn't fix the problem.  And some of the other suggestions would require work 
on setup.exe that someone would have to do.  The current problem is simple to 
fix and shouldn't have to wait for that.

I like your idea of using perpetual postinstall scripts.  I think the way to do 
it is probably to make fontconfig_dtd.sh perpetual with prefix "zp_".  That way 
if libfontconfig-common is installed without libxml2 but then libxml2 is 
installed later, the xmlcatalog command gets run.  We would have to check that 
no harm is done if that xmlcatalog command gets run more than once.

Ken

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 21:13                             ` Ken Brown
@ 2020-09-12  5:18                               ` Brian Inglis
  2020-09-12 12:56                                 ` Ken Brown
  2020-09-12  6:08                               ` ASSI
  1 sibling, 1 reply; 29+ messages in thread
From: Brian Inglis @ 2020-09-12  5:18 UTC (permalink / raw)
  To: cygwin

On 2020-09-11 15:13, Ken Brown via Cygwin wrote:
> On 9/11/2020 4:30 PM, Achim Gratz wrote:
>> Ken Brown via Cygwin writes:
>>> Unfortunately, this doesn't yet fix the problem with
>>> fontconfig_dtd.sh.  The latter will now succeed if it is run after
>>> libxml2.sh, but not if it is run first.  I'm not aware of any way to
>>> force setup to run one postinstall script before another.
>>
>> Multiple ways:
>>
>> 1. Make the libxml postinstall script sort lexically before any others
>> that depend on it.  Obviously this is brittle, but it might work in this
>> particular instance (autorebase does this).
>>
>> 2.  Make the libxml catalog creation a perpetual postinstall script with
>> prefix "0p_".  That only works if it doesn't depend on other postinstall
>> scripts having their work completed.
>>
>> 3. Implement and use the stratified postinstall concept originally
>> outlined at:
>> https://sourceware.org/legacy-ml/cygwin-apps/2014-12/msg00148.html
>>
>> 4. Use the package dependency order to order the postinstall script
>> activation.  With libzypp we should have the correct information, we'd
>> just need to somehow make the packagemeta iterator use it.  That still
>> won't work if we have dependency loops.
>>
>> 5. (Try to) Run any failed postinstalls again in setup and bail only if
>> the number of fails does not decrease from the last iteration.
>>
>> At the time it was deemed too complicated and so we only use the "end"
>> strata for the perpetual postinstall scripts.  As said then, there would
>> need to be some serious discussion on how to coordinate the strata
>> assignments.
> 
> There's no dependency relation between libxml2 and libfontconfig-common, so #4
> wouldn't fix the problem.  And some of the other suggestions would require work
> on setup.exe that someone would have to do.  The current problem is simple to
> fix and shouldn't have to wait for that.
> 
> I like your idea of using perpetual postinstall scripts.  I think the way to do
> it is probably to make fontconfig_dtd.sh perpetual with prefix "zp_".  That way
> if libfontconfig-common is installed without libxml2 but then libxml2 is
> installed later, the xmlcatalog command gets run.  We would have to check that
> no harm is done if that xmlcatalog command gets run more than once.

As libxml2 supplies /usr/bin/xmlcatalog, that postinstall script should both
conditionally create the catalog and only if just created, also conditionally
add fonts.dtd, as those scripts are run on each upgrade, although as the add
actually replaces the fonts.dtd entry, no harm should be done by repetition.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]


[TL;DR: We do not want to add more permanent postinstall scripts unless essential!
Permanent postinstall scripts can greatly extend the run time of the Cygwin
Setup program, when fontconfig, man-db, or tex just seem to decide sometimes for
some reason that another whole new world of fonts, man pages, or whatever has
appeared that they have to reprocess, pushing the Setup run time and service
(cron) downtime to hours if you don't notice, terminate the postinstall, and
rerun in the background.
I've had to deinstall packages by playing with the Setup dependency solver
results, just to eliminate their permanent postinstall scripts that often cause
extended delays.
It's not as if run Setup frequently, or take anything down if I can help it, and
prefer to wait until I have 10s of MB of package upgrades to apply to make it
worthwhile to shut down services, mainly right before restarting to allowing
that month's Windows updates to be applied once they are deemed safe to go.]


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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 21:13                             ` Ken Brown
  2020-09-12  5:18                               ` Brian Inglis
@ 2020-09-12  6:08                               ` ASSI
  2020-09-13 16:53                                 ` Ken Brown
  1 sibling, 1 reply; 29+ messages in thread
From: ASSI @ 2020-09-12  6:08 UTC (permalink / raw)
  To: cygwin

Ken Brown via Cygwin writes:
> There's no dependency relation between libxml2 and
> libfontconfig-common, so #4 wouldn't fix the problem.

You'd have to introduce a provides you could depend on, yes.

> And some of the other suggestions would require work on setup.exe that
> someone would have to do.  The current problem is simple to fix and
> shouldn't have to wait for that.

Sure, I was just pointing out that these things have a spectrum of both
inherent and solution complexity.  Activating an additional postinstall
stratum is in fact just adding one character to one constant string in
postinstall.cc, but how to actually use it would be a more involved
discussion.

> I like your idea of using perpetual postinstall scripts.  I think the
> way to do it is probably to make fontconfig_dtd.sh perpetual with
> prefix "zp_".

Yes, that seems like a better solution.  I see a lot of the texlive
stuff already works this way and it appears to have no problems.  While
you're at it, please make it a dash script unless you really need
bashisms.

> That way if libfontconfig-common is installed without
> libxml2 but then libxml2 is installed later, the xmlcatalog command
> gets run.  We would have to check that no harm is done if that
> xmlcatalog command gets run more than once.

From memory, I think as long as you only "--add/--del" then that should
work, but "--create" would clobber any existing content.  So libxml2
postinstall should install the default/empty catalog file and then any
other package should just add/delete the entries that are under control
of that package.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-12  5:18                               ` Brian Inglis
@ 2020-09-12 12:56                                 ` Ken Brown
  2021-07-20 17:00                                   ` Brian Inglis
  0 siblings, 1 reply; 29+ messages in thread
From: Ken Brown @ 2020-09-12 12:56 UTC (permalink / raw)
  To: cygwin

On 9/12/2020 1:18 AM, Brian Inglis wrote:
> On 2020-09-11 15:13, Ken Brown via Cygwin wrote:
>> On 9/11/2020 4:30 PM, Achim Gratz wrote:
>>> Ken Brown via Cygwin writes:
>>>> Unfortunately, this doesn't yet fix the problem with
>>>> fontconfig_dtd.sh.  The latter will now succeed if it is run after
>>>> libxml2.sh, but not if it is run first.  I'm not aware of any way to
>>>> force setup to run one postinstall script before another.
>>>
>>> Multiple ways:
>>>
>>> 1. Make the libxml postinstall script sort lexically before any others
>>> that depend on it.  Obviously this is brittle, but it might work in this
>>> particular instance (autorebase does this).
>>>
>>> 2.  Make the libxml catalog creation a perpetual postinstall script with
>>> prefix "0p_".  That only works if it doesn't depend on other postinstall
>>> scripts having their work completed.
>>>
>>> 3. Implement and use the stratified postinstall concept originally
>>> outlined at:
>>> https://sourceware.org/legacy-ml/cygwin-apps/2014-12/msg00148.html
>>>
>>> 4. Use the package dependency order to order the postinstall script
>>> activation.  With libzypp we should have the correct information, we'd
>>> just need to somehow make the packagemeta iterator use it.  That still
>>> won't work if we have dependency loops.
>>>
>>> 5. (Try to) Run any failed postinstalls again in setup and bail only if
>>> the number of fails does not decrease from the last iteration.
>>>
>>> At the time it was deemed too complicated and so we only use the "end"
>>> strata for the perpetual postinstall scripts.  As said then, there would
>>> need to be some serious discussion on how to coordinate the strata
>>> assignments.
>>
>> There's no dependency relation between libxml2 and libfontconfig-common, so #4
>> wouldn't fix the problem.  And some of the other suggestions would require work
>> on setup.exe that someone would have to do.  The current problem is simple to
>> fix and shouldn't have to wait for that.
>>
>> I like your idea of using perpetual postinstall scripts.  I think the way to do
>> it is probably to make fontconfig_dtd.sh perpetual with prefix "zp_".  That way
>> if libfontconfig-common is installed without libxml2 but then libxml2 is
>> installed later, the xmlcatalog command gets run.  We would have to check that
>> no harm is done if that xmlcatalog command gets run more than once.
> 
> As libxml2 supplies /usr/bin/xmlcatalog, that postinstall script should both
> conditionally create the catalog and only if just created, also conditionally
> add fonts.dtd,

No, the libxml2 postinstall script shouldn't add fonts.dtd.  That should be 
added only when/if fontconfig is installed.  So it's an appropriate task for a 
fontconfig postinstall script.

> [TL;DR: We do not want to add more permanent postinstall scripts unless essential!

Making fontconfig_dtd.sh perpetual may or may not be essential, but it's the 
best way I can think of to solve the problem of this bug report.  Can you 
propose a better way?

> Permanent postinstall scripts can greatly extend the run time of the Cygwin
> Setup program, when fontconfig, man-db, or tex just seem to decide sometimes for
> some reason that another whole new world of fonts, man pages, or whatever has
> appeared that they have to reprocess,

If you see a perpetual postinstall script doing something time-consuming that 
you think is unnecessary, please make a bug report.

> pushing the Setup run time and service
> (cron) downtime to hours

I've never seen this.  Please give details.

Ken

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-11 19:47                         ` Ken Brown
  2020-09-11 20:30                           ` Achim Gratz
@ 2020-09-12 18:16                           ` Andrey Repin
  2020-09-14 15:47                             ` Hamish McIntyre-Bhatty
  1 sibling, 1 reply; 29+ messages in thread
From: Andrey Repin @ 2020-09-12 18:16 UTC (permalink / raw)
  To: Ken Brown, cygwin

Greetings, Ken Brown!

> Unfortunately, this doesn't yet fix the problem with fontconfig_dtd.sh.  The
> latter will now succeed if it is run after libxml2.sh, but not if it is run 
> first.  I'm not aware of any way to force setup to run one postinstall script 
> before another.  So maybe fontconfig_dtd.sh should be modified to include the 
> contents of libxml2.sh, like this:

> $ cat fontconfig_dtd.sh
> if [ -x /usr/bin/xmlcatalog ] ; then
>      if [ ! -f /etc/xml/catalog ] ; then
>          /bin/mkdir -p /etc/xml
>          /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
>      fi
>      /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd" 
> /usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
> fi

install --verbose --mode=0755 --directory -- /etc/xml/catalog

> I can do a non-maintainer update of fontconfig that makes this change if people
> agree that it's a good idea.


-- 
With best regards,
Andrey Repin
Saturday, September 12, 2020 21:14:31

Sorry for my terrible english...


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

* Re: postinstall: fontconfig abnormal exit
  2020-09-12  6:08                               ` ASSI
@ 2020-09-13 16:53                                 ` Ken Brown
  2020-09-16  8:42                                   ` Fergus Daly
  0 siblings, 1 reply; 29+ messages in thread
From: Ken Brown @ 2020-09-13 16:53 UTC (permalink / raw)
  To: cygwin

On 9/12/2020 2:08 AM, ASSI wrote:
>> I like your idea of using perpetual postinstall scripts.  I think the
>> way to do it is probably to make fontconfig_dtd.sh perpetual with
>> prefix "zp_".
> Yes, that seems like a better solution.  I see a lot of the texlive
> stuff already works this way and it appears to have no problems.  While
> you're at it, please make it a dash script unless you really need
> bashisms.

I've done this now.  I also fixed the fontconfig preremove scripts while I was 
at it.  They had names different from their package names; as a result, they 
were never run.

Fergus and Hamish, the problem you reported should be fixed with fontconfig 
2.13.1-2 and libxml2-2.9.10-2.

Ken

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

* Re: postinstall: fontconfig abnormal exit
  2020-09-12 18:16                           ` Andrey Repin
@ 2020-09-14 15:47                             ` Hamish McIntyre-Bhatty
  0 siblings, 0 replies; 29+ messages in thread
From: Hamish McIntyre-Bhatty @ 2020-09-14 15:47 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1.1: Type: text/plain, Size: 1046 bytes --]

On 12/09/2020 19:16, Andrey Repin wrote:
> Greetings, Ken Brown!
>
>> Unfortunately, this doesn't yet fix the problem with fontconfig_dtd.sh.  The
>> latter will now succeed if it is run after libxml2.sh, but not if it is run 
>> first.  I'm not aware of any way to force setup to run one postinstall script 
>> before another.  So maybe fontconfig_dtd.sh should be modified to include the 
>> contents of libxml2.sh, like this:
>> $ cat fontconfig_dtd.sh
>> if [ -x /usr/bin/xmlcatalog ] ; then
>>      if [ ! -f /etc/xml/catalog ] ; then
>>          /bin/mkdir -p /etc/xml
>>          /usr/bin/xmlcatalog --noout --create /etc/xml/catalog
>>      fi
>>      /usr/bin/xmlcatalog --noout --add "system" "fonts.dtd" 
>> /usr/share/xml/fontconfig/fonts.dtd /etc/xml/catalog
>> fi
> install --verbose --mode=0755 --directory -- /etc/xml/catalog
>
>> I can do a non-maintainer update of fontconfig that makes this change if people
>> agree that it's a good idea.

NB: The fix for this has worked for me. Thank you.

Hamish


[-- Attachment #1.1.2: 0x87B761FE07F548D6.asc --]
[-- Type: application/pgp-keys, Size: 3235 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* RE: postinstall: fontconfig abnormal exit
  2020-09-13 16:53                                 ` Ken Brown
@ 2020-09-16  8:42                                   ` Fergus Daly
  0 siblings, 0 replies; 29+ messages in thread
From: Fergus Daly @ 2020-09-16  8:42 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

>> Fergus and Hamish, the problem you reported should be fixed with
>> fontconfig 2.13.1-2 and libxml2-2.9.10-2.

Yes: all good now.
For me, anyway: I tried
setup-x86.exe -P texlive-collection-latex -mn
(i.e. just Base + TeX) which earlier caused the problem: no errors.
Thank you!


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

* Re: postinstall: fontconfig abnormal exit
  2020-09-12 12:56                                 ` Ken Brown
@ 2021-07-20 17:00                                   ` Brian Inglis
  2021-07-21 19:26                                     ` Ken Brown
  0 siblings, 1 reply; 29+ messages in thread
From: Brian Inglis @ 2021-07-20 17:00 UTC (permalink / raw)
  To: cygwin

On 2020-09-12 06:56, Ken Brown via Cygwin wrote:
> On 9/12/2020 1:18 AM, Brian Inglis wrote:
>> On 2020-09-11 15:13, Ken Brown via Cygwin wrote:
>>> On 9/11/2020 4:30 PM, Achim Gratz wrote:
>>>> Ken Brown via Cygwin writes:
>>>>> Unfortunately, this doesn't yet fix the problem with
>>>>> fontconfig_dtd.sh.  The latter will now succeed if it is run after
>>>>> libxml2.sh, but not if it is run first.  I'm not aware of any way to
>>>>> force setup to run one postinstall script before another.
>>>>
>>>> Multiple ways:
>>>>
>>>> 1. Make the libxml postinstall script sort lexically before any
>>>> others that depend on it. Obviously this is brittle, but it
>>>> might work in this particular instance (autorebase does this).
>>>>
>>>> 2. Make the libxml catalog creation a perpetual postinstall
>>>> script with prefix "0p_". That only works if it doesn't depend
>>>> on other postinstall scripts having their work completed.
>>>>
>>>> 3. Implement and use the stratified postinstall concept originally
>>>> outlined at:
>>>> https://sourceware.org/legacy-ml/cygwin-apps/2014-12/msg00148.html
>>>>
>>>> 4. Use the package dependency order to order the postinstall script
>>>> activation.  With libzypp we should have the correct information, we'd
>>>> just need to somehow make the packagemeta iterator use it. That still
>>>> won't work if we have dependency loops.
>>>>
>>>> 5. (Try to) Run any failed postinstalls again in setup and bail only if
>>>> the number of fails does not decrease from the last iteration.
>>>>
>>>> At the time it was deemed too complicated and so we only use
>>>> the "end" strata for the perpetual postinstall scripts.  As
>>>> said then, there would need to be some serious discussion on
>>>> how to coordinate the strata assignments.

>>> There's no dependency relation between libxml2 and 
>>> libfontconfig-common, so #4 wouldn't fix the problem. And some of
>>> the other suggestions would require work on setup.exe that
>>> someone would have to do. The current problem is simple to fix
>>> and shouldn't have to wait for that.
>>>
>>> I like your idea of using perpetual postinstall scripts.  I think
>>> the way to do it is probably to make fontconfig_dtd.sh perpetual
>>> with prefix "zp_". That way if libfontconfig-common is installed
>>> without libxml2 but then libxml2 is installed later, the
>>> xmlcatalog command gets run.  We would have to check that no harm
>>> is done if that xmlcatalog command gets run more than once.

>> As libxml2 supplies /usr/bin/xmlcatalog, that postinstall script 
>> should both conditionally create the catalog and only if just
>> created, also conditionally add fonts.dtd,

> No, the libxml2 postinstall script shouldn't add fonts.dtd. That
> should be added only when/if fontconfig is installed. So it's an
> appropriate task for a fontconfig postinstall script.

>> [TL;DR: We do not want to add more permanent postinstall scripts 
>> unless essential!

> Making fontconfig_dtd.sh perpetual may or may not be essential, but it's 
> the best way I can think of to solve the problem of this bug report.  
> Can you propose a better way?

>> Permanent postinstall scripts can greatly extend the run time of
>> the Cygwin Setup program, when fontconfig, man-db, or tex just seem
>> to decide sometimes for some reason that another whole new world of
>> fonts, man pages, or whatever has appeared that they have to
>> reprocess,

> If you see a perpetual postinstall script doing something time-consuming 
> that you think is unnecessary, please make a bug report.

Unfortunately it's often too late to get any information once you notice 
setup is still running in one script.

>> pushing the Setup run time and service (cron) downtime to hours

> I've never seen this.  Please give details.

I have never been able to figure out what texlive postinstall command 
keeps going.

I have multiple distros man pages available under Cygwin for 
convenience, so I manually run man-db postinstall after updates (nohup 
... &), to try to avoid long setup postinstalls, but sometimes setup 
man-db postinstall does lengthy updates anyway.

For fontconfig fc-cache-1 appears to have been creating thousands (on 
Cygwin 64 millions) of small <1KB 
/var/cache/fontconfig/%8x-%4x-%4x-%4x-%12x-le{64,32d8}.cache-7 files.

The problems could have originally been caused by an old bug:

https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/107

combined with many font additions around that time, mainly working on 
Cygwin 64, where I use X, and manually run fontconfig postinstall 
script, to try to avoid long setup postinstalls, whereas on Cygwin 32 I 
don't use X or manually run postinstall scripts, just get run after setup.

I have about 200 Windows MS font files, 1000 non-MS font files, and 
about 800 Cygwin font files, from multiple distros and elsewhere, 
including some with full BMP coverage, some with SMP coverage, some for 
fallback code points, others with group ranges.

I rm'ed -rf /var/cache/fontconfig/ with a few thousand files on Cygwin 
32 and rebuilt it okay with only 65 cache files.

I tried rm -rf /var/cache/fontconfig/ on Cygwin 64 but got many 
permission errors and killed it.

I gave up waiting for ls -U to show any results on Cygwin 64 or Explorer 
on that dir to show any file details, but cmd /c dir | less displays the 
base info for hundreds of thousands of files, and wc reports millions.

I am still waiting for an elevated cmd to rmdir /s /q fontconfig there!

Do you know why fc-cache-1 is run rather than fc-cache and what the 
difference is?

What would give you useful information once I have the fontconfig cache 
cleared?
Might running FC_DEBUG=65535 fc-cache-1 -fsv provide useful info?
Or do so with strace?
Would running file on the font files give enough info about properties 
to be of any help?

What is the best approach to get the minimal cache files recreated?

What is the best approach to avoid thousand of cache files in future?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

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

* Re: postinstall: fontconfig abnormal exit
  2021-07-20 17:00                                   ` Brian Inglis
@ 2021-07-21 19:26                                     ` Ken Brown
  2021-07-23  3:37                                       ` Brian Inglis
  0 siblings, 1 reply; 29+ messages in thread
From: Ken Brown @ 2021-07-21 19:26 UTC (permalink / raw)
  To: cygwin

On 7/20/2021 1:00 PM, Brian Inglis wrote:
 > On 2020-09-12 06:56, Ken Brown via Cygwin wrote:
> For fontconfig fc-cache-1 appears to have been creating thousands (on Cygwin 64 
> millions) of small <1KB 
> /var/cache/fontconfig/%8x-%4x-%4x-%4x-%12x-le{64,32d8}.cache-7 files.
> 
> The problems could have originally been caused by an old bug:
> 
> https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/107
> 
> combined with many font additions around that time, mainly working on Cygwin 64, 
> where I use X, and manually run fontconfig postinstall script, to try to avoid 
> long setup postinstalls, whereas on Cygwin 32 I don't use X or manually run 
> postinstall scripts, just get run after setup.
> 
> I have about 200 Windows MS font files, 1000 non-MS font files, and about 800 
> Cygwin font files, from multiple distros and elsewhere, including some with full 
> BMP coverage, some with SMP coverage, some for fallback code points, others with 
> group ranges.
> 
> I rm'ed -rf /var/cache/fontconfig/ with a few thousand files on Cygwin 32 and 
> rebuilt it okay with only 65 cache files.
> 
> I tried rm -rf /var/cache/fontconfig/ on Cygwin 64 but got many permission 
> errors and killed it.

The preremove script for libfontconfig1 should remove all those cache files 
every time libfontconfig1 is updated, so you should have gotten a fresh start 
every once in a while.  Apparently something went wrong.

> I gave up waiting for ls -U to show any results on Cygwin 64 or Explorer on that 
> dir to show any file details, but cmd /c dir | less displays the base info for 
> hundreds of thousands of files, and wc reports millions.
> 
> I am still waiting for an elevated cmd to rmdir /s /q fontconfig there!
> 
> Do you know why fc-cache-1 is run rather than fc-cache and what the difference is?

They're identical.  It's just a packaging issue.  fc-cache is in the fontconfig 
package, and fc-cache-1 is in the libfontconfig1 package.  That way fc-cache-1 
is available for use in postinstall scripts for users who install libfontconfig1 
(probably because something requires it) but not fontconfig.

> What would give you useful information once I have the fontconfig cache cleared?
> Might running FC_DEBUG=65535 fc-cache-1 -fsv provide useful info?
> Or do so with strace?
> Would running file on the font files give enough info about properties to be of 
> any help?

I'm not an expert on fontconfig, so I probably can't help.

> What is the best approach to get the minimal cache files recreated?

I would expect that this would always happen as a result of running setup and 
letting the preremove/postinstall scripts do their job.  I don't know what went 
wrong in your case.

> What is the best approach to avoid thousand of cache files in future?

Again, I don't know why that happened in the first place.

Ken

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

* Re: postinstall: fontconfig abnormal exit
  2021-07-21 19:26                                     ` Ken Brown
@ 2021-07-23  3:37                                       ` Brian Inglis
  0 siblings, 0 replies; 29+ messages in thread
From: Brian Inglis @ 2021-07-23  3:37 UTC (permalink / raw)
  To: cygwin

On 2021-07-21 13:26, Ken Brown via Cygwin wrote:
> On 7/20/2021 1:00 PM, Brian Inglis wrote:
>  > On 2020-09-12 06:56, Ken Brown via Cygwin wrote:
>> For fontconfig fc-cache-1 appears to have been creating thousands (on 
>> Cygwin 64 millions) of small <1KB 
>> /var/cache/fontconfig/%8x-%4x-%4x-%4x-%12x-le{64,32d8}.cache-7 files.
>>
>> The problems could have originally been caused by an old bug:
>>
>> https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/107
>>
>> combined with many font additions around that time, mainly working on 
>> Cygwin 64, where I use X, and manually run fontconfig postinstall 
>> script, to try to avoid long setup postinstalls, whereas on Cygwin 32 
>> I don't use X or manually run postinstall scripts, just get run after 
>> setup.
>>
>> I have about 200 Windows MS font files, 1000 non-MS font files, and 
>> about 800 Cygwin font files, from multiple distros and elsewhere, 
>> including some with full BMP coverage, some with SMP coverage, some 
>> for fallback code points, others with group ranges.
>>
>> I rm'ed -rf /var/cache/fontconfig/ with a few thousand files on Cygwin 
>> 32 and rebuilt it okay with only 65 cache files.
>>
>> I tried rm -rf /var/cache/fontconfig/ on Cygwin 64 but got many 
>> permission errors and killed it.
> 
> The preremove script for libfontconfig1 should remove all those cache 
> files every time libfontconfig1 is updated, so you should have gotten a 
> fresh start every once in a while.  Apparently something went wrong.
> 
>> I gave up waiting for ls -U to show any results on Cygwin 64 or 
>> Explorer on that dir to show any file details, but cmd /c dir | less 
>> displays the base info for hundreds of thousands of files, and wc 
>> reports millions.
>>
>> I am still waiting for an elevated cmd to rmdir /s /q fontconfig there!
>>
>> Do you know why fc-cache-1 is run rather than fc-cache and what the 
>> difference is?
> 
> They're identical.  It's just a packaging issue.  fc-cache is in the 
> fontconfig package, and fc-cache-1 is in the libfontconfig1 package.  
> That way fc-cache-1 is available for use in postinstall scripts for 
> users who install libfontconfig1 (probably because something requires 
> it) but not fontconfig.
> 
>> What would give you useful information once I have the fontconfig 
>> cache cleared?
>> Might running FC_DEBUG=65535 fc-cache-1 -fsv provide useful info?
>> Or do so with strace?
>> Would running file on the font files give enough info about properties 
>> to be of any help?
> 
> I'm not an expert on fontconfig, so I probably can't help.
> 
>> What is the best approach to get the minimal cache files recreated?
> 
> I would expect that this would always happen as a result of running 
> setup and letting the preremove/postinstall scripts do their job.  I 
> don't know what went wrong in your case.
> 
>> What is the best approach to avoid thousand of cache files in future?
> 
> Again, I don't know why that happened in the first place.

Thanks, I'll just assume between fontconfig and Windows profile issues 
in 2018 something went nuts, and once the directory has been cleared, 
I'll add a monitoring cron job on the cache.

Elevated cmd to clear directory still running days later!

Commands:

	$ cmd /c dir fontconfig | wc

now showing only 207348 files left to delete after a few minutes, and

	 $ /bin/ls -1U fontconfig | wc

likewise! ;^>

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

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

end of thread, other threads:[~2021-07-23  3:37 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08  6:43 postinstall: fontconfig abnormal exit Fergus Daly
2020-09-08 12:03 ` Hamish McIntyre-Bhatty
2020-09-08 14:16 ` Andrey Repin
2020-09-08 15:18   ` Fergus Daly
2020-09-08 16:14     ` Brian Inglis
2020-09-10  5:23     ` Fergus Daly
2020-09-10  5:35       ` Andrey Repin
2020-09-10 10:57         ` Fergus Daly
2020-09-10 14:40           ` Brian Inglis
2020-09-11  6:04             ` briand
2020-09-11  7:22               ` Fergus Daly
2020-09-11  8:32                 ` Hamish McIntyre-Bhatty
2020-09-11 11:31                   ` Marco Atzeri
2020-09-11 13:12                     ` Ken Brown
2020-09-11 14:41                       ` Marco Atzeri
2020-09-11 19:47                         ` Ken Brown
2020-09-11 20:30                           ` Achim Gratz
2020-09-11 21:13                             ` Ken Brown
2020-09-12  5:18                               ` Brian Inglis
2020-09-12 12:56                                 ` Ken Brown
2021-07-20 17:00                                   ` Brian Inglis
2021-07-21 19:26                                     ` Ken Brown
2021-07-23  3:37                                       ` Brian Inglis
2020-09-12  6:08                               ` ASSI
2020-09-13 16:53                                 ` Ken Brown
2020-09-16  8:42                                   ` Fergus Daly
2020-09-12 18:16                           ` Andrey Repin
2020-09-14 15:47                             ` Hamish McIntyre-Bhatty
2020-09-11 13:18                     ` Fergus Daly

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).