chrstphrchvz / perl-tcl-ptk

Tcl::pTk - Interface to Tcl/Tk with Perl/Tk compatible syntax
https://metacpan.org/pod/Tcl::pTk
Other
8 stars 2 forks source link

`Attempt to call undefined import method with arguments via package "Tk::widgets"` #26

Closed chrstphrchvz closed 1 year ago

chrstphrchvz commented 1 year ago

http://www.cpantesters.org/cpan/report/12f44dd8-2d60-11ee-aa15-9515f1a78c53, http://www.cpantesters.org/cpan/report/761513dc-2de9-11ee-8cd4-a490f3a78c53, http://www.cpantesters.org/cpan/report/76bbf0d8-3534-11ee-9d0c-f934c9c02e84 (Perl 5.39.1)

Attempt to call undefined import method with arguments via package "Tk::widgets" (Perhaps you forgot to load the package?) at t/tkFacelift_mega1.t line 19.
BEGIN failed--compilation aborted at t/tkFacelift_mega1.t line 19.
t/tkFacelift_mega1.t .......... 
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 

…

Attempt to call undefined import method with arguments via package "Tk::widgets" (Perhaps you forgot to load the package?) at t/tkHijack_mega1.t line 19.
BEGIN failed--compilation aborted at t/tkHijack_mega1.t line 19.
t/tkHijack_mega1.t ............ 
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 

…

Test Summary Report
-------------------
…
t/tkFacelift_mega1.t        (Wstat: 65280 (exited 255) Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
t/tkHijack_mega1.t          (Wstat: 65280 (exited 255) Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
…
Result: FAIL
Failed 2/133 test programs. 0/581 subtests failed.
chrstphrchvz commented 1 year ago

See https://perldoc.perl.org/5.39.1/perldelta#Calling-the-import-method-of-an-unknown-package-produces-an-error

chrstphrchvz commented 1 year ago

I do not have Perl 5.39.1. However I have built Perl 5.36.1 with https://github.com/Perl/perl5/pull/19419 backported and can reproduce this issue.

chrstphrchvz commented 1 year ago

This bug essentially means that under TkHijack, any use Tk::widgets qw/…/ was previously a no-op, but will raise an error in Perl 5.40 instead.

It seems correct that use Tk::widgets qw/…/ should instead be treated as use Tcl::pTk::widgets qw/…/, even though that will currently cause tests to fail because of #27.