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

allow cpanm options to be set via PERL_CARTON_CPANM_OPT #199

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

slobo
Copy link

@slobo slobo commented Jun 11, 2015

Allows common folk to shoot themselves in the foot, in addition to solving problems such as #139 without source modifications.

Not being able to set any cpanm options prevents us from using Memcached::libmemcached since our build server is not beefy enough to compile the whole thing in under 60s. This patch gives us a way out by allowing

PERL_CARTON_CPANM_OPT="--configure-timeout=3600" carton

@richardipsum
Copy link

I'm using this to define dependencies that are hosted on a local mirror rather than CPAN by setting PERL_CARTON_CPANM_OPT="--mirror $HOME/minicpan", this pr seems to work well for this use case so thanks :)

@miyagawa
Copy link
Contributor

miyagawa commented Aug 4, 2015 via email

@slobo
Copy link
Author

slobo commented Aug 5, 2015

@miyagawa, is there a canonical way to deal with configure timeouts too?

@richardipsum
Copy link

@miyagawa sorry I simplified my case for the purposes of explanation, I'm actually setting a number of mirrors with this, using PERL_CARTON_CPANM_OPT="--mirror $HOME/minicpan --mirror https://cpan.metacpan.org --mirror-only" from what I can see from the code PERL_CARTON_MIRROR will only let you set one mirror.

@slobo
Copy link
Author

slobo commented Dec 2, 2015

@miyagawa, any thoughts on all this?

@GregJArnold
Copy link

@miyagawa I could also use this.

@bvinnerd
Copy link

bvinnerd commented May 12, 2016

Same here - I could do with this. Cannot install Memcached::libmemcached (unless I do it manually with cpanm)

@GregJArnold
Copy link

A year later and no action. Any reason why not, @miyagawa?

@miyagawa
Copy link
Contributor

Overriding cpanm's options would make the carton' behavior inconsistent - you can totally screw up its mirror provider capabilities by specifying invalid mirror options.

I understand there's a need to override it, but this isn't the ideal approach. If you know what you're doing, it's fine you patch Carton with this one.

@richardipsum
Copy link

@miyagawa I trust completely your judgement that this can totally screw things up, but what would the ideal approach be?

Even if the ideal approach is too much work could this not be merged and documented with a liberal sprinkling of capital and bold lettering to make it clear that you should only set this environment variable if you know what you're doing?

As I might have mentioned before I contribute to a distro that uses carton quite heavily in one of its tools and so we have to maintain our own fork of carton just to get this patch, which is a bit sad for us :(

But anyway thanks for making this tool in the first place, it's completely awesome! :D

@miyagawa
Copy link
Contributor

the ideal way would be to allow specific options via either command line options or via cpanfile specification. in Carmel I added an ability to specify mirrors using cpanfile's mirror syntax.

you're right that it would take a lot of efforts, and overriding via the environment is an easy way to deal with it.

@miyagawa
Copy link
Contributor

btw i'd like all of you to try out Carmel https://github.com/miyagawa/Carmel and let me know how it works. The interface is almost exactly the same as Carton, but it is implemented in a completely different way. There's a compatibility with carton if you keep the cpanfile.snapshot file in your repo.

@slobo
Copy link
Author

slobo commented Jul 26, 2016

Would you accept a patch that is more targeted in allowing carton to pass --configure-timeout= to cpanm? Like say via PERL_CARTON_CPANM_CONFIGURE_TIMEOUT=3600?

@fjaeckel
Copy link

I honestly don't understand why this is not being followed up upon. Being able to pass arguments to cpanm is actually not introducing inconsistency, but enabling consistency of using a single tool across multiple platforms.
The FOSS community is amidst platforms moving to their own SSL implementations, away from openssl, rendering any perl installation invalid on a system that doesn't use openssl as their base (e.g. OSX). Being able to link against openssl implementations sourced elsewhere (e.g. Homebrew or bundled via compiling from source) is key for such a tool like carton to work.
Not integrating this here, but referring to another project that itself defines as "experimental" is breaking every single FOSS project that uses carton and forces users of such software to either patch carton themselves or move to other cpanm management styles - which we would all agree on, is tedious.

The sad story is, if this is not being enabled, that every Developer that wants to use carton on OSX these days, needs to fork it and patch it to continue using the same tool.

This goes away from the initial use case of passing a TIMEOUT to cpanm, but mine feels just a bit bigger, I support even passing timeouts to cpanm/carton.

@SineSwiper
Copy link

I ran across this GitHub issue trying to solve for a similar problem with Net-DNS not building right because of a configure timeout. The solution provided at the start of this ticket looked like something easy to put into our PERL_CARTON_CPANM_OPT.

And then I realized that vanilla Carton doesn't have this option. Our company-patched 1.0.12 version does. We also have PERL_CARTON_MIRROR_USE_CACHE, PERL_CARTON_PERL5LIB, and PERL_CARTON_VERSIONED_PATH. We have been using this set up for years. Though we need some glue for getting plenv, Carton, and our DarkPAN working, this set up works well for us.

So, I'm a bit disheartened that this PR is essentially being denied for architectural reasons, especially when a new (experimental) app is being pushed as the new hotness. If Carmel is the new replacement with a better design approach, let us have slightly imperfect solutions that work for the older app. We will likely continue to use Carton in the near future until we have a (non-experimental) app to switch to, and an excuse to do so.

We would be happy to share our patches, but I see little point if they aren't going to actually be accepted into the main Carton repo.

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

Successfully merging this pull request may close these issues.

7 participants