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

I'm having trouble installing the Readonly module to StrawberryPerl apparently because it uses Module::Install::Tiny Module::Build::Tiny as its build / test / install infrastructure. I haven't been aware that I was running that build module before now, but obviously if nothing goes wrong the build system should be in the background just Doing The Right Thing™. So I won't have noticed.

I'm running a StrawberryPerl managed as an instance of Perl 5.40.2 by berrybrew. I feel like I have to show my fellow monks that I don't have a crazy setup, after some of my recent misadventures. Here's my %PATH% (speaking the CMD.exe dialect since we're talking about Windows):

/cygdrive/c/berrybrew/instance/5.40.2_64/c/bin
/cygdrive/c/berrybrew/instance/5.40.2_64/perl/bin
/cygdrive/c/berrybrew/instance/5.40.2_64/perl/site/bin
/cygdrive/c/Users/somia/Unpack-software/gitclones/berrybrew/bin
/cygdrive/c/Windows/System32
/cygdrive/c/windows
/cygdrive/c/Windows/7-zip
/cygdrive/c/windows/System32/Wbem
/cygdrive/c/py
/cygdrive/c/WINDOWS/system32
/cygdrive/c/WINDOWS
/cygdrive/c/WINDOWS/System32/Wbem
/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0
/cygdrive/c/Program Files/Docker/Docker/resources/bin
/cygdrive/c/Program Files/PowerShell/7
/cygdrive/c/perl/c/bin
/cygdrive/c/perl/perl/site/bin
/cygdrive/c/perl/perl/bin
/cygdrive/c/Users/somia/AppData/Local/Microsoft/WindowsApps
/cygdrive/c/Perl/bin

I know, it looks like I am running cygwin, but believe me, I have the right Perl and tools. The above is prettified output of a (perl) script I wrote to manage my PATH.

perl -le "print $^V" v5.40.2

What happens when I try to test and install the module is:

C:\Users\somia\build\strawberry-perl\Readonly-2.05-0>.\Build --verbose + test Skip blib\lib\Readonly.pm (unchanged)

Same thing when I type install instead of test.

I'm an EU::MM guy, I love make, and this just baffles me. I'm not trying to find someone to blame (no profit in that), but I would like to spend less time debugging the build of a simple module.

EDIT

Struck out imaginary module Module::Install::Tiny, in first paragraph above.

Jun 16, 2025 at 18:47 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)

Replies are listed 'Best First'.
Re: On Windows, With StrawberryPerl, Module::Build::Tiny fails to install a module
by pryrt (Abbot) on Jun 16, 2025 at 20:00 UTC
    your link to Readonly was bad

    Module::Install::Tiny doesn't exist; I think you mean Module::Build::Tiny, as that's what Readonly's Build.pl needs.

    Strawberry perl comes with Module::Build::Tiny:

    C:\Users\pryrt\AppData\Local\Temp>perl -MModule::Build::Tiny -e "print + $INC{'Module/Build/Tiny.pm'}" c:/usr/local/apps/strawberry/perl/vendor/lib/Module/Build/Tiny.pm

    cpanm handles Build.PL based installations just as well as EUMM installations. Just use cpanm.

    Using the cpanm that comes with Strawberry(*):

    C:\Users\pryrt\AppData\Local\Temp>cpanm --local-lib=tmplib --test-only + Readonly --> Working on Readonly Fetching http://www.cpan.org/authors/id/S/SA/SANKO/Readonly-2.05.tar.g +z ... OK Configuring Readonly-2.05 ... OK Building and testing Readonly-2.05 ... OK Successfully tested Readonly-2.05 C:\Users\pryrt\AppData\Local\Temp>cpanm --local-lib=tmplib Readonly --> Working on Readonly Fetching http://www.cpan.org/authors/id/S/SA/SANKO/Readonly-2.05.tar.g +z ... OK Configuring Readonly-2.05 ... OK Building and testing Readonly-2.05 ... OK Successfully installed Readonly-2.05 1 distribution installed C:\Users\pryrt\AppData\Local\Temp>perl -Mlocal::lib=tmplib -MReadonly +-e "print $INC{'Readonly.pm'}" Attempting to create directory C:\Users\pryrt\AppData\Local\Temp\tmpli +b C:\Users\pryrt\AppData\Local\Temp\tmplib\lib\perl5/Readonly.pm

    Once again, with my setup of Strawberry, I have no problem installing the Readonly module: it tests without failure, it installs without complaint, and when I use it, I can print the path that it shows up in %INC. Everything works as I expect. (I used --local-lib because I don't want to clutter my installation with all the modules that I install to show you that your problem is not Strawberry perl's fault.)

    *: Make sure you use where cpanm (the cmd.exe command to show all instances of a given executable in your path, in the order it will be searched) to make sure it's getting the one from your strawberry, not your cygwin. Despite your assurances, your PATH showing all the cygwin prefixes makes me still wonder whether things are as sane as you think they are. And I've never tried running Strawberry perl from a cygwin command line: maybe it will work, but it seems to be an extra layer of confusion that you shouldn't invoke unless you need it.

    But, again, it works for me. So I have no clue why it's not for you, and the information you provided is not enough to hazard a guess as to what's going wrong. (Other than your history of having a problematic setup, which you claim cannot be the cause this time.)


    edit 1: added perl -MReadonly example, to show it's actually installed and perl can find it

      Hi pryrt, this may be a premature reply but I didn't want to get caught up something else, and neglect to acknowledge a really exemplary bit of helpfulness.

      pryrt wrote:

      Module::Install::Tiny doesn't exist; I think you mean Module::Build::Tiny, as that's what Readonly's Build.pl needs.

      Erm, yes, exactly. My bad. Module::Build::Tiny. I'm working on installing Readonly in exactly the way you showed above, and bizarrely it (cpanm) is just hanging. Well over 3 minutes now. I'm working under CMD.exe, not cygwin bash. I'll probably add to this reply with a later edit once I figure out (if I figure out) what's going wrong.

      Jun 17, 2025 at 01:01 UTC

      I got Readonly installed. I would try to describe the contortions I went through, with CMD.exe changing directory by itself (I know, I know, impossible) and every effort to run .\Build in it thwarted by the process hanging or other things, but I don't think most readers would believe me. I finally had to wipe out the build directory for Readonly and start from scratch with cpanm as you showed. I did that in a cygwin bash shell since I was just fed up with CMD.exe behaving as if it had lost its mind.

      I got strongly motivated to work out how to be in a cygwin shell but be using win32 reliably and have this figured out now and I really appreciate the help I been given in this thread.

      Jun 17, 2025 at 23:50 UTC
