-
Notifications
You must be signed in to change notification settings - Fork 20
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
Makefile.PL Fails for 246 when it works for 244 #93
Comments
I think I found the difference between 244 and 246. In 244 and 246 on my janus VM, both return "0" in the call
so the 244 script does not exit as perhaps it should have? In 246, there is an an exit command that is duly executed.
The above explains the inconsistent behavior of version 244 and 246 on the same machine. But Gentoo's ebuild doesn't seem to read the exit correctly and proceeds with what appears to be a successful installation when there is nothing to install. Now, I'll add a wrinkle. On another Gentoo instance, taurus, the call to subroutine check_lib() returns 1 whereas on janus it returns 0. What is odd is that I have the same expat files on taurus and janus and the same package Devel::CheckLibs. I'll have to scratch around some more and will update with my findings. |
I think there is another issue apart from the failure of the test subroutine check_lib(). That is the value provided by the call to exit. In 266, the exit returns "0" to signify a failure. In Perl, returns of "0" can be a signal of: FAILED, and a return of "1" can be: SUCCESS. However, in bash scripting, the opposite is true -- a call to a script which returns "0" means the sub component was successful, and you flag an error by exiting with "1". On the topic of exit codes for bash, see: https://codefather.tech/blog/exit-bash-script/ So, at this point I'm concluding that version 244 was broken because the failure of check_lib() should have had an "exit 1", but instead the exit line was rem'd out and processing proceeded. If your system had the expat libraries, then no harm, no foul and in Gentoo the installation of perl-lang/XML-Parser would succeed because in the later steps of Makefile.PL files for compilation where created and expat was found. So I think this package's Makefile.pl should have at line 69:
Then, investigation needs to determine why the subroutine check_lib() fails when it should not. When check_lib() successfully finds the expat library and header file, then line 69 will not be called and the build will continue as it should. |
Of course, my suggestion that Makefile.PL's line 69 have "exit 1;" comes from a perspective of a Gentoo bash script. It may be that within Perl's realm, the Makefile.PL's return should be "exit 0", in which case the maintainter of the Gentoo package perl-lang/XML-Parser should check for a value of "1" instead of "0" to determine success. |
See https://metacpan.org/pod/Devel::CheckLib#check_lib_or_exit I created this test script which produces the desired result on my machines "janus" and "taurus":
If you engage either of the "if" clauses (replacing 0 with 1) then the desired result will occur: the Perl script will exit with a warning. Perhaps using the function check_lib_or_exit() instead of check_lib() would be the approach to take? |
As more people upgrade to 246 in Gentoo, larger numbers of users are hitting this. Anything we can do to help (any more information about the installed libexpat, for example)? Interestingly, I can't hit this. |
This looks related to #86. |
…arch) The bundled, rather old copy of Devel::CheckLib seems to sometimes cause errors when trying to find Expat. Bug: cpan-authors/XML-Parser#93 Bug: https://bugs.gentoo.org/827966 Bug: cpan-authors/XML-Parser#86 Signed-off-by: Sam James <[email protected]>
I believe this has been resolved by #89 |
In Gentoo, the package dev-perl/XML-Parser-2.460.0 does not install XML::Parser. I've opened a bug regarding the false indication that XML::Parser installs when, in fact, it does not. The issue https://bugs.gentoo.org/827966
I downloaded and staged XML::Parser-2.44 and 2.46 under /usr/local/src. I then proceeded to run:
in each staging area. The result is that 2.44 creates files when 2.46 does not:
Both have the warning message. Here are my attempts:
in 244, it works:
It looks like the point of failure is occurring at the testing stage, lines 32 - 39, in Makefile.PL:
I have these areas waiting for any modified Makefile.PL scripts you would like me to try out. My guess is check_lib is failing.
The text was updated successfully, but these errors were encountered: