-
Notifications
You must be signed in to change notification settings - Fork 152
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
MakeMaker's NAME must be a valid package name, not ditribution name replacing - with :: #164
Conversation
…eplacing - with ::. $self->zilla->name contains distribution name and it might be different from "main_module" package names, which is required by MakeMaker's NAME. From perldoc ExtUtils::MakeMaker: "NAME" must be a valid Perl package name and it must have an associated ".pm" file. For example, "Foo::Bar" is a valid "NAME" and there must exist Foo/Bar.pm.
Neither the original code nor the changes seem to guarantee what EUMM specifies - that there is both a Foo::Bar and Foo/Bar.pm. After looking for the 'modules inside' the main package, there should be a check for (The spec doesn't say, but surely it should also say that Foo::Bar comes from Foo/Bar.pm, not merely that such a file must exist in the distribution.) |
My original patch was doing the path check and basically drops ^lib/ and .pm$. Is that better? On Sun, Apr 7, 2013 at 8:45 AM, Karen Etheridge notifications@github.com
|
@karenetheridge branch updated - somehow tries to match the package with filename. You're right that the MakeMaker spec doesn't say it should also match with the original filename, but my patch would just try that since I believe it would work for 99% of the use case, and fallback to the distname conversion with the log telling something is wrong. |
Here's what you get on my forkprove dist.ini https://github.com/miyagawa/forkprove before/after with the patch. diff -ruP forkprove-v0.4.7/Makefile.PL forkprove-v0.4.7.patch/Makefile.PL
--- forkprove-v0.4.7/Makefile.PL 2013-04-07 13:12:43.000000000 -0700
+++ forkprove-v0.4.7.patch/Makefile.PL 2013-04-07 13:11:24.000000000 -0700
@@ -20,7 +20,7 @@
"script/forkprove"
],
"LICENSE" => "perl",
- "NAME" => "forkprove",
+ "NAME" => "App::ForkProve",
"PREREQ_PM" => {
"App::Prove" => "3.25",
"TAP::Harness" => "3.25", |
I've not paid any attention to the patches so far, but my heuristic would On Sun, Apr 7, 2013 at 4:14 PM, Tatsuhiko Miyagawa <notifications@github.com
David Golden dagolden@cpan.org |
Yep that's what |
my $match = sub { | ||
my $pkg = shift; | ||
return if $pkg eq 'main' or $pkg eq 'DB'; | ||
$pkg =~ s!::!/!g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does $path->name
return backslash on win32? if so i need to change that to [/\\]
instead of just forward slash. let me know.
bump. Any thought on this? |
I apologize for letting this languish. I am now committed to clearing old PRs. I will merge this if the main_module_name is moved to a private, lazy check performed in MakeMaker when the main_module-as-pkg-name does not exist. i.e., rarely. :) In other words: only bother looking inside the main module file if Foo/Bar.pm does not exist for dist Foo-Bar. Tests would be gerat, too, but I can live without them. ;) |
Oops, closing was a mistake! |
$self->zilla->name
contains a distribution name and it might be different from "main_module" package names, which is required by MakeMaker's NAME.From perldoc ExtUtils::MakeMaker:
cc @dagolden