Intrepid has asked for the wisdom of the Perl Monks concerning the following question:

Hello perMonks and perlNuns.

As my Subject indicates, I am thinking ahead to when the cygwin project upgrades Perl to 5.42. What I am asking isn't about the Perl language but rather about systems administration. I got badly burned by doing something ignorant awhile back, as discussed weeks ago in Nooo!... Have I trashed my Strawberry?.

When I update using cygwin setup.exe, I think I remember that the core language modules will not update, but rather are updated as a separate package from cygwin.com (is this right?). And what about the vendor modules? But mostly, what about the modules in site_perl locations, modules I've built and installed myself? I think one answer will be to autobundle using cpan, but there are other possible solutions. Any advice would be welcomed.

CygwinPerl on my system:

$ /usr/bin/perl -le 'print $^V'
v5.40.3

My @INC looks like this:
$ perl -le 'print for @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

So when one autobundles, are modules selected from all dirs in @INC or only from the site_perl dirs, which are in my case (and presumably in all CygwinPerl users cases):

/usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads
/usr/local/share/perl5/site_perl/5.40

Or does autobundle select everything, including core modules and vendor modules? If it does, I want a better solution.

Answers I got to that posting about trashing StrawberryPerl included this notable one: Re: Nooo!... Have I trashed my Strawberry?. I am going to look into the recommended UrBackup while I am awaiting advice here.

Oct 06, 2025 at 17:34 UTC

A just machine to make big decisions
Programmed by fellows (and gals) with compassion and vision
We'll be clean when their work is done
We'll be eternally free yes, and eternally young
Donald Fagen —> I.G.Y.
(Slightly modified for inclusiveness)

  • Comment on CygPerl question: what to expect from update when Cygwin releases 5.42

Replies are listed 'Best First'.
Re: CygPerl question: what to expect from update when Cygwin releases 5.42
by ikegami (Patriarch) on Oct 07, 2025 at 03:12 UTC

    I think I remember that the core language modules will not update, but rather are updated as a separate package from cygwin.com (is this right?).

    Like with many OS distros, Cygwin splits core Perl into two packages: perl and perl_base. I don't know what each provides. If you have both installed and you upgrade one, you should upgrade the other one too. Hopefully, that's automatic. Having core modules that don't match your perl would be a problem.

    And what about the vendor modules?

    Other Perl packages installed with Cygwin's package manager should have dependencies that forces their update when Perl is updated to something incompatible (a different major version). If not, just select to update all the Perl-related packages when you upgrade the core Perl ones. The package manager will make clear what's being updated.

    And what about the vendor modules? But mostly, what about the modules in site_perl locations, modules I've built and installed myself?

    Cygwin's package manager doesn't know anything about those, so it can't reinstall them for the new Perl. Fortunately, Cygwin appears to use versioned paths. So the modules that need reinstalling will simply vanish from perl's sight rather than malfunction.

    For more control, use perlbrew.

      Sorry to take so long to acknowledge your reply, ikegami. What I have done so far has merely been to execute in the bash shell this command pipeline:

      find /usr/local/share/perl5/site_perl/5.40 | cpio -p -d -B --dot --force-local --reset-access-time --make-directori +es \ --preserve-modification-time H:/

      Where H:/ is an external USB pendrive. It's an unsophisticated and limited way to try to ensure I can get back to having the site_perl - installed modules re-installable, safely preserved no matter what bone-headed choices I make with my main CygPerl installation (the system Perl provided by Cygwin, in my case). But I confess I am not clear on the how and why of Perl versioning – in this case, perl 5.42 will install modules to /usr/local/share/perl5/site_perl/5.42, right?.

      Cygwin appears to use versioned paths. So the modules that need reinstalling will simply vanish from perl's sight rather than malfunction.

      Yes, ok. I just don't grasp why all of the modules under the versioned dir need to be reinstalled – if they aren't xs (compiled extensions) why wouldn't they behave properly with a newer perl? I've never understood this.

          — Soren

      Oct 20, 2025 at 17:57 UTC

        perl 5.42 will install modules to /usr/local/share/perl5/site_perl/5.42, right?.

        The package manager shouldn't touch site_perl at all. Non-core modules it installs should be installed in the vendor dirs.

        If we're talking about modules you install yourself, then the paths can be configured when perl is built. perl -V:'^install.*' will show the installation dirs used by a perl. That said, /usr/local/share/perl5/site_perl/5.42 seems likely if /usr/local/share/perl5/site_perl/5.40 was previously used.

        I just don't grasp why all of the modules under the versioned dir need to be reinstalled

        Because someone decided to install them in a versioned dir.

        That said, that's a good practice because they might have XS dependencies.

        The package manager shouldn't touch site_perl at all.