ExtUtils::ParseXS: set fake filename for xs_handshake() - #24651
Conversation
|
If I take the block of new tests you've added to ... I get this output: What's interesting here is that the second of the unit tests you've added in the branch ... ... already PASSes in blead. Is that what you would have expected? |
|
Is there any way I could set up a situation on my disk that would generate this handshake error message so that I can see the before/after impact? |
|
@jkeenan Short answer: Yes. I only added one new test, really. The call to |
|
As for reproducing the error, it involves loading an XS module built for one perl into another (binary incompatible) perl. There's probably a smarter way to set this up, but here's one way:
|
|
I had two problems with these instructions: First,
I think the path supplied to the second Note the 5 lowest subdirectories in the path supplied to the second Second, Based on the discussion in this ticket and the older issues it references, I was expecting to get a different and, presumably, more informative error message when attempting to install the threaded build's List::MoreUtils::XS against the unthreaded perl. To test this, on my laptop (Ubuntu Linux) I built from the branch in your pull request per your instructions. When I ran my spelling of the command in Step #8 above, I got: However, on my Linode (Debian Linux), I re-ran this procedure only at a much earlier commit to blead -- the commit which happened to be 1 commit after v5.44.0 from last month: Commands I issued (some of which, again, are shell scripts I've frequently used): Note that I got exactly the same error message at a commit from last month as I did from your branch. Was my expectation that the message would be different incorrect? |
You need to have installed List::MoreUtils::XS with the change from this PR in the old perl (ie. as if you'd updated EU::PXS from cpan after this change is released to CPAN). You should be able to do that by checking out this branch, cd to the git checkout, and run: and only then install List::MoreUtils::XS. Edit: fix |
If a dynamically loaded library fails the XS handshake (because it was
compiled for a binary incompatible perl), it reports the error from its
own C file with no context except for __FILE__:
XS.c: loadable library and perl binaries are mismatched (got first handshake key 0xed00080, needed 0xee00080)
This patch sets a synthetic (but more user friendly) __FILE__ value
(including the module name) around the version check macros in the
generated boot section. The error message is now:
XS.c in List::MoreUtils::XS: loadable library and perl binaries are mismatched (got first handshake key 0xed00080, needed 0xee00080)
Fixes Perl#24646, Perl#15861, Perl#16654.
20642de to
0d81eb4
Compare
We now always pipe our output through ExtUtils::ParseXS::CountLines (so we can always get the current output line number), but this should make no difference to normal output, which checks 'config_WantLineNumbers' before actually switching to a different file with a custom '#line' directive. Which is to say, the documented behavior of 'linenumbers => 0' should remain unchanged. Follow-up to PR Perl#24651.
We now always pipe our output through ExtUtils::ParseXS::CountLines (so we can always get the current output line number), but this should make no difference to normal output, which checks 'config_WantLineNumbers' before actually switching to a different file with a custom '#line' directive. Which is to say, the documented behavior of 'linenumbers => 0' should remain unchanged. Follow-up to PR #24651.
If a dynamically loaded library fails the XS handshake (because it was compiled for a binary incompatible perl), it reports the error from its own C file with no context except for
__FILE__:This patch sets a synthetic (but more user friendly)
__FILE__value (including the module name) around the version check macros in the generated boot section. The error message is now:Fixes #24646, #15861, #16654.