Re: On Windows, With StrawberryPerl, Module::Build::Tiny fails to install a module
by syphilis (Archbishop) on Jun 17, 2025 at 01:31 UTC
    C:\Users\somia\build\strawberry-perl\Readonly-2.05-0>.\Build --verbose + test Skip blib\lib\Readonly.pm (unchanged)
    I can reproduce that.
    For me, removing the --verbose switch allows both the test and install steps to work as expected:
    D:\s\Readonly-2.05>.\Build cp lib/Readonly.pm blib\lib\Readonly.pm D:\s\Readonly-2.05>.\Build --verbose test Skip blib\lib\Readonly.pm (unchanged) D:\s\Readonly-2.05>.\Build test t/bugs/001_assign.t .......... ok t/bugs/007_implicit_undef.t .. ok t/general/array.t ............ ok t/general/clone.t ............ ok t/general/deepa.t ............ ok t/general/deeph.t ............ ok t/general/deeps.t ............ ok t/general/docs.t ............. ok t/general/export.t ........... ok t/general/hash.t ............. ok t/general/readonly.t ......... ok t/general/reassign.t ......... ok t/general/scalar.t ........... ok t/general/tie.t .............. ok All tests successful. Files=14, Tests=188, 2 wallclock secs ( 0.03 usr + 0.00 sys = 0.03 +CPU) Result: PASS D:\s\Readonly-2.05>.\Build --verbose install Skip blib\lib\Readonly.pm (unchanged) D:\s\Readonly-2.05>.\Build install Installing C:\sp\_64\sp-5.40.0.1-PDL\perl\site\lib\Readonly.pm D:\s\Readonly-2.05>.\Build install D:\s\Readonly-2.05>
    Note that .\Build install will exit silently if Readonly.pm is already installed.

    I am always mistrustful of (and refuse to debug) any module whose name begins with "Module::".

    Cheers,
    Rob

      That's because

      Build --verbose anything
      is treated as
      Build --verbose

      Demo:

      Readonly-2.05>perl Build.PL Creating new 'Build' script for 'Readonly' version '2.05' Readonly-2.05>Build --verbose install cp lib/Readonly.pm blib\lib\Readonly.pm mkdir blib\arch Readonly-2.05>Build --verbose install Skip blib\lib\Readonly.pm (unchanged) Readonly-2.05>Build clean Readonly-2.05>perl Build.PL Creating new 'Build' script for 'Readonly' version '2.05' Readonly-2.05>Build --verbose cp lib/Readonly.pm blib\lib\Readonly.pm mkdir blib\arch Readonly-2.05>Build --verbose Skip blib\lib\Readonly.pm (unchanged) Readonly-2.05>Build clean Readonly-2.05>perl Build.PL Creating new 'Build' script for 'Readonly' version '2.05' Readonly-2.05>Build cp lib/Readonly.pm blib\lib\Readonly.pm Readonly-2.05>Build Skip blib\lib\Readonly.pm (unchanged)

      One should use Build install --verbose

      Readonly-2.05>Build install --verbose Skipping C:\progs\SP5038~1\perl\site\lib\Readonly.pm (unchanged) Writing C:\progs\SP5038~1\perl\site\lib\auto\Readonly\.packlist

      It's skipping the install because it's already installed from an earlier attempt, but you can see it's installing this time.

Re: On Windows, With StrawberryPerl, Module::Build::Tiny fails to install a module
by Leon Timmermans (Acolyte) on Jun 17, 2025 at 13:52 UTC
    In the Build.PL protocol, verbose takes an optional argument (typically set to the value 1), so
    ./Build --verbose test
    equals
    ./Build --verbose=test
    That's why you should generally do
    ./Build test --verbose
    I agree it's not ideal, but that's a decision that was made 20+ years ago.

      While your solution is correct, your explanation isn't.

      If it was the problem that test is absorbed as a value for --verbose, then Build --verbose=1 test would work.

      The actual problem appears to be the order of the arguments, which I already mentioned.

        You are right, there is also an ordering issue. I could fix that, though the Build.PL spec only requires the current order. I'm not sure yet if I should change this. Also, in general people should pass their options in the configuration stage anyway.
      That's what I initially assumed the issue was, but instead it seems that Module::Build::Tiny is sensitive to the order of arguments, as ikegami noted. Seems like a bug that even supplying an explicit "--verbose=1" doesn't have the intended to effect. Module::Build proper, on the other hand, seems much more lenient:
      ./Build --verbose test
      ./Build --verbose=1 test
      
      Both of those work.
        Module::Build proper, on the other hand, seems much more lenient:
        Module::Build proper uses a bespoke argument parser that includes heuristics to guess if it should take the argument (e.g. ./Build --verbose 1 test). Module::Build::Tiny just uses Getopt::Long like a normal Perl program. There are actually more behaviors that Module::Build's argument parser allows that Module::Build::Tiny doesn't do. MBT always went for a subset of behaviors because the full set was too large and unpredictable.