Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude directories vendor_perl from @INC #257

Open
nicolasfranck opened this issue Jun 26, 2019 · 3 comments
Open

exclude directories vendor_perl from @INC #257

nicolasfranck opened this issue Jun 26, 2019 · 3 comments

Comments

@nicolasfranck
Copy link

I'm using carton to package a project together with all its perl dependencies.
The package is then installed on another server. Both servers (centos 7)
have the same OS.

All goes well until your project needs something like Digest::MD5.
The destination server does not have Digest::MD5, because it is
not part of the perl distribution. The build server did have that
module in the default locations, indirectly by installing something like
perl-App-cpanminus.

So the thing is: carton ignores what is already present in the default locations,
including those perl modules that were installed by yum. Shouldn't those
those directories be excluded?

@nicolasfranck
Copy link
Author

Another option: add the module to "local", even if it exists in the default perl locations.
A new command line option?

@cPWilliamL
Copy link

cPWilliamL commented Mar 18, 2020

I am facing this issue as well, but it's hard to place the blame. First, carton uses Menlo(basically cpanm 2.0) as a backend. Carton doesn't fully expose all of the Menlo/cpanm options, one being '--self-contained':

$ cpanm --help|grep self.contained
  --self-contained          Install all non-core modules, even if they're already installed.

So you could adjust Carton::Builder::run_install to add this option; however, notice it says non-core modules.

Digest::MD5 should be included by default in Perl core modules, so it could be the distro to blame. In my case the issue was with Module::Build, which is not actually listed in the core modules at https://perldoc.perl.org/

However, I found that perldoc probably shouldn't be the definitive source for which modules are core. In fact, Menlo uses Module::CoreList, where it shows that Module::Build is a core module:

$ corelist -a Module::Build
Module::Build was first released with perl v5.9.4
  v5.9.4     0.2805
  v5.9.5     0.2808

Which cleared up my confusion about carton/Menlo not including what I believed was a non-core module.

So if you are encountering this issue, it's one of these problems:

  • Your build and deployment environments are different Perl distributions and you are using a module that is no longer apart of Perl core in your deployment environment's distribution of Perl.
  • Your deployment environment doesn't actually provide all of Perl core
  • You need carton to pass "--self-contained" to Menlo

HTH

@skaji
Copy link

skaji commented Mar 19, 2020

--self-contained option is already enabled because -L option implies it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants