perl-carton / carton

Bundler or pip freeze for Perl
http://search.cpan.org/dist/carton
Other
494 stars 96 forks source link

carton bundle dies with "invalid top directory" in File::Find #140

Closed geira closed 10 years ago

geira commented 10 years ago

Seems like Carton::Packer calls File::Find::find with only an options hash and no argument. Hacking File::Find (5.006) to confess instead of dying produce the following:

$ carton -v
carton v1.0.11
$ uname -a
Linux pc4182 3.2.0-53-generic #81-Ubuntu SMP Thu Aug 22 21:01:03 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ rm cpanfile.snapshot
$ carton install [...]
106 distributions installed
Complete! Modules were installed into /home/geira/metamod/trunk/local
$ carton bundle
invalid top directory at /usr/share/perl/5.14/File/Find.pm line 465.
    File::Find::_find_opt('HASH(0x1d9fff0)') called at /usr/share/perl/5.14/File/Find.pm line 1071
    File::Find::find('HASH(0x1d9fff0)') called at /usr/local/share/perl/5.14.2/Carton/Packer.pm line 87
    Carton::Packer::installed_meta('Carton::Packer=HASH(0x1da6878)', 'Carton') called at /usr/local/share/perl/5.14.2/Carton/Packer.pm line 61
    Carton::Packer::required_modules('Carton::Packer=HASH(0x1da6878)') called at /usr/local/share/perl/5.14.2/Carton/Packer.pm line 42
    Carton::Packer::do_fatpack('Carton::Packer=HASH(0x1da6878)', 'Path::Tiny=ARRAY(0x28f2360)') called at /usr/local/share/perl/5.14.2/Carton/Packer.pm line 27
    Carton::Packer::fatpack_carton('Carton::Packer=HASH(0x1da6878)', 'Path::Tiny=ARRAY(0x28f21e0)') called at /usr/local/share/perl/5.14.2/Carton/CLI.pm line 160
    Carton::CLI::cmd_bundle('Carton::CLI=HASH(0x1f88898)') called at /usr/local/share/perl/5.14.2/Carton/CLI.pm line 55
    Carton::CLI::__ANON__() called at /usr/local/share/perl/5.14.2/Try/Tiny.pm line 71
    eval {...} called at /usr/local/share/perl/5.14.2/Try/Tiny.pm line 67
    Try::Tiny::try('CODE(0x1f65680)', 'Try::Tiny::Catch=REF(0x1b17aa8)') called at /usr/local/share/perl/5.14.2/Carton/CLI.pm line 70
    Carton::CLI::run('Carton::CLI=HASH(0x1f88898)', 'bundle') called at /usr/local/bin/carton line 9
miyagawa commented 10 years ago

Did you use cpanm to install Carton? It looks like you were using other methods to do it.

miyagawa commented 10 years ago

Added --no-fatpack to bypass generation of fatpack executable when not needed. Use that option.

geira commented 10 years ago

Am indeed using cpanm. Just verified problem on a clean Ubuntu Lucid VM. Have tried downgrading to 1.0.10 and 1.0.9, but no difference. Will try --no-fatpack option when released on cpan.

For reproduction the source is available here (see debian/control for a list of deps): https://svn.met.no/metamod/trunk

geira commented 10 years ago

Using --no-fatpack in 1.0.12 solved the problem. Thanks!

datamuc commented 10 years ago

I have the same problem. --no-fatpack doesn't help, since I want a fatpacked carton in my bundle ...

However, my backtrace looks a bit different:

$ PERL5OPT=-MCarp::Always carton bundle
Bundling modules using /export/home/danielt/tmp/ctest/cpanfile
Copying S/SR/SRI/Mojolicious-4.41.tar.gz
at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/Builder.pm line 39.
        Carton::Builder::bundle(Carton::Builder=HASH(0x26af2a0), Path::Tiny=ARRAY(0x278fb88), Path::Tiny=ARRAY(0x278f648), Carton::Snapshot=HASH(0x26af180)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 163
        Carton::CLI::cmd_bundle(Carton::CLI=HASH(0x1c6f080)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 55
        Carton::CLI::try {...} () called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Try/Tiny.pm line 78
        eval {...} called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Try/Tiny.pm line 74
        Try::Tiny::try(CODE(0x2366868), Try::Tiny::Catch=REF(0x1f95548)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 70
        Carton::CLI::run(Carton::CLI=HASH(0x1c6f080), "bundle") called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/bin/carton line 9
invalid top directory at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1/File/Find.pm line 472.
        File::Find::_find_opt(HASH(0x28d4c28)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1/File/Find.pm line 1079
        File::Find::find(HASH(0x28d4c28)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/Packer.pm line 87
        Carton::Packer::installed_meta(Carton::Packer=HASH(0x278bf68), "Carton") called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/Packer.pm line 61
        Carton::Packer::required_modules(Carton::Packer=HASH(0x278bf68)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/Packer.pm line 42
        Carton::Packer::do_fatpack(Carton::Packer=HASH(0x278bf68), Path::Tiny=ARRAY(0x281d0b0)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/Packer.pm line 27
        Carton::Packer::fatpack_carton(Carton::Packer=HASH(0x278bf68), Path::Tiny=ARRAY(0x281cf90)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 167
        Carton::CLI::cmd_bundle(Carton::CLI=HASH(0x1c6f080)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 55
        Carton::CLI::try {...} () called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Try/Tiny.pm line 78
        eval {...} called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Try/Tiny.pm line 74
        Try::Tiny::try(CODE(0x2366868), Try::Tiny::Catch=REF(0x1f95548)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 70
        Carton::CLI::run(Carton::CLI=HASH(0x1c6f080), "bundle") called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 58.
        Carton::CLI::catch {...} ("invalid top directory at /home/danielt/perl5/perlbrew/perls/p"...) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Try/Tiny.pm line 106
        Try::Tiny::try(CODE(0x2366868), Try::Tiny::Catch=REF(0x1f95548)) called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Carton/CLI.pm line 70
        Carton::CLI::run(Carton::CLI=HASH(0x1c6f080), "bundle") called at /home/danielt/perl5/perlbrew/perls/perl-5.18.1/bin/carton line 9