On 2024-09-02 10:48, Soren via Cygwin wrote:
The Perl interpreter uses directories contained in the internal array @INC to
find libraries. Cygwin's Perl 5.40.0-1 installation leaves several
directories uncreated but listed in @INC.
Like so (from $perl -V):

@INC:
         /usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads
         /usr/local/share/perl5/site_perl/5.40
         /usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads
         /usr/share/perl5/vendor_perl/5.40
         /usr/lib/perl5/5.40/x86_64-cygwin-threads
         /usr/share/perl5/5.40

------------------------------

Let's look at the error messages we get.

Can't stat /usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads:
No such file
or directory at C:\Users\Sally\Documents\Scripts\seekinc.pl line 30.
Can't stat /usr/local/share/perl5/site_perl/5.40: No such file or directory at
C:\Users\Sally\Documents\Scripts\seekinc.pl line 30.
Can't stat /usr/share/perl5/vendor_perl/5.40: No such file or directory at
C:\Users\Sally\Documents\Scripts\seekinc.pl line 30.

It's micro-optimization, sure, but having Perl stat non-existent
directories every time it runs; this is just not nice. And this is not the
only issue.

Observe the following, please:
------------------------------
@INCCount
/usr/local/share/perl5/site_perl/5.40 0
/usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads 0
/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads 2
/usr/lib/perl5/5.40/x86_64-cygwin-threads 112
/usr/share/perl5/5.40 1287
/usr/share/perl5/vendor_perl/5.40 0
------------------------------

The left-hand column lists Perl's @INC and the right-hand numbers are
counts of the libraries or modules found under those parent directories.
No, I did not count them manually.

I wrote a simple script in Perl to generate these.

The 3 base directories with 0 files under them don't exist. For one example
of consequences: If one were to use cpanplus, it would want to place files
under /usr/local/share/perl5/site_perl/5.40 and suchlike. I love using
cpanplus. Watching it run the builds, tests and installations automatically
is very relaxing ;-).

These examples are all from a Perl installation I did this evening, with no
Perl ever installed before; completely "clean".

Please check your own installation of cygwin-perl. By the way, the script
used to investigate @INC (I call such programs "introspective" scripts) is
on GitHub at: https://github.com/somian/seekinc/blob/main/seekinc.pl

Perhaps the perl package build could benefit from adding:

KEEPDIRS="$PERL_ARCHLIB $PERL_LIB $PERL_SITELIB $PERL_VENDORARCH 
$PERL_VENDORLIB"

where:

PERL_ARCHLIB=/usr/lib/perl5/5.40/x86_64-cygwin-threads
PERL_LIB=/usr/share/perl5/5.40
PERL_SITELIB=/usr/local/share/perl5/site_perl/5.40
PERL_VENDORARCH=/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads
PERL_VENDORLIB=/usr/share/perl5/vendor_perl/5.40

for the benefit of those who do not install many perl packages?

One further anomaly: In output of cygcheck:

perl                      5.40.0-1                     Incomplete

How do we fix this at Cygwin package build time?

Add options -h -v to cygcheck for details on any operation:

$ cygcheck -chv xxd
Cygwin Package Information
Last downloaded files to: D:/var/cache/setup/packages
Last downloaded files from: https://mirror.cpsc.ucalgary.ca/mirror/cygwin.com/

Package              Version    Status
Missing file: /usr/share/man/fr.ISO8859-1/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/fr.UTF-8/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/fr/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/it.ISO8859-1/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/it.UTF-8/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/it/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/ja/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/pl.ISO8859-2/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/pl.UTF-8/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/pl/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/ru.KOI8-R/man1/xxd.1.gz from package xxd
Missing file: /usr/share/man/ru.UTF-8/man1/xxd.1.gz from package xxd
xxd                  9.0.2155-2     Incomplete

Looks like I blew away a bunch of non-English man locale directories at some point! ;^>


What thoroughly confused me recently was perl-Locale-gettext and perl-gettext both being installed, obsoleting each other, same package versions but newer package with lower release, depending on different perl versions:

$ grep 'perl-\(Locale-\)\?gettext' /etc/setup/installed.db
perl-Locale-gettext perl-Locale-gettext-1.07-1.tar.bz2 1
perl-gettext perl-gettext-1.07-5.tar.bz2 0
perl5_040 perl-Locale-gettext-1.07-1.tar.bz2 0
$ cygcheck -chv perl-{Locale-,}gettext
Cygwin Package Information
Last downloaded files to: D:/var/cache/setup/packages
Last downloaded files from: https://mirror.cpsc.ucalgary.ca/mirror/cygwin.com/

