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

PrereqCheck fails if JSON and JSON::XS are specified together [rt.cpan.org #76394] #67

Open
xdg opened this issue Apr 3, 2016 · 1 comment

Comments

@xdg
Copy link
Contributor

xdg commented Apr 3, 2016

https://rt.cpan.org/Ticket/Display.html?id=76394

To reproduce the problem:

$ PERL=perl
$ (echo JSON; echo JSON::XS) | $PERL `$PERL -S perldoc -l
CPAN::Reporter::PrereqCheck`
JSON 1 2.53
JSON::XS 0 broken

I think the root of the problem is that CPAN::Reporter::PrereqCheck is
doing the require call on a filename, and not on a bareword. This works:

$ $PERL -e 'require JSON; require JSON::XS;'
(no output, no error)

But this fails:

$ $PERL -e 'require
"/home/cpansand/var/ctps/5141RC1/install/perl-5.14.1-RC1/lib/site_perl/5.14.1/JSON.pm";
require
"/home/cpansand/var/ctps/5141RC1/install/perl-5.14.1-RC1/lib/site_perl/5.14.1/i386-freebsd/JSON/XS.pm"'
Modification of a read-only value attempted at
/home/cpansand/var/ctps/5141RC1/install/perl-5.14.1-RC1/lib/site_perl/5.14.1/i386-freebsd/JSON/XS.pm
line 1461.
Compilation failed in require at -e line 1.

(or to reproduce it without hardcoded paths, you can use:
$PERL -le 'require JSON; require JSON::XS; print qq{require
"$INC{"JSON.pm"}"; require "$INC{"JSON/XS.pm"}"}' | $PERL
)

Maybe it would be better if CPAN::Reporter::PrereqCheck sets @INC
instead and uses "require Module" instead of "require $file"?

Regards,
    Slaven
@jkeenan
Copy link
Contributor

jkeenan commented Sep 16, 2023

@eserte, before this ticket for CPAN-Reporter was migrated from RT to GH back in 2016, @xdg asked you if this problem was appearing on versions of CPAN-Reporter with more recent versions of CPAN::Reporter (than you had in 2012). Do you still experience this problem?

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

2 participants