Skip to content

Commit ab5ce39

Browse files
authored
Add release tests on ubuntu (#47)
This adds a github workflow action that runs the basic tests under ubuntu. It also saves the local/ (local::lib) directory as an artifact as a benefit to building ubuntu-based installations (such as docker containers).
1 parent 899d829 commit ab5ce39

181 files changed

Lines changed: 32605 additions & 240 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/cpm/bin/cpm

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#!/usr/bin/perl
2+
use strict;
3+
use warnings;
4+
5+
use App::cpm::CLI;
6+
exit App::cpm::CLI->new->run(@ARGV);
7+
8+
__END__
9+
10+
=head1 NAME
11+
12+
cpm - a fast CPAN module installer
13+
14+
=head1 SYNOPSIS
15+
16+
# install modules into local/
17+
> cpm install Module1 Module2 ...
18+
19+
# install modules with verbose messages
20+
> cpm install -v Module
21+
22+
# from cpanfile (with cpanfile.snapshot if any)
23+
> cpm install
24+
25+
# install module into current @INC instead of local/
26+
> cpm install -g Module
27+
28+
# read modules from STDIN by specifying "-" as an argument
29+
> echo Module1 Module2 | cpm install -
30+
31+
# prefer TRIAL release
32+
> cpm install --dev Moose
33+
34+
# install modules as if version of your perl is 5.8.5
35+
# so that modules which are not core in 5.8.5 will be installed
36+
> cpm install --target-perl 5.8.5
37+
38+
# resolve distribution names from DARKPAN/modules/02packages.details.txt.gz
39+
# and fetch distibutions from DARKPAN/authors/id/...
40+
> cpm install --resolver 02packages,http://example.com/darkpan Your::Module
41+
> cpm install --resolver 02packages,file:///path/to/darkpan Your::Module
42+
43+
# use darkpan first, and if it fails, use metadb and normal CPAN
44+
> cpm install --resolver 02packages,http://example.com/darkpan --resolver metadb Your::Module
45+
46+
# specify types/phases in cpanfile by "--with-*" and "--without-*" options
47+
> cpm install --with-recommends --without-test
48+
49+
=head1 OPTIONS
50+
51+
-w, --workers=N
52+
number of workers, default: 5
53+
-L, --local-lib-contained=DIR
54+
directory to install modules into, default: local/
55+
-g, --global
56+
install modules into current @INC instead of local/
57+
-v, --verbose
58+
verbose mode; you can see what is going on
59+
--prebuilt, --no-prebuilt
60+
save builds for CPAN distributions; and later, install the prebuilts if available
61+
default: on; you can also set $ENV{PERL_CPM_PREBUILT} false to disable this option
62+
--target-perl=VERSION (EXPERIMENTAL)
63+
install modules as if verison is your perl is VERSION
64+
--mirror=URL
65+
base url for the CPAN mirror to use, cannot be used multiple times. Use --resolver instead.
66+
default: https://cpan.metacpan.org
67+
--pp, --pureperl-only
68+
prefer pureperl only build
69+
--static-install, --no-static-install
70+
enable/disable the static install, default: enable
71+
-r, --resolver=class,args (EXPERIMENTAL, will be removed or renamed)
72+
specify resolvers, you can use --resolver multiple times
73+
available classes: metadb/metacpan/02packages/snapshot
74+
--reinstall
75+
reinstall the distribution even if you already have the latest version installed
76+
--dev (EXPERIMENTAL)
77+
resolve TRIAL distributions too
78+
--color, --no-color
79+
turn on/off color output, default: on
80+
--test, --no-test
81+
run test cases, default: no
82+
--man-pages
83+
generate man pages
84+
--retry, --no-retry
85+
retry configure/build/test/install if fails, default: retry
86+
--show-build-log-on-failure
87+
show build.log on failure, default: off
88+
--configure-timeout=sec, --build-timeout=sec, --test-timeout=sec
89+
specify configure/build/test timeout second, default: 60sec, 3600sec, 1800sec
90+
--show-progress, --no-show-progress
91+
show progress, default: on
92+
--cpanfile=path
93+
specify cpanfile path, default: ./cpanfile
94+
--snapshot=path
95+
specify cpanfile.snapshot path, default: ./cpanfile.snapshot
96+
-V, --version
97+
show version
98+
-h, --help
99+
show this help
100+
--feature=identifier
101+
specify the feature to enable in cpanfile; you can use --feature multiple times
102+
--with-requires, --without-requires (default: with)
103+
--with-recommends, --without-recommends (default: without)
104+
--with-suggests, --without-suggests (default: without)
105+
--with-configure, --without-configure (default: without)
106+
--with-build, --without-build (default: with)
107+
--with-test, --without-test (default: with)
108+
--with-runtime, --without-runtime (default: with)
109+
--with-develop, --without-develop (default: without)
110+
specify types/phases of dependencies in cpanfile to be installed
111+
--with-all
112+
shortcut for --with-requires, --with-recommends, --with-suggests,
113+
--with-configure, --with-build, --with-test, --with-runtime and --with-develop
114+
115+
=head1 COPYRIGHT AND LICENSE
116+
117+
Copyright 2015 Shoichi Kaji E<lt>[email protected]E<gt>
118+
119+
This library is free software; you can redistribute it and/or modify
120+
it under the same terms as Perl itself.
121+
122+
=cut

.github/cpm/lib/perl5/App/cpm.pm

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
package App::cpm;
2+
use strict;
3+
use warnings;
4+
5+
our $VERSION = '0.993';
6+
our ($GIT_DESCRIBE, $GIT_URL);
7+
8+
1;
9+
__END__
10+
11+
=encoding utf-8
12+
13+
=head1 NAME
14+
15+
App::cpm - a fast CPAN module installer
16+
17+
=head1 SYNOPSIS
18+
19+
> cpm install Module
20+
21+
=head1 DESCRIPTION
22+
23+
=for html
24+
<a href="https://skaji.github.io/images/cpm-Plack.svg"><img src="https://skaji.github.io/images/cpm-Plack.svg" alt="demo" style="max-width:100%;"></a>
25+
26+
cpm is a fast CPAN module installer, which uses L<Menlo> in parallel.
27+
28+
Moreover cpm keeps the each builds of distributions in your home directory,
29+
and reuses them later.
30+
That is, if prebuilts are available, cpm never builds distributions again, just copies the prebuilts into an appropriate directory.
31+
This is (of course!) inspired by L<Carmel>.
32+
33+
For tutorial, check out L<App::cpm::Tutorial>.
34+
35+
=head1 MOTIVATION
36+
37+
Why do we need a new CPAN client?
38+
39+
I used L<cpanm> a lot, and it's totally awesome.
40+
41+
But if your Perl project has hundreds of CPAN module dependencies,
42+
then it takes quite a lot of time to install them.
43+
44+
So my motivation is simple: I want to install CPAN modules as fast as possible.
45+
46+
=head2 HOW FAST?
47+
48+
Just an example:
49+
50+
> time cpanm -nq -Lextlib Plack
51+
real 0m47.705s
52+
53+
> time cpm install Plack
54+
real 0m16.629s
55+
56+
This shows cpm is 3x faster than cpanm.
57+
58+
=head1 CAVEATS
59+
60+
L<eserte|https://github.com/skaji/cpm/issues/71> reported that
61+
the parallel feature of cpm yielded a new type of failure for CPAN module installation.
62+
That is,
63+
if B<ModuleA> implicitly requires B<ModuleB> in configure/build phase,
64+
and B<ModuleB> is about to be installed,
65+
then it may happen that the installation of B<ModuleA> fails.
66+
67+
I can say that it hardly happens especially if you use a new Perl.
68+
Moreover, for a workaround, cpm automatically retries the installation if it fails.
69+
70+
I hope that
71+
if almost all CPAN modules are distributed with L<static install enabled|http://blogs.perl.org/users/shoichi_kaji1/2017/03/make-your-cpan-module-static-installable.html>,
72+
then cpm will parallelize the installation for these CPAN modules safely and we can eliminate this new type of failure completely.
73+
74+
=head1 ROADMAP
75+
76+
If you all find cpm useful,
77+
then cpm should be merged into cpanm 2.0. How exciting!
78+
79+
To merge cpm into cpanm, there are several TODOs:
80+
81+
=over 4
82+
83+
=item * (DONE) Win32? - support platforms that do not have fork(2) system call
84+
85+
=item * (DONE) Logging? - the parallel feature makes log really messy
86+
87+
=back
88+
89+
Your feedback is highly appreciated.
90+
91+
=head1 COPYRIGHT AND LICENSE
92+
93+
Copyright 2015 Shoichi Kaji E<lt>[email protected]E<gt>
94+
95+
This library is free software; you can redistribute it and/or modify
96+
it under the same terms as Perl itself.
97+
98+
=head1 SEE ALSO
99+
100+
L<Perl Advent Calendar 2015|http://www.perladvent.org/2015/2015-12-02.html>
101+
102+
L<App::cpanminus>
103+
104+
L<Menlo>
105+
106+
L<Carton>
107+
108+
L<Carmel>
109+
110+
=cut

0 commit comments

Comments
 (0)