miyagawa / cpanminus

cpanminus - get, unpack, build and install modules from CPAN
http://cpanmin.us
754 stars 213 forks source link

Recommends ignored when using cpanfile #580

Open theory opened 6 years ago

theory commented 6 years ago

I'm adding a bundle command to the Sqitch project, to make it easier to bundle up Sqitch and all of its dependencies in a single directory. I expect to use this for Docker images, Homebrew formulas, and perhaps binary installers. After digging through Carton and cpanminus, it looks like Menlo is the key thing to use. So I made a cpanfile and wrote this:

    my $app = Menlo::CLI::Compat->new(
        quiet          => 1,
        notest         => 1,
        self_contained => 1,
        install_types  => [qw(requires recommends)],
        local_lib      => File::Spec->rel2abs($base),
        pod2man        => undef,
        cpanfile_path  => File::Spec->catfile(qw(dist cpanfile)),
        argv           => ['.'],
    );

Which works great, except that the recommends modules in the cpanfile aren't installed. Is Menlo not reading the cpanfile?

theory commented 6 years ago

Hrm, looks like it works if I add installdeps => 1. I had though that was implied by self_contained, but apparently not. Is that right?