Bug 1215078

Summary: debhelper: Initialization of state variables in list context currently forbidden
Product: [openSUSE] openSUSE Distribution Reporter: T. Lee Davidson <t.lee.davidson>
Component: DevelopmentAssignee: Jan Baier <jbaier>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bugz57, forgotten_uM1-kgIFHl, jbaier, p.drouand
Version: Leap 15.5   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Leap 15.5   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description T. Lee Davidson 2023-09-06 17:12:21 UTC
Executing `dh`, and other commands, from the debhelper package produces the following, or similar, error:
Initialization of state variables in list context currently forbidden at /usr/lib/perl5/vendor_perl/5.26.1/Debian/Debhelper/Dh_Lib.pm line 2100, near ");"
BEGIN not safe after errors--compilation aborted at /usr/lib/perl5/vendor_perl/5.26.1/Debian/Debhelper/Dh_Lib.pm line 2885.
Compilation failed in require at /usr/bin/dh line 15.
BEGIN failed--compilation aborted at /usr/bin/dh line 15.

https://bugzilla.opensuse.org/show_bug.cgi?id=1198346 indirectly touches on this issue but does not identify the root cause, ie. an issue with the debhelper package.

As far as I know, Perl >= 5.28 is required to be able to initialize state variables in list context.
Comment 1 Jan Baier 2023-09-07 18:30:37 UTC
This looks like https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1001403
Comment 2 T. Lee Davidson 2023-09-07 20:50:18 UTC
Gosh, upon reviewing this, I realized I left out information that may have been helpful. My apologies.

debhelper Version: 13.11.4-bp155.1.5
From Main Repository
Comment 3 OBSbugzilla Bot 2023-09-08 10:35:02 UTC
This is an autogenerated message for OBS integration:
This bug (1215078) was mentioned in
https://build.opensuse.org/request/show/1109698 Backports:SLE-15-SP5 / debhelper
Comment 4 Marcus Meissner 2023-09-25 16:07:43 UTC
openSUSE-RU-2023:0262-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 1215078
CVE References: 
JIRA References: 
Sources used:
openSUSE Backports SLE-15-SP5 (src):    debhelper-13.11.5-bp155.2.3.1
Comment 5 T. Lee Davidson 2023-09-25 18:05:38 UTC
Indeed. After upgrading the debhelper package to version 13.11.5-bp155.2.3.1, the error no longer occurs.
Comment 6 Volker Kuhlmann 2023-10-12 09:19:33 UTC
While it might be fixed for 15.5, it is not fixed for 15.4:

Name        : debhelper
Version     : 13.11.5
Release     : lp154.37.1
Vendor      : obs://build.opensuse.org/system:packagemanager

dh binary
Initialization of state variables in list context currently forbidden at /usr/lib/perl5/vendor_perl/5.26.1/Debian/Debhelper/Dh_Lib.pm line 2100, near ");"
BEGIN not safe after errors--compilation aborted at /usr/lib/perl5/vendor_perl/5.26.1/Debian/Debhelper/Dh_Lib.pm line 2885.
Compilation failed in require at /usr/bin/dh line 15.
BEGIN failed--compilation aborted at /usr/bin/dh line 15.
Comment 7 Volker Kuhlmann 2023-10-12 09:23:35 UTC
Being cheeky doesn't work either:
debhelper-13.11.5-lp155.37.1 on 15.4 gives
Perl v5.28.0 required--this is only v5.26.1, stopped at /usr/bin/dh_missing line 9.

That means alien doesn't work on 15.4. Too bad for deb packages... until 15.5 happens.
Comment 8 Jan Baier 2023-10-12 09:42:07 UTC
Interesting, so it looks like there is still 5.28 hardcoded in some scripts. I found some upstream discussion mentioning the version bump https://lists.debian.org/debian-devel/2021/05/msg00141.html

It seems that the last usable version for Leap 15.4 would be somewhere before debhelper 13.3, maybe even older. I do not think it is worth the effort to fix it now as Leap 15.5 is already here and the EOL for 15.4 is November 2023.