Opened 7 years ago

Closed 7 years ago

#54466 closed defect (fixed)

gindent @2.2.11: build fails

Reported by: mndavidoff (Monte Davidoff) Owned by: larryv (Lawrence Velázquez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: posita (Matt Bogosian), skymoo (Adam Mercer), Kevin-Gardner, Zweihorn (@Zweihorn), gallafent
Port: gindent

Description

I get this error when trying to install gindent:

$ sudo port -vs install gindent
...
/usr/bin/clang -DHAVE_CONFIG_H -DLOCALEDIR=\"/opt/local/share/locale\" -I. -I.. -I. -I. -I../intl  -I/opt/local/include -I. -pipe -Os -arch x86_64 -MT code_io.o -MD -MP -MF .deps/code_io.Tpo -c -o code_io.o code_io.c
In file included from lexi.c:206:
./gperf.c:94:1: error: conflicting types for 'is_reserved'
is_reserved (register const char *str, register size_t len)
^
lexi.c:204:11: note: previous declaration is here
templ_ty *is_reserved (const char *str, unsigned int len);
          ^
In file included from lexi.c:220:
./gperf-cc.c:95:1: error: conflicting types for 'is_reserved_cc'
is_reserved_cc (register const char *str, register size_t len)
^
lexi.c:218:11: note: previous declaration is here
templ_ty *is_reserved_cc (register const char *str, register unsigned int len);
          ^
2 errors generated.
make[3]: *** [lexi.o] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/globs.Tpo .deps/globs.Po
mv -f .deps/code_io.Tpo .deps/code_io.Po
mv -f .deps/parse.Tpo .deps/parse.Po
mv -f .deps/backup.Tpo .deps/backup.Po
mv -f .deps/args.Tpo .deps/args.Po
mv -f .deps/comments.Tpo .deps/comments.Po
mv -f .deps/indent.Tpo .deps/indent.Po
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gindent/gindent/work/indent-2.2.11/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gindent/gindent/work/indent-2.2.11/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gindent/gindent/work/indent-2.2.11'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gindent/gindent/work/indent-2.2.11'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gindent/gindent/work/indent-2.2.11" && /usr/bin/make -j8 -w all 
Exit code: 2
Error: Failed to build gindent: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gindent/gindent/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port gindent failed

Attachments (1)

main.log.gz (4.7 KB) - added by mndavidoff (Monte Davidoff) 7 years ago.

Download all attachments as: .zip

Change History (16)

Changed 7 years ago by mndavidoff (Monte Davidoff)

Attachment: main.log.gz added

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Cc: larryv@… removed
Owner: set to larryv
Status: newassigned

comment:2 Changed 7 years ago by posita (Matt Bogosian)

Cc: posita added

comment:3 Changed 7 years ago by posita (Matt Bogosian)

I'm seeing this on 10.12.5. What's interesting is that older versions seem to suffer from the same problem. (I even tried going back to before the rename from indent to gindent, but saw a similar error.)

comment:4 Changed 7 years ago by mndavidoff (Monte Davidoff)

I previously had gindent @2.2.11_0 installed, then uninstalled it, and now tried to install it again. Since gindent didn't change, perhaps some dependency changed and broke gindent. Sure enough, there was a recent upgrade from gperf @3.0.4_2 to gperf @3.1_0. (Note the mention of gperf in the gindent error messages.) I reverted back to gperf @3.0.4_2, and gindent @2.2.11_0 built and installed successfully. It appears the recent upgrade to gperf @3.1_0 broke gindent.

comment:5 Changed 7 years ago by posita (Matt Bogosian)

I can verify that installing the immediately prior version of gperf allows gindent to build again without issue. Should this be recharacterized as a gperf issue?

comment:6 Changed 7 years ago by skymoo (Adam Mercer)

Cc: skymoo added

comment:7 Changed 7 years ago by Kevin-Gardner

Cc: Kevin-Gardner added

comment:8 Changed 7 years ago by kencu (Ken)

Thanks for the fix - downgrading gperf, building gindent, and then upgrading gperf again worked beautifully.

comment:9 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Here is another project's bug report about gperf 3.1 incompatibility. Maybe we can adapt their solution to fix gindent? Larry, do you want to work on that or should I? I am interested in getting this fixed this because it prevents building wine.

We should report the problem to the bug-indent mailing list but it doesn't seem to have a lot of traffic and maybe the developers aren't reading it anymore.

comment:10 Changed 7 years ago by Zweihorn (@Zweihorn)

I confirm this error and I am seeing this on macOS 10.12.6 with XCode 8.3.3 and MacPorts 2.4.1 while aiming for developing a newly formed forked-daapd port.

Thanks for the fix and I will try the workaround procedure of downgrading gperf, building gindent, and then upgrading gperf again too. However, without a prior install of gperf I will have to follow the more cumbersome procedure as detailed by the MacPorts Wiki: How to install an older version of a port, I presume.

comment:11 Changed 7 years ago by Zweihorn (@Zweihorn)

Cc: Zweihorn added

comment:12 Changed 7 years ago by gnw3

The problem is that lexi.c has two prototypes copied from files generated using gperf. Linux distros have forked gindent to fix bugs and upstream hasn't been active for a long time. gperf is partly to blame for not providing more easily maintained interfaces, but if you don't make your own dogfood you eat what you get.

A workaround is to start the build, and when it fails, run sudo -u macports vi $(port dir gindent)/work/indent*/src/lexi.c to replace unsigned int with size_t in the two problem lines. Atfer that the build and install should work.

comment:13 Changed 7 years ago by fredowski

Based on the idea from gnw3 I have written a patch that changes lexi.c. The pull request is here:

https://github.com/macports/macports-ports/pull/714

I tested the patch on MacOS 10.11.6 in a clean install. gindent then builds without failure.

comment:14 Changed 7 years ago by gallafent

Cc: gallafent added

comment:15 Changed 7 years ago by fredowski

Resolution: fixed
Status: assignedclosed

In d53ad74a8a92a5c11dc72487c009d0129df4e18d/macports-ports:

gindent: Fix build failure due to type mismatch vs. gperf 3.1

Closes: #54466

gindent failed to build with new type definitions in gperf 3.1.
This patch changes the type information in gindent such that
it compiles also versus gperf 3.1.

Note: See TracTickets for help on using tickets.