Bug 267586

Summary: lang/erlang-runtime25 - build fails with error in gen/wxe_wrapper_7.cpp
Product: Ports & Packages Reporter: John Parkey <john>
Component: Individual Port(s)Assignee: freebsd-erlang (Nobody) <erlang>
Status: New ---    
Severity: Affects Some People CC: david, pi, sg2342
Priority: --- Flags: bugzilla: maintainer-feedback? (erlang)
Version: Latest   
Hardware: amd64   
OS: Any   

Description John Parkey 2022-11-06 08:58:13 UTC
## FreeBSD version: 13.1-RELEASE-p3

## Output from make -C /usr/ports/lang/erlang-runtime25:

cc -shared -fPIC  -Wl,-rpath,/usr/local/lib -fstack-protector-strong  amd64-portbld-freebsd13.1/gl_nif.o amd64-portbld-freebsd13.1/glu_nif.o amd64-portbld-freebsd13.1/egl_impl.o -L/usr/local/lib -lGL -lGLU -o ../priv/amd64-portbld-freebsd13.1/erl_gl.so

gen/wxe_wrapper_7.cpp:2342:58: error: call to member function 'AddTool' is ambiguous
  wxToolBarToolBase * Result = (wxToolBarToolBase*)This->AddTool(toolId,label,*bitmap,shortHelp,kind);
                                                   ~~~~~~^~~~~~~
/usr/local/include/wx-3.2/wx/tbarbase.h:311:24: note: candidate function
    wxToolBarToolBase *AddTool(int toolid,
                       ^
/usr/local/include/wx-3.2/wx/tbarbase.h:527:24: note: candidate function
    wxToolBarToolBase *AddTool(int toolid,

                       ^
1 error generated.

## Config options for port:

_OPTIONS_READ=erlang-runtime25-25.0.2
_FILE_COMPLETE_OPTIONS_LIST=CHUNKS CORBA DTRACE JAVA KQUEUE ODBC OPENSSL SCTP SHARING WX
OPTIONS_FILE_SET+=CHUNKS
OPTIONS_FILE_SET+=CORBA
OPTIONS_FILE_SET+=DTRACE
OPTIONS_FILE_UNSET+=JAVA
OPTIONS_FILE_SET+=KQUEUE
OPTIONS_FILE_UNSET+=ODBC
OPTIONS_FILE_SET+=OPENSSL
OPTIONS_FILE_SET+=SCTP
OPTIONS_FILE_SET+=SHARING
OPTIONS_FILE_SET+=WX
Comment 1 Kurt Jaeger freebsd_committer freebsd_triage 2023-04-08 17:29:46 UTC
This happens if the port option WX is selected.
Comment 2 Stefan Grundmann 2024-06-06 15:15:45 UTC
The issue also affects lang/erlang-runtime26, lang/erlang-runtime27 and lang/erlang.

It is caused by x11-toolkits/wxgtk32 CONFIGURE_ARGS inclusion of --enable-compat28.

https://github.com/erlang/otp/pull/6023 has a fix but it will not be included in
 upstream OTP:

 "Closing this since it build if wxWidgets is compiled without -enable-compat28 which I don't think will be included/supported
in the upcoming 3.2 release."

the patch in:

https://github.com/sg2342/freebsd-erlang-runtime27-staticssl/blob/main/lang/erlang-runtime27-staticssl/files/patch-lib_wx_c_src_gen_wxe__wrapper__c.cpp 

works for lang/erlang lang/erlang-runtime25, lang/erlang-runtime26 and lang/erlang-runtime27
Comment 3 David Robertsson 2024-08-18 07:04:59 UTC
(In reply to Stefan Grundmann from comment #2)
Thank you Stefan! I ran with your patch while building the erlang-runtime26 port with WX enabled and it worked like a charm!

My system is running on 
13.3-RELEASE-p5
with wx
3.2.4

Writing to confirm and potentially helping others to find that this makes it possible run for example :observer in runtime26.