in reply to Issues with first module build

G'day Leitz,

Firstly, please put code, data, and any error messages within <code>...</code> tags. That way, we can see what you're seeing and get a verbatim copy via the [download] link.

The first line of MANIFEST.SKIP contains a link: it looks to us like \bbookbot-\d\.\_+; it probably really (i.e. to you) looks like \bbookbot-[\d\.\_]+.

\bbookbot-[\d\.\_]+ actually matches all of your files. \bbookbot-.*\* does not match any of your files. A simpler regex to match all of your files is /bookbot-.+?/.

Because (my guess about) the first regex should match, it's possible you have some rogue (maybe whitespace) character in MANIFEST.SKIP. Please run the following command and post the result:

cat -vet MANIFEST.SKIP

That will highlight any rogue characters. It may present an immediate solution to you.

The following (in the spoiler) is my analysis. You may want to modify that to test other regexes or different input files. Note that I trimmed the leading /home/leam/lang/git from all pathnames.

— Ken

Replies are listed 'Best First'.
Re^2: Issues with first module build
by Leitz (Scribe) on Jan 05, 2021 at 08:47 UTC

    Ken, thanks! I've put the code into code tags. As an experiment, I created a totally new module and it seems to have the same issue issue with the MANIFEST.SKIP.

    module-starter --version #module-starter v1.77 module-starter -mb --module test_module_starter

    MANIFEST.SKIP.bak

    cat MANIFEST.SKIP.bak
    #!include_default # Avoid configuration metadata file ^MYMETA\. # Avoid Module::Build generated and utility files. \bBuild$ \bBuild.bat$ \b_build \bBuild.COM$ \bBUILD.COM$ \bbuild.com$ ^MANIFEST\.SKIP # Avoid archives of this distribution \btest_module_starter-[\d\.\_]+

    I then

    cd test_module_starter/ cp MANIFEST.SKIP.bak MANIFEST.SKIP ./Build disttest

    Perl Info

    perl -V

    Chronicler: The Domici War (domiciwar.net)

    General Ne'er-do-well (github.com/LeamHall)

      I use Module::Starter, via the module-starter script, but I don't use Module::Build (I use ExtUtils::MakeMaker). I became very curious about all of these anomalies, so I decided to try the commands that you've shown for myself.

      I upgraded modules, where necessary, to the latest versions:

      $ perl -E 'use Module::Starter; say $Module::Starter::VERSION' 1.77 $ perl -E 'use Module::Build; say $Module::Build::VERSION' 0.4231

      I pared down my ~/.module-starter/config to an absolute barebones version:

      ken@titan ~/.module-starter $ cat config author: Ken Cotterill email: kcott@cpan.org

      I created a fresh directory, ~/tmp/pm_11126324, for my tests. I then ran the commands you show.

      ken@titan ~/tmp/pm_11126324 $ module-starter --version module-starter v1.77 ken@titan ~/tmp/pm_11126324 $ module-starter -mb --module test_module_starter Added to MANIFEST: Build.PL Added to MANIFEST: Changes Added to MANIFEST: lib/test_module_starter.pm Added to MANIFEST: MANIFEST Added to MANIFEST: README Added to MANIFEST: t/00-load.t Added to MANIFEST: t/manifest.t Added to MANIFEST: t/pod-coverage.t Added to MANIFEST: t/pod.t Added to MANIFEST: xt/boilerplate.t Created starter directories and files ken@titan ~/tmp/pm_11126324 $

      So, I don't see any of the initial lines that you show:

      Created test_module_starter Created test_module_starter/lib Created test_module_starter/lib/test_module_starter.pm Created test_module_starter/t Created test_module_starter/t/manifest.t Created test_module_starter/t/00-load.t Created test_module_starter/t/pod.t Created test_module_starter/t/pod-coverage.t Created test_module_starter/xt Created test_module_starter/xt/boilerplate.t Created test_module_starter/Build.PL Created test_module_starter/Changes Created test_module_starter/README Regenerating MANIFEST Can't find dist packages without a MANIFEST file Run 'Build manifest' to generate one WARNING: Possible missing or corrupt 'MANIFEST' file. Nothing to enter for 'provides' field in metafile. Created MYMETA.yml and MYMETA.json Creating new 'Build' script for 'test_module_starter' version '0.01' File 'MANIFEST.SKIP' does not exist: Creating a temporary 'MANIFEST.SK +IP'

      There would appear to be a bug in Module::Build in that it reports "Added to MANIFEST: xt/boilerplate.t" but either that didn't happen or that line was subsequently removed:

      ken@titan ~/tmp/pm_11126324 $ cat test_module_starter/MANIFEST Build.PL Changes lib/test_module_starter.pm MANIFEST This list of files README t/00-load.t t/manifest.t t/pod-coverage.t t/pod.t

      I had a look in "Active bugs for Module-Build" but couldn't see anything related to this. There are multiple screenfuls of active bugs, so I may have missed it; also, that many active bugs does not fill me with confidence about this module in general.

      It may be that you're attempting to create your module in a directory that's filled with files from previous attempts. That could account for all the extra messages that you reported. Try creating a fresh, empty directory and start again from scratch.

      Also look in your ~/.module-starter/config and see what's there that could be causing issues. Do you, perhaps, have a template_dir: line which is causing your directory to be populated with problem files.

      Your cp MANIFEST.SKIP.bak MANIFEST.SKIP command looks wrong to me. Normally, you copy a file to a backup version; not the other way around.

      I looked at the "Module::Build: ACTIONS: test" documentation. It does not appear to recursively work through the t/ directory:

      "Tests can be defined in the standard places: a file called test.pl in the top-level directory, or several files ending with .t in a t/ directory."

      You may be able to use the --test_files argument to do what you want. I haven't tested this.

      Also look at "Module::Build: SEE ALSO". There are a number of links there that might be useful for you (e.g. the Cookbook). I didn't look at any of these.

      Finally, you might consider using ExtUtils::MakeMaker instead of Module::Build. That's what I use for both personal projects and $work: I've never had any of the sort of issues that you're reporting.

      — Ken

        Ken, I tried a different solution; creating the module as a totally different user. That changes the results greatly, so my bet is that in some previous digging into module building I read some page and modified things I've long forgotten about.

        I'll give ExtUtils::MakeMaker a look.

        Chronicler: The Domici War (domiciwar.net)

        General Ne'er-do-well (github.com/LeamHall)

      Thanks for adding the code tags.

      The reason I asked you to use -vet with cat, was to locate characters that were not immediately obvious but could affect the regex.

      Compare

      $ cat rogue_char_test qwerty asdfgh zxcvbn

      with

      $ cat -vet rogue_char_test qwerty $ asdfgh^I$ zxcvbn^N$

      On a different note, your MANIFEST.SKIP.bak file has regexes for MSWin-style files (e.g. *.bat and *.com) but your perl -V indicates a Linux(Debian) installation. Did you perhaps copy files from another OS onto your Linux OS? Were the modules you have on your Linux OS installed on that OS (with package manager, cpan or similar utility, or manual build from source)?

      — Ken

      Change into the distribution's root directory, then post here (in code tags) the output of perl t/manifest.t.

      Those path names shouldn't be absolute, and if they're being interpreted as such for some reason, the word boundary of the regex will definitely not match.

        Not a lot of info:

        perl t/manifest.t 1..0 # SKIP Author tests not required for installation

        Addendum: More info

        export RELEASE_TESTING=1; perl t/manifest.t 1..1 not ok 1 # Failed test at /usr/local/share/perl/5.30.0/Test/CheckManifest.pm +line 190. # got: 0 # expected: 1 # The following files are not named in the MANIFEST file: /home/leam/t +mp/test_module_starter/MANIFEST.SKIP, /home/leam/tmp/test_module_star +ter/MANIFEST.SKIP.bak # MANIFEST: /home/leam/tmp/test_module_starter/MANIFEST # Looks like you failed 1 test of 1.

        Chronicler: The Domici War (domiciwar.net)

        General Ne'er-do-well (github.com/LeamHall)