Carton...nstall(3pm)

✨ NAME ✨

Carton::Doc::Install β€” the one that installs ur dependencies, bestie πŸ’– (it's a 3pm page, from the User Contributed Perl Documentation, iykyk)


πŸŽ€ SYNOPSIS πŸŽ€

carton install [--deployment] [--cached] [--path=PATH] [--without develop]

🌸 DESCRIPTION 🌸

Okay so, this command installs the dependencies for ur application. It has two modes and honestly the behavior is a little different in each one, so pay attention πŸ’…

πŸ¦‹ DEVELOPMENT MODE πŸ¦‹

  • carton install

If u run carton install with no arguments and cpanfile exists, carton will scan ur dependencies from cpanfile and install the modules. Slay.

If u run carton install for the first time (aka cpanfile.snapshot does not exist), carton will fetch all the modules u specified, resolve the dependencies, and install all the required modules from CPAN. Very main character of it.

If the cpanfile.snapshot file does exist, carton will still try to install modules that are specified or updated in cpanfile, but it uses cpanfile.snapshot for the dependency resolution, and then cascades to CPAN. The way that it just... knows. 😭

carton will analyze all the dependencies and their version information, and it gets saved into the cpanfile.snapshot file. It is important to add the cpanfile.snapshot file into a version controlled repository and commit the changes as u update ur dependencies. fr fr, do not skip this. πŸ™ˆ

πŸ‘‘ DEPLOYMENT MODE πŸ‘‘

If u specify the --deployment command line option, or if cpanfile.snapshot exists, carton will only use the dependencies specified in cpanfile.snapshot instead of resolving dependencies. No vibes-based resolution, only locked-in facts. periodt. ✨


πŸ’… OPTIONS πŸ’…

  • --deployment β€” forces the deployment mode. Go read "DEPLOYMENT MODE" up there ⬆️ if u need a refresher.
  • --cached β€” locates distribution tarballs in vendor/cache instead of fetching them from CPAN mirrors. This requires u to run carton bundle before the deployment, and to commit or sync the content of the vendor directory over to the other host u run carton install on. Bestie, this is a whole workflow, respect it. 🫢
  • --cpanfile β€” specifies the alternate path for cpanfile. By default, carton install will look for the file cpanfile in the current directory, then upwards till the root directory, in case the command runs from a sub directory.

Carton assumes the directory where ur cpanfile (or altenate path) exists is the project root directory, and will look for the snapshot file as well as the install directory (local) and vendor/cache relative to it. Iconic, honestly.

  • --path β€” specifies the path to install modules to. Defaults to local in the directory relative to where cpanfile is.
NOTE: this option, as of version 1.0, is not preserved across multiple runs of carton install or other commands such as carton list or carton exec. U can choose to set the path in the PERL_CARTON_PATH environment variable to persist it across commands. Lowkey annoying but that's the deal πŸ’€
  • --without β€” by default, carton install will install all the phases for dependencies, including develop. U can specify phases or features to exclude, in the comma separated list.
carton install --deployment --without develop
NOTE: --without for the initial installation (without cpanfile.snapshot) is not supported at this moment. 🚫

and that's the whole page bestie, ur so welcome πŸ’–

This cutie was served up by perl v5.34.0, dated 2022-05-12, and it's the Carton...nstall(3pm) page from the User Contributed Perl Documentation. Now go install something and slay βœ¨πŸ’…πŸŽ€

πŸ“¦ where this page comes from