in reply to Re^3: Installing (lotsa) modules
in thread Installing (lotsa) modules

Would modules that are not pure Perl still need a working compiler on the target machine?

Sure. All that a bundle does is to depend on a lot of other packages (those listed in the bundle), and so just installs the dependencies as usual.

Or could they be complied on the donor machine and bundled onto the target machine fully formed?

Yes and no. Usually no, except when you build an entire distribution or when "donor" and target machine run exactly identical software. "Binary" modules (those using XS) usually not only depend on the exact perl version and its configuration, but usually also on the exact library versions they were linked against, and on their configurations. So if you can make perl and all libraries on the target the same as on the "donor" machine, copying will very likely work.

If you look at any binary Linux distribution (e.g. Debian, Redhat, Ubuntu, Slackware), you can see why they can distribute compiled perl modules: The distribution development team controls compiler, libraries, perl, and perl modules, both versions and configurations. The packaging system has its own way of dependency tracking, and takes care of either updating a perl package after a library was updated, or keeping an old version of the library around for a perl package.


Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^5: Installing (lotsa) modules
by syphilis (Bishop) on Jan 25, 2021 at 07:38 UTC
    "Binary" modules (those using XS) usually not only depend on the exact perl version and its configuration

    Interestingly, I think "exact perl version" slightly overstates the condition.
    AFAIK, a package built for perl-5.x.y will be fine with perl-5.a.b, so long as x == a. (But no need for y == b. However, I can't recall if there was also a need for y <= b. Anyone ? )
    This meant, for example, that having built a Windows PPM package of a perl module for (say) perl-5.30.0, that same binary package would be fine for all 5.30.* versions of perl on Windows - so long as all of these perl-5.30.* versions had been configured the same.

    At least, that's the way it used to be - but I haven't tested to see whether the XS handshake tests that were added a couple of years ago might now interfere with that capability.
    If they do interfere, then they do so for no valid reason that I know of.


      Yes, in general, 5.x.z will be compatible with 5.x.y. Changes that break this compatibility ("binary compatibility") should not get backported.

      Of course, this only holds true for identical configuration options, either in the Win32/Makefile or via Configure. If you configure a Perl differently (with/without threads, different float sizes, ...), you won't get compatibility between Perl versions, or within the same Perl version even.

      Now that I think/write about this, I don't think there is a real test between Perl versions at release time to ensure that compatibility test. I think the smoke testers will find out such a breaking change quickly, but a (manual) test step should be good there ...

        Of course, this only holds true for identical configuration options

        I thought this was too good to be true...
        So I won't be able to bundle compiled modules on a Windows 10 machine and make then available on an unidentified Linux virtual machine (shared web host) which doesn't have (access to) a complier.