Opened 2 years ago

Closed 15 months ago

#65525 closed defect (fixed)

grpc fails on 10.6.8: error: missing binary operator before token "("

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc:
Port: grpc

Description

In file included from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_grpc/grpc/work/grpc-1.42.0/include/grpc/support/port_platform.h:22,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_grpc/grpc/work/grpc-1.42.0/src/core/lib/gpr/alloc.cc:19:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_grpc/grpc/work/grpc-1.42.0/include/grpc/impl/codegen/port_platform.h:237:46: error: missing binary operator before token "("
  237 | #if !(defined(__has_feature) && __has_feature(cxx_thread_local))
      |                                              ^
In file included from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_grpc/grpc/work/grpc-1.42.0/include/grpc/support/port_platform.h:22,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_grpc/grpc/work/grpc-1.42.0/src/core/lib/gpr/atm.cc:19:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_grpc/grpc/work/grpc-1.42.0/include/grpc/impl/codegen/port_platform.h:237:46: error: missing binary operator before token "("
  237 | #if !(defined(__has_feature) && __has_feature(cxx_thread_local))
      |                                              ^
make[2]: *** [CMakeFiles/gpr.dir/src/core/lib/gpr/atm.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/gpr.dir/src/core/lib/gpr/alloc.cc.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_grpc/grpc/work/build'
make[1]: *** [CMakeFiles/gpr.dir/all] Error 2
  1. S. I was thinking to update the port, so perhaps let me check if the current version also fails.

Change History (6)

comment:1 Changed 2 years ago by jmroot (Joshua Root)

Keywords: snowleopard removed
Port: grpc added; gprc removed
Summary: gprc fails on 10.6.8: error: missing binary operator before token "("grpc fails on 10.6.8: error: missing binary operator before token "("

This is a genuine bug and is still present in upstream master. You can't use __has_feature in the same expression that checks whether it's defined. (The check for __has_include in the same file is done correctly.)

The code in question should look like this:

#if defined(__has_feature)
#if __has_feature(cxx_thread_local)
#define GPR_PTHREAD_TLS 1
#endif
#endif

comment:2 Changed 2 years ago by jmroot (Joshua Root)

comment:3 in reply to:  1 Changed 2 years ago by barracuda156

Replying to jmroot:

This is a genuine bug and is still present in upstream master. You can't use __has_feature in the same expression that checks whether it's defined. (The check for __has_include in the same file is done correctly.)

The code in question should look like this:

#if defined(__has_feature)
#if __has_feature(cxx_thread_local)
#define GPR_PTHREAD_TLS 1
#endif
#endif

Thank you! Should we submit a fix to the upstream?

  1. S. Sorry for misspelling, gpr.dir confused me.

comment:4 Changed 2 years ago by barracuda156

UPD. Okay, someone already submitted the PR for the port update: https://github.com/macports/macports-ports/pull/15458

comment:5 Changed 15 months ago by barracuda156

We still have this broken in the master:

/opt/local/bin/g++-mp-12 -Dgrpc_plugin_support_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/third_party/address_sorting/include -I/opt/local/libexec/openssl3/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/src/core/ext/upb-generated -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/src/core/ext/upbdefs-generated -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/third_party/upb -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/third_party/xxhash -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/build/gens -isystem /opt/local/include -pipe -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0  -std=c++14 -arch ppc -mmacosx-version-min=10.6 -fPIC -MD -MT CMakeFiles/grpc_plugin_support.dir/src/compiler/cpp_generator.cc.o -MF CMakeFiles/grpc_plugin_support.dir/src/compiler/cpp_generator.cc.o.d -o CMakeFiles/grpc_plugin_support.dir/src/compiler/cpp_generator.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/src/compiler/cpp_generator.cc
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/include/grpc/support/port_platform.h:22,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/src/core/lib/gpr/alloc.cc:19:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/include/grpc/impl/codegen/port_platform.h:245:46: error: missing binary operator before token "("
  245 | #if !(defined(__has_feature) && __has_feature(cxx_thread_local))
      |                                              ^
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/include/grpc/support/port_platform.h:22,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/src/core/lib/gpr/cpu_iphone.cc:19:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/include/grpc/impl/codegen/port_platform.h:245:46: error: missing binary operator before token "("
  245 | #if !(defined(__has_feature) && __has_feature(cxx_thread_local))
      |                                              ^
make[2]: *** [CMakeFiles/gpr.dir/src/core/lib/gpr/cpu_iphone.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/include/grpc/support/port_platform.h:22,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/src/core/lib/gpr/atm.cc:19:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/grpc-1.48.0/include/grpc/impl/codegen/port_platform.h:245:46: error: missing binary operator before token "("
  245 | #if !(defined(__has_feature) && __has_feature(cxx_thread_local))
      |                                              ^
make[2]: *** [CMakeFiles/gpr.dir/src/core/lib/gpr/alloc.cc.o] Error 1
make[2]: *** [CMakeFiles/gpr.dir/src/core/lib/gpr/atm.cc.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_grpc/grpc/work/build'
make[1]: *** [CMakeFiles/gpr.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Last edited 15 months ago by barracuda156 (previous) (diff)

comment:6 Changed 15 months ago by barracuda156

Owner: set to barracuda156
Resolution: fixed
Status: newclosed

In f206094f8d8676d28452395be44e05f41f716d43/macports-ports (master):

grpc: update to 1.48.4, unbreak build

Closes: #65525

Note: See TracTickets for help on using tickets.