Opened 2 years ago

Closed 2 years ago

#65886 closed defect (fixed)

rbmake @1.2_8: rev-upgrade fails with: error: cannot combine with previous 'char' declaration specifier

Reported by: cooljeanius (Eric Gallager) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt)
Port: rbmake

Description

rbmake was broken by the recent icu update:

Could not open /opt/local/lib/libicudata.67.dylib: Error opening or reading file (referenced from /opt/local/bin/rbmake)
DEBUG: Marking /opt/local/bin/rbmake as broken
Could not open /opt/local/lib/libicuuc.67.dylib: Error opening or reading file (referenced from /opt/local/bin/rbmake)
DEBUG: Marking /opt/local/bin/rbmake as broken
Could not open /opt/local/lib/libicui18n.67.dylib: Error opening or reading file (referenced from /opt/local/bin/rbmake)
DEBUG: Marking /opt/local/bin/rbmake as broken

...so, rev-upgrade tries to rebuild it, but it fails with this:

In file included from rbmake.c:12:
In file included from ./rbmake/rbmake.h:13:
./rbmake/rbfile.h:79:14: error: cannot combine with previous 'char' declaration specifier
typedef char bool;
             ^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/stdbool.h:15:14: note: expanded from macro 'bool'
#define bool _Bool
             ^
In file included from rbmake.c:12:
In file included from ./rbmake/rbmake.h:13:
./rbmake/rbfile.h:79:1: warning: typedef requires a name [-Wmissing-declarations]
typedef char bool;
^~~~~~~~~~~~~~~~~
/usr/bin/clang -c -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -I. -I. -I.. -DHAVE_CONFIG_H -I/opt/local/include/libxml2  -I/opt/local/include -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 rberror.c
In file included from rbhtml.c:18:
In file included from ./rbmake/rbmake.h:13:
./rbmake/rbfile.h:79:14: error: cannot combine with previous 'char' declaration specifier
typedef char bool;
             ^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/stdbool.h:15:14: note: expanded from macro 'bool'
#define bool _Bool
             ^
In file included from rbhtml.c:18:
In file included from ./rbmake/rbmake.h:13:
./rbmake/rbfile.h:79:1: warning: typedef requires a name [-Wmissing-declarations]
typedef char bool;
^~~~~~~~~~~~~~~~~
rbfetch.c:266:1: error: conflicting types for 'RbFetch_prepareForRbContents'
RbFetch_prepareForRbContents(RbMake *rb, const char *url, bool unjoin,
^
./rbmake/rbmake.h:167:5: note: previous declaration is here
int RbFetch_prepareForRbContents(RbMake *rb, const char *url, bool unjoin,
    ^
rbfetch.c:299:1: error: conflicting types for 'RbFetch_getRbContents'
RbFetch_getRbContents(RbMake *rb, const char *url, bool unjoin)
^
./rbmake/rbmake.h:169:6: note: previous declaration is here
void RbFetch_getRbContents(RbMake *rb, const char *url, bool unjoin);
     ^
2 errors generated.
1 warning and 1 error generated.
make[1]: *** [rbfetch.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [rbmake.o] Error 1
rbpage.c:558:1: error: conflicting types for 'RbPage_getConvertImage'
RbPage_getConvertImage(RbPage *me)
^
./rbmake/rbmake.h:141:6: note: previous declaration is here
bool RbPage_getConvertImage(RbPage *me);
     ^
rbpage.c:564:1: error: conflicting types for 'RbPage_getParsePage'
RbPage_getParsePage(RbPage *me)
^
./rbmake/rbmake.h:142:6: note: previous declaration is here
bool RbPage_getParsePage(RbPage *me);
     ^
rbpage.c:582:1: error: conflicting types for 'RbPage_setConvertImage'
RbPage_setConvertImage(RbPage *me, bool trueOrFalse)
^
./rbmake/rbmake.h:146:6: note: previous declaration is here
void RbPage_setConvertImage(RbPage *me, bool trueOrFalse);
     ^
rbpage.c:588:1: error: conflicting types for 'RbPage_setParsePage'
RbPage_setParsePage(RbPage *me, bool trueOrFalse)
^
./rbmake/rbmake.h:147:6: note: previous declaration is here
void RbPage_setParsePage(RbPage *me, bool trueOrFalse);
     ^
rbpage.c:594:1: error: conflicting types for 'RbPage_usedHidxName'
RbPage_usedHidxName(RbPage *me, const char *name, bool used)
^
./rbmake/rbmake.h:132:15: note: previous declaration is here
HtmlPosition *RbPage_usedHidxName(RbPage *me, const char *name, bool used);
              ^
5 errors generated.
make[1]: *** [rbpage.o] Error 1
1 warning and 1 error generated.
make[1]: *** [rbhtml.o] Error 1
In file included from rburls2.c:10:
In file included from ./rbmake/rbmake.h:13:
./rbmake/rbfile.h:79:14: error: cannot combine with previous 'char' declaration specifier
typedef char bool;
             ^
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/stdbool.h:15:14: note: expanded from macro 'bool'
#define bool _Bool
             ^
In file included from rburls2.c:10:
In file included from ./rbmake/rbmake.h:13:
./rbmake/rbfile.h:79:1: warning: typedef requires a name [-Wmissing-declarations]
typedef char bool;
^~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
make[1]: *** [rburls2.o] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_rbmake/rbmake/work/rbmake-1.2/doc'
1 warning generated.
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_rbmake/rbmake/work/rbmake-1.2/lib'
make: *** [libCHECK] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_rbmake/rbmake/work/rbmake-1.2'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_rbmake/rbmake/work/rbmake-1.2" && /usr/bin/make -j16 -w all 
Exit code: 2
Warning: The following existing files were hidden from the build system by trace mode:
  /opt/local/bin/pod2man
  /opt/local/include/rbmake/rbfile.h
  /opt/local/include/rbmake/rbmake.h
  /private/var/select/sh

Note that I'm using trace mode since previously it was using the pre-installed rbmake/rbmake.h header, so I wanted to make sure that that wasn't the issue. I'm on Big Sur with Xcode 13.

Attachments (1)

rbmake_main.log (63.9 KB) - added by cooljeanius (Eric Gallager) 2 years ago.
main.log for rbmake

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by cooljeanius (Eric Gallager)

Attachment: rbmake_main.log added

main.log for rbmake

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added

rbmake doesn't use icu, but it uses libxml2 which does, and it uses xml2-config --libs, which causes it to overlink with libxml2's dependencies. It should use xml2-config --libs --dynamic to avoid that.

I see it also opportunistically uses libwww if present, and in that case it overlinks to libwww's libraries, and libwww's libwww-config doesn't offer a --dynamic flag or a pkg-config file to avoid that. Probably simplest to disable rbmake's use of libwww. I'm looking into how to do that now.

I don't see the bool-redefinition-related build failure on my Catalina system but I'll see what I can do about that as well. We had successful builds of this port on the buildbot on all systems last time we tried but it's been awhile.

I'll also see what I can do about the incorrect header search order.

Version 0, edited 2 years ago by ryandesign (Ryan Carsten Schmidt) (next)

comment:2 in reply to:  1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

I don't see the bool-redefinition-related build failure on my Catalina system but I'll see what I can do about that as well.

I was able to reproduce it on Monterey. For whatever reason, on these new systems, the system headers now cause the C99 <stdbool.h> header to be included, which defines bool, true, and false. rbmake's rbfile.h checks whether true and false are defined before defining them, and provides way to prevent them from being defined even if they aren't already, but defines bool unconditionally, hence the clash.

I opted to fix it by ripping the custom bool/true/false out of rbmake's rbfile.h and making it use <stdbool.h> instead, which requires that rbmake and any other project that uses its header be compiled with at least -std=c99 now. I figured it was ok in 2022 to require at least the 1999 C standard. There are no ports in MacPorts that depend on rbmake that would need to be updated.

comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

In 8313553163ee45a33975a8f1c0c1b34301fa71ac/macports-ports (master):

rbmake: Avoid using libwww opportunistically

See: #65886#comment:1

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

In 22d685b63084dcde07f2ab58c8101bddc359ab84/macports-ports (master):

rbmake: Avoid overlinking with libxml2's deps

See: #65886#comment:1

comment:5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

In 6d414217d285b0dfa05df1041912f881bf3199b9/macports-ports (master):

rbmake: Fix header include order

See: #65886

comment:6 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 41ac4929947e38053215d57474bb6085a52f3b2b/macports-ports (master):

rbmake: Use stdbool.h rather than defining our own

Closes: #65886

Note: See TracTickets for help on using tickets.