Package              Version    Status
perl-gettext         1.07-5         OK
perl-Locale-gettext  1.07-1         OK
$ cygcheck -l perl-{Locale-,}gettext
/usr/lib/perl5/vendor_perl/5.36/x86_64-cygwin-threads/auto/Locale/gettext/gettext.dll
/usr/lib/perl5/vendor_perl/5.36/x86_64-cygwin-threads/Locale/gettext.pm
/usr/share/doc/perl-gettext/README
/usr/share/man/man3/Locale.gettext.3pm.gz
/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads/auto/Locale/gettext/gettext.dll
/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads/Locale/gettext.pm
/usr/share/doc/perl-Locale-gettext/README
/usr/share/man/man3/Locale.gettext.3pm.gz
$ ls -glo \
/usr/lib/perl5/vendor_perl/5.36/x86_64-cygwin-threads/auto/Locale/gettext/gettext.dll \
/usr/lib/perl5/vendor_perl/5.36/x86_64-cygwin-threads/Locale/gettext.pm \
/usr/share/doc/perl-gettext/README /usr/share/man/man3/Locale.gettext.3pm.gz \
/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads/auto/Locale/gettext/gettext.dll \
/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads/Locale/gettext.pm \
/usr/share/doc/perl-Locale-gettext/README \
/usr/share/man/man3/Locale.gettext.3pm.gz
-rwxr-xr-x 1 15379 May 1 2023 /usr/lib/perl5/vendor_perl/5.36/x86_64-cygwin-threads/auto/Locale/gettext/gettext.dll -rw-r--r-- 1 6854 Sep 28 2015 /usr/lib/perl5/vendor_perl/5.36/x86_64-cygwin-threads/Locale/gettext.pm -rwxr-xr-x 1 14867 Aug 18 09:44 /usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads/auto/Locale/gettext/gettext.dll -r--r--r-- 1 6854 Sep 28 2015 /usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads/Locale/gettext.pm
-rw-r--r-- 1  6635 May  1  2023 /usr/share/doc/perl-gettext/README
-rw-r--r-- 1  6635 Aug 18 09:44 /usr/share/doc/perl-Locale-gettext/README
-r--r--r-- 1  2416 Aug 18 09:44 /usr/share/man/man3/Locale.gettext.3pm.gz
-r--r--r-- 1  2416 Aug 18 09:44 /usr/share/man/man3/Locale.gettext.3pm.gz
$ awk '$1 ~ /perl-(Locale-)?gettext/' RS='\n\n@ ' FS='\n' 
~/mirror/x86_64/setup.ini
perl-Locale-gettext
sdesc: "Perl distribution Locale-gettext"
ldesc: "Perl distribution Locale-gettext, providing Perl modules:
Locale::gettext.

Perl bindings for POSIX i18n gettext functions."
category: Perl
version: 1.07-1
install: x86_64/release/perl-Locale-gettext/perl-Locale-gettext-1.07-1.tar.zst 11985 ad1165f38beb6d4b7203cef931c86eaf5729830666a17225de2452ddef37eac3f0303c42e6c40a054f404fe01ec1a4080346531dc37a8b39a935d5358a8b3bbc source: x86_64/release/perl-Locale-gettext/perl-Locale-gettext-1.07-1-src.tar.zst 9319 42d81bb4008069bfec60b03dbda8a09aa601724a59d060ad2ac853bb994bf682e37de43901ced6021c9801e65ffc47f469ec1aada89851e84f58592737f73662
depends2: cygwin, libgcc1, libintl8, perl5_040, perl_base
*obsoletes: perl-gettext*
build-depends: cygport, libcrypt-devel
...
perl-gettext
sdesc: "Perl distribution gettext"
ldesc: "Perl distribution gettext, providing Perl modules:
Locale::gettext.

Perl bindings for POSIX i18n gettext functions."
category: Perl
version: 1.07-5
install: x86_64/release/perl-gettext/perl-gettext-1.07-5.tar.zst 12330 5bc206eda8007b7d091cb1da5f4ce93c98eae298c5b3d9e03ccb7412c239b709d4c47764a96b58950abbb0b48a9b04c0448e688b6ededd4cf9d7932bb394c74b source: x86_64/release/perl-gettext/perl-gettext-1.07-5-src.tar.zst 9328 0cb87614767a1d212e96c40cea760d4c253be88c72700fb50a54ce12f5d454aaf53b0bc0ffc9183160c38b4ad574f2c8556a2a6f5185b1b419f1410813d48ece
depends2: cygwin, libgcc1, libintl8, perl5_036, perl_base
*obsoletes: perl-Locale-gettext*
build-depends: cygport, libcrypt-devel, libintl-devel
...

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

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                -- Antoine de Saint-Exupéry

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

Reply via email to