What's new in Carton and cpanm at YAPC::Asia 2013

What's new in Carton and cpanm at YAPC::Asia 2013

B2d653d5d663e750a2cd57bfbc9b727f?s=128

Tatsuhiko Miyagawa

September 21, 2013
Tweet

Transcript

  1. What's new in Carton & cpanm Tatsuhiko Miyagawa YAPC::Asia 2013

    Keio University Saturday, September 21, 13
  2. Me • Tatsuhiko Miyagawa • Lives in San Francisco •

    {github,twitter,CPAN}/miyagawa Saturday, September 21, 13
  3. Saturday, September 21, 13

  4. speakerdeck.com /miyagawa Saturday, September 21, 13

  5. Agenda • cpanm 1.6 / 1.7 • Carton 1.0 •

    What's Next Saturday, September 21, 13
  6. cpanminus tiny, standalone CPAN installer that "just works" Saturday, September

    21, 13
  7. vs. other installers Sane defaults. Quiet output. Fast and lightweight.

    One file install. Saturday, September 21, 13
  8. %  curl  -­‐L  cpanmin.us  \ |  perl  -­‐  App::cpanminus Saturday,

    September 21, 13
  9. ♥ perlbrew, plenv Saturday, September 21, 13

  10. cpanm 1.6 released in 2/26 Saturday, September 21, 13

  11. Pinning versions Flexible version query Saturday, September 21, 13

  12. >  cpanm  DBI@1.200 >  cpanm  Plack~">=  1.0,  <  2.0" Saturday,

    September 21, 13
  13. ♥ MetaCPAN Saturday, September 21, 13

  14. --dev Saturday, September 21, 13

  15. install via git Saturday, September 21, 13

  16. >  cpanm  git://github.com/plack/Plack.git@devel Saturday, September 21, 13

  17. cpanfile support Saturday, September 21, 13

  18. >  cat  cpanfile requires  'Plack',  '1.0000'; >  cpanm  -­‐-­‐installdeps  .

    Saturday, September 21, 13
  19. cpanm 1.7 9/4, 2013 Saturday, September 21, 13

  20. Major changes • Smaller executable size: 350KB -> 230KB •

    ♥ Travis CI • Better prerequisite spec support • Build Args support • Uninstall Saturday, September 21, 13
  21. Saturday, September 21, 13

  22. # cpanfile on develop => sub { requires 'Test::Pod'; recommends

    'Devel::NYTProf'; }; > cpanm --installdeps . \ --with-develop \ --with-recommends Saturday, September 21, 13
  23. # cpanfile feature 'sqlite' => sub { requires 'DBD::SQLite' recommends

    'DBI', 3.1; }; > cpanm --installdeps . \ --with-feature=sqlite Saturday, September 21, 13
  24. # travis.yml install: cpanm -nq --installdeps \ --with-develop --with-recommends Saturday,

    September 21, 13
  25. cpanm DBD::mysql \ --configure-args="--with-mysql=/usr/local/ mysql" Saturday, September 21, 13

  26. cpanm --uninstall DBI cpanm -U DBI Saturday, September 21, 13

  27. github.com/ miyagawa/cpanminus Saturday, September 21, 13

  28. Carton Bundler for Perl Saturday, September 21, 13

  29. Managing CPAN Dependencies Saturday, September 21, 13

  30. Why you need it Saturday, September 21, 13

  31. (snip) http://yapcasia.org/2011/talk/91 Saturday, September 21, 13

  32. “Upgrading CPAN modules broke my app” Saturday, September 21, 13

  33. Dependencies are part of your app. Saturday, September 21, 13

  34. cpanfile + cpanm • Simple • Yet powerful and flexible

    way to describe dependencies and version requirements • Version control cpanfile Saturday, September 21, 13
  35. # cpanfile requires 'Plack', '== 1.0001'; requires 'DBI', '== 3.2';

    ... Saturday, September 21, 13
  36. caveats • Locking each dependency with specific version is tedious

    work • Can only lock direct dependencies • MetaCPAN as SPOF • No easy/reliable way to fallback Saturday, September 21, 13
  37. Carton Saturday, September 21, 13

  38. Basic idea: Describe CPAN dependencies snapshot tarball pathnames Saturday, September

    21, 13
  39. Built on top of: cpanfile + cpanm 1.6 Saturday, September

    21, 13
  40. carton 1.0 released in 8/4 Saturday, September 21, 13

  41. What's new in 1.0 • No Makefile.PL/Build.PL support (cpanfile) •

    cpanfile.snapshot (no carton.lock) • 20x faster tree command • More reliable version extraction • carton update, carton bundle • fatpack executable for bootstrap Saturday, September 21, 13
  42. DEMO Saturday, September 21, 13

  43. gum.co/BmXz Saturday, September 21, 13

  44. Deployment with Carton Saturday, September 21, 13

  45.  @local>  carton  install  @local>  git  commit  cpanfile.snapshot  @local>  git  push

    @remote>  carton  install  -­‐-­‐deployment @remote>  carton  exec  plackup  ... Saturday, September 21, 13
  46. Example: github.com/miyagawa/cpanmetadb-perl capistrano, Server::Starter, carton, plackup (twiggy) Saturday, September 21,

    13
  47. PaaS/Cloud github.com/miyagawa/heroku-buildpack-perl Saturday, September 21, 13

  48. Saturday, September 21, 13

  49. http://weblog.bulknews.net Saturday, September 21, 13

  50. Support to come! Dokku, DotCloud, Travis CI, Cloud Foundry etc.

    Saturday, September 21, 13
  51. github.com/miyagawa/carton irc.perl.org #carton Saturday, September 21, 13

  52. Sneak Preview Saturday, September 21, 13

  53. cpanm 1.8 cpanfile 1.1 Carton 1.1 Saturday, September 21, 13

  54. BETA Saturday, September 21, 13

  55. cpanm 1.8 git (+ any URL) support in index Saturday,

    September 21, 13
  56. cpanfile 1.1 git syntax support Saturday, September 21, 13

  57. requires  'Plack',  '1.0000',    git  =>  'git://github.com/plack/Plack.git',    ref  =>

     'devel'; carton 1.1 Saturday, September 21, 13
  58. requires  'Plack',  '1.0011',    dist  =>  'MIYAGAWA/Plack-­‐1.0011.tar.gz'; carton 1.1 Saturday,

    September 21, 13
  59. requires  'Plack',  '1.0011',    dist  =>  'http://darkpan/Plack-­‐1.tar.gz'; carton 1.1 Saturday,

    September 21, 13
  60. (demo) Saturday, September 21, 13

  61. cpanm 1.8 • Rewrite internals • Backend API • Plugin

    support • CPAN Testers support (via plugins) Saturday, September 21, 13
  62. carton 1.1 • configure args/hints support • safe exec on

    development • remember options (--path etc.) Saturday, September 21, 13
  63. Thank you! Saturday, September 21, 13

  64. speakerdeck.com /miyagawa Saturday, September 21, 13