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

Please make the MCE dependency optional #1

Open
karenetheridge opened this issue Feb 3, 2015 · 12 comments
Open

Please make the MCE dependency optional #1

karenetheridge opened this issue Feb 3, 2015 · 12 comments
Assignees

Comments

@karenetheridge
Copy link

Would it be possible to add the MCE prereq to 'recommends' instead of 'requires', and only make use of it when installed? This is to prevent dependency bloat on systems where it's not wanted.

@thaljef
Copy link
Member

thaljef commented Feb 3, 2015

As I recall, the toolchain does not install recommended modules by default. I would prefer to have an opt-out instead of opt-in. So MCE would be required, unless you explicitly say you don't want it.

Would that be acceptable?

@karenetheridge
Copy link
Author

So MCE would be required, unless you explicitly say you don't want it.

I guess that depends on how you propose to implement that.

@karenetheridge
Copy link
Author

PS CPAN.pm does default to installing recommendations.

@thaljef
Copy link
Member

thaljef commented Feb 3, 2015

I guess that depends on how you propose to implement that.

Probably as a Build.PL command line option, with an environment variable hook. Other suggestions?

CPAN.pm does default to installing recommendations.

I didn't know that. Thanks for educating me. But cpanm still does not.

@karenetheridge
Copy link
Author

This is the canonical way to handle optional features with prompts:

in Makefile.PL:

my %WriteMakefileArgs = (
   ...
);

WriteMakefileArgs{PREREQ_PM}{'MCE'} = '0'
  if $ENV{PERL_MM_USE_DEFAULT} or prompt("install MCE (to allow parallelized tests)? [Y/n]", 'Y') =~ /^y/i;

WriteMakefileArgs{META_MERGE}{optional_features}{'parallel_testing'} = {
  description => 'parallel tests',
  prereqs => { runtime => { requires => { 'MCE' => '0' } } },
  x_default => 1,
};

WriteMakefile(%WriteMakefileArgs);

This will add the extra prereq unless the user specifically said 'no' to the
prompt (and in non-interactive installs, it defaults to 'yes').

I don't know how to do meta merging in Module::Build, but I wouldn't ever
recommend using MB anyway unless you really needed to (e.g. in an Alien dist).

@thaljef
Copy link
Member

thaljef commented Feb 3, 2015

This is the canonical way to handle optional features with prompts:

Thanks for that.

MB was a decision we made long ago, when MB was more fashionable. I could probably switch Test::Perl::Critic to EU::MM in the near future, but Perl::Critic itself will be harder to migrate.

@karenetheridge
Copy link
Author

we can help on #toolchain :)

thaljef added a commit that referenced this issue Feb 4, 2015
This is the first step towards making MCE optional for GH #1.
@marioroy
Copy link

marioroy commented Mar 7, 2017

++ for adding the MCE prereq to 'recommends' instead of 'requires'

@karenetheridge
Copy link
Author

karenetheridge commented Mar 7, 2017 via email

@marioroy
Copy link

marioroy commented Mar 7, 2017

Thank you. I had mistakenly mis-diagnosed an email reply on issue #707.

@petdance petdance self-assigned this May 26, 2017
@petdance
Copy link
Member

I'm certainly in favor of moving back to vanilla Makemaker. If I do that, I'll make MCE optional.

@iynehz
Copy link

iynehz commented Feb 7, 2018

++

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

5 participants