Skip to content

Commit 9361f28

Browse files
committed
GitHub Action: upload cpanm logs
1 parent 3776ae0 commit 9361f28

File tree

2 files changed

+54
-25
lines changed

2 files changed

+54
-25
lines changed

.github/workflows/multiperl-test.yml

+22-7
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,31 @@ jobs:
2323
curl https://cpanmin.us/ > /tmp/cpanm
2424
chmod u+x /tmp/cpanm
2525
- name: Install Dist::Zilla
26-
run: sudo apt-get install -y libdist-zilla-perl
27-
- name: Install prereqs
28-
# This could probably be made more efficient by looking at what it's
29-
# installing via cpanm that could, instead, be installed from apt. I
30-
# may do that later, but for now, it's fine! -- rjbs, 2023-01-07
26+
run: sudo apt-get install -y libdist-zilla-perl libpod-weaver-perl
27+
- name: Install authordeps
3128
run: |
32-
dzil authordeps --missing > /tmp/deps-phase-1.txt
29+
dzil authordeps --missing | grep -v Dist::Zilla::Plugin::CPANFile > /tmp/deps-phase-1.txt
30+
echo "---BEGIN AUTHORDEPS---"
31+
cat /tmp/deps-phase-1.txt
32+
echo "---END AUTHORDEPS---"
3333
/tmp/cpanm --notest -S < /tmp/deps-phase-1.txt
34-
dzil listdeps --author --missing >> /tmp/deps-phase-2.txt
34+
- name: Upload cpanm logs for authordeps
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: cpanm-authordeps.log
38+
path: ~/.cpanm/build.log
39+
- name: Install missing prereqs
40+
run: |
41+
dzil listdeps --author --missing > /tmp/deps-phase-2.txt
42+
echo "---BEGIN PREREQS---"
43+
cat /tmp/deps-phase-2.txt
44+
echo "---END PREREQS---"
3545
/tmp/cpanm --notest -S < /tmp/deps-phase-2.txt
46+
- name: Upload cpanm logs for prereqs
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: cpanm-prereqs.log
50+
path: ~/.cpanm/build.log
3651
- name: Build tarball
3752
run: |
3853
dzil build --in Dist-To-Test

lib/Dist/Zilla/Util/AuthorDeps.pm

+32-18
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,38 @@ sub extract_author_deps {
107107
if ($missing) {
108108
require Module::Runtime;
109109

110-
@packages =
111-
grep {
112-
$_ eq 'perl'
113-
? ! ($vermap->{perl} && eval "use $vermap->{perl}; 1")
114-
: do {
115-
my $m = $_;
116-
! eval {
117-
local @INC = @INC; push @INC, "$root";
118-
# This will die if module is missing
119-
Module::Runtime::require_module($m);
120-
my $v = $vermap->{$m};
121-
# This will die if VERSION is too low
122-
!$v || $m->VERSION($v);
123-
# Success!
124-
1
125-
}
126-
}
127-
} @packages;
110+
my @new_packages;
111+
PACKAGE: for my $package (@packages) {
112+
if ($package eq 'perl') {
113+
# This is weird, perl can never really be a prereq to fulfill but...
114+
# it was like this. -- rjbs, 2024-06-02
115+
if ($vermap->{perl} && ! eval "use $vermap->{perl}; 1") {
116+
push @new_packages, 'perl';
117+
}
118+
119+
next PACKAGE;
120+
}
121+
122+
my $ok = eval {
123+
local @INC = (@INC, "$root");
124+
125+
# This will die if module is missing
126+
Module::Runtime::require_module($package);
127+
my $v = $vermap->{$package};
128+
129+
# This will die if VERSION is too low
130+
!$v || $package->VERSION($v);
131+
132+
# Success!
133+
1;
134+
};
135+
136+
unless ($ok) {
137+
push @new_packages, $package;
138+
}
139+
}
140+
141+
@packages = @new_packages;
128142
}
129143

130144
# Now that we have a sorted list of packages, use that to build an array of

0 commit comments

Comments
 (0)