#67019 closed defect (fixed)

rogue @5.4.4_3: error: incomplete definition of type 'struct term'

Reported by: ShadSterling (Shad Sterling) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: ventura Cc:
Port: rogue

Description

This looks like the same problem as #54171, even though the log shows patch-mdport.c.diff is applied. The version still shows @5.4.4_3, the same as in #54171; I would have expected it to have advanced with the fix. The only apparent difference is the line numbers

--->  Computing dependencies for rogue
--->  Fetching archive for rogue
--->  Attempting to fetch rogue-5.4.4_3.darwin_22.x86_64.tbz2 from https://packages.macports.org/rogue
--->  Attempting to fetch rogue-5.4.4_3.darwin_22.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/rogue
--->  Attempting to fetch rogue-5.4.4_3.darwin_22.x86_64.tbz2 from http://mirror.fcix.net/macports/packages/rogue
--->  Fetching distfiles for rogue
--->  Verifying checksums for rogue
--->  Extracting rogue
--->  Applying patches to rogue
--->  Configuring rogue
--->  Building rogue                                     
Error: Failed to build rogue: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_games_rogue/rogue/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port rogue failed
:info:build mdport.c:265:17: error: incomplete definition of type 'struct term'
:info:build     if (cur_term->type.Strings == NULL)
:info:build         ~~~~~~~~^
:info:build /opt/local/include/term.h:718:1: note: forward declaration of 'struct term'
:info:build TERMINAL;
:info:build ^
:info:build /opt/local/include/term.h:717:25: note: expanded from macro 'TERMINAL'
:info:build #define TERMINAL struct term
:info:build                         ^
:info:build 1 error generated.

Attachments (1)

main.log (27.6 KB) - added by ShadSterling (Shad Sterling) 21 months ago.

Download all attachments as: .zip

Change History (4)

Changed 21 months ago by ShadSterling (Shad Sterling)

Attachment: main.log added

comment:1 in reply to:  description Changed 21 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to ShadSterling:

The version still shows @5.4.4_3, the same as in #54171; I would have expected it to have advanced with the fix.

There's no reason to increase a port's revision when one is only fixing a build failure.

comment:2 Changed 21 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign removed
Owner: set to ryandesign
Status: newaccepted

rogue is an ancient game having been first developed in the 1980s. Version 5.4.4 was released in 2007.

The problem in #54171 was that the ncurses port was updated from version 6.0 (with which rogue worked) to a 2017 snapshot of a development version of ncurses (with which rogue didn't work anymore). The ncurses developers decided to make a structure private which had previously been (inadvertently?) public and which rogue was using:

Quoting https://invisible-island.net/ncurses/NEWS.html#index-t20170318:

change TERMINAL structure in term.h to make it opaque

The way we fixed it at the time was to #define NCURSES_INTERNALS which told ncurses to reveal the fields of this structure again, but that was bound to be a fragile fix. There's a long discussion about this (and another method that rewrote the code to avoid using the internal struct) here: https://forums.gentoo.org/viewtopic-t-1100154-start-0.html

Today, we have ncurses 6.4 in MacPorts, with which you've discovered rogue again doesn't work. We also show build failures of rogue on our buildbot machines back to November 2021 at which time we had ncurses 6.3. It appears that now, defining NCURSES_INTERNALS is what causes the problem; removing the previously-added patch so that NCURSES_INTERNALS is no longer defined allows the build to succeed. It looks like the developers of ncurses now consider the first field of the struct (which is what rogue is using) to be public and the other fields to be private.

I suspect it was caused by https://invisible-island.net/ncurses/NEWS.html#t20210821:

move internals of TERMINAL structure to new header term.priv.h

In that commit, this comment was added to (the script that generates) the term.h header:

* The first field in TERMINAL is used in macros.
* The remaining fields are private.

comment:3 Changed 21 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 047bed86a1369d93b7e3ac1beb227d16a11b8736/macports-ports (master):

rogue: No longer set NCURSES_INTERNALS

This reverts commit dbfaf022b24353c2d1254eee6c961273efc7d0ba.

Closes: #67019

Note: See TracTickets for help on using tickets.