Bug 2261448

Summary: perl-Curses: FTBFS in Fedora rawhide/f40
Product: [Fedora] Fedora Reporter: Fedora Release Engineering <releng>
Component: perl-CursesAssignee: Steve Traylen <steve.traylen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: perl-devel, ppisar, steve.traylen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-Curses-1.44-7.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-04-25 09:54:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2276620    
Bug Blocks: 2231791    
Attachments:
Description Flags
build.log
none
root.log
none
state.log none

Description Fedora Release Engineering 2024-01-29 21:11:56 UTC
perl-Curses failed to build from source in Fedora rawhide/f40

https://koji.fedoraproject.org/koji/taskinfo?taskID=112344005


For details on the mass rebuild see:

https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
Please fix perl-Curses at your earliest convenience and set the bug's status to
ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks,
perl-Curses will be orphaned. Before branching of Fedora 41,
perl-Curses will be retired, if it still fails to build.

For more details on the FTBFS policy, please visit:
https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/

Comment 1 Fedora Release Engineering 2024-01-29 21:12:02 UTC
Created attachment 2012847 [details]
build.log

file build.log too big, will only attach last 32768 bytes

Comment 2 Fedora Release Engineering 2024-01-29 21:12:08 UTC
Created attachment 2012848 [details]
root.log

file root.log too big, will only attach last 32768 bytes

Comment 3 Fedora Release Engineering 2024-01-29 21:12:11 UTC
Created attachment 2012849 [details]
state.log

Comment 4 Steve Traylen 2024-02-15 19:19:01 UTC
Don't understand...

mock -r fedora-rawhide-x86_64 --install bash

...

Running transaction
Importing PGP key 0xA15B79CC:
 Userid     : "Fedora (40) <fedora-40-primary>"
 Fingerprint: 115DF9AEF857853EE8445D0A0727707EA15B79CC
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-40-primary
The key was successfully imported.
Importing PGP key 0xA15B79CC:
 Userid     : "Fedora (40) <fedora-40-primary>"
 Fingerprint: 115DF9AEF857853EE8445D0A0727707EA15B79CC
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-40-primary
The key was successfully imported.
Importing PGP key 0x18B8E74C:
 Userid     : "Fedora (39) <fedora-39-primary>"
 Fingerprint: E8F23996F23218640CB44CBE75CF5AC418B8E74C
 From       : file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-39-primary
The key was successfully imported.

Transaction failed: Signature verification failed.
PGP check for package "tar-2:1.35-3.fc40.x86_64" (/var/lib/mock/dnf5-test/root/var/cache/dnf/fedora-2d95c80a1fa0a67d/packages/tar-1.35-3.fc40.x86_64.rpm) from repo "fedora" has failed: Import of the key didn't help, wrong key?

Comment 5 Steve Traylen 2024-02-15 19:31:22 UTC
Hmm i686 build fails only:

https://koji.fedoraproject.org/koji/taskinfo?taskID=113554205

Comment 6 Petr Pisar 2024-02-16 10:49:49 UTC
(In reply to Steve Traylen from comment #4)
> Don't understand...
> 
> mock -r fedora-rawhide-x86_64 --install bash
[...] 
> Transaction failed: Signature verification failed.
> PGP check for package "tar-2:1.35-3.fc40.x86_64"
> (/var/lib/mock/dnf5-test/root/var/cache/dnf/fedora-2d95c80a1fa0a67d/packages/
> tar-1.35-3.fc40.x86_64.rpm) from repo "fedora" has failed: Import of the key
> didn't help, wrong key?

See <https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/WXR6T3BITNIPT2XGIR6DPIDOTCG4VGER/#R5Q6SPDE72Q5FMXTVLQJLQJEBRO57GPB>.

Comment 7 Steve Traylen 2024-04-23 10:43:46 UTC
Still only i686 build fails https://koji.fedoraproject.org/koji/taskinfo?taskID=116767277

CursesFunWide.c: In function ‘XS_CURSES_addstring’:
CursesFunWide.c:117:26: error: passing argument 2 of ‘waddnwstr’ from incompatible pointer type [-Wincompatible-pointer-types]
  117 |     ret = waddnwstr(win, wstr, len);
      |                          ^~~~
      |                          |
      |                          wint_t * {aka unsigned int *}
In file included from c-config.h:7,
                 from Curses.c:18:

https://koji.fedoraproject.org/koji/taskinfo?taskID=116767277

Comment 8 Petr Pisar 2024-04-23 13:52:52 UTC
First error reported in the build.log is:

In file included from Curses.c:434:
CursesWide.c: In function ‘c_wstr2sv’:
CursesWide.c:84:15: error: assignment to ‘wint_t *’ {aka ‘unsigned int *’} from incompatible pointer type ‘wchar_t *’ {aka ‘long int *’} [-Wincompatible-pointer-types]
   84 |     for (ws_p = ws; *ws_p; ws_p++) {
      |               ^

The variables are declared like this:

static void
c_wstr2sv(SV *      const sv,
          wchar_t * const ws) {
/*----------------------------------------------------------------------------
  Set SV to a Perl string holding a given wide string
-----------------------------------------------------------------------------*/
    wint_t *ws_p;
    int need_utf8 = 0;
    size_t ws_len = wcslen(ws);

and used like this (the line from the error message):

    for (ws_p = ws; *ws_p; ws_p++) {

C17 standard in 7.29.1 section defines that wint_t is an integer which can hold any value of the extended character set (i.e. wchar_t) and at least one value which is not representable in the extended character set (i.e. WEOF). That means that size of wint_t cannot be less than size of wchar_t. Here on i686 "unsigned int" unsigned 32-bit and "long int" is signed 32-bit. While the conversion of the extended character value could be preserved (e.g. the extended charcter set ranges from 0 to 2^21), reinterpreting a wchar_t by a dereferencing a pointer to a wint_t could mangle the sign because the compiler thinks that the type have a different rank.

Either it's a bug in GCC, or something incorrectly redigined the types, or it works as intended and one only need to explicitly cast "ws_p = (wint_t*)ws". I would the have dig deeper.

Comment 9 Fedora Update System 2024-04-25 09:51:45 UTC
FEDORA-2024-1e7e19e4d4 (perl-Curses-1.44-7.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-1e7e19e4d4

Comment 10 Fedora Update System 2024-04-25 09:54:20 UTC
FEDORA-2024-1e7e19e4d4 (perl-Curses-1.44-7.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.