miyagawa/Carmel

carmel install should provide 'frozen' snapshot mode

miyagawa opened this issue · 0 comments

Right now, carmel install with cpanfile.snapshot existing can still fallback to CPAN if cpanfile has a dependency that does not exist in the snapshot. This is a user-friendly behavior in development environment, but in certain situation such as CI or production, you don't want carmel install to leak out to CPAN, and ensure that all modules are installed using the exact same versions in the snapshot.

There should be a config flag to disable the fallback-to-CPAN behavior, and gives an error if the module doesn't exist in the snapshot. This should be used in combination with vendored files in vendor/cache. Carton does this with carmel install --deployment option.

Bundler does this with bundle cache.

Related: (#55) Right now, if you specify a custom mirror in cpanfile Carmel does not fallback to CPAN. That can be used as a workaround.

Workaround: by exporting the vendor files with carmel package, you can achieve this behavior by running with cpanm --from file://$PWD/vendor/cache --installdeps . which would only use the files from ./vendor/cache.