Bug 226241

Summary: lang/erlang-wx: can not link the wx driver, wx will NOT be useable
Product: Ports & Packages Reporter: Dave Cottlehuber <dch>
Component: Individual Port(s)Assignee: Dave Cottlehuber <dch>
Status: Closed FIXED    
Severity: Affects Some People CC: olgeni
Priority: --- Flags: bugzilla: maintainer-feedback? (olgeni)
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://bugs.erlang.org/browse/ERL-590
Attachments:
Description Flags
poudriere log on 12.0-CURRENT
none
configure log from in-tree make
none
require LLVM50 compiler so that wx detection works again
none
extracted from changes in `./otp_build autoconf` in $ERL_TOP none

Description Dave Cottlehuber freebsd_committer freebsd_triage 2018-02-27 13:34:34 UTC
This seems to be an issue for lang/erlang-wx as well as lang/erlang-runtime* when WX option is enabled.

The required headers *are* present but perhaps no longer where the build expect them:

/usr/local/include/wx-3.0/wx/stc/stc.h
/usr/local/include/wx-2.8/wx/stc/stc.h



# poudriere configure

if you are using XFree86, and /etc/X11/xorg.conf if you are using X.Org.
===>   erlang-wx-19.3.6.5,1 depends on shared library: libwx_baseu-2.8.so - found (/usr/local/lib/libwx_baseu-2.8.so)
===>   Returning to build of erlang-wx-19.3.6.5,1
===>   erlang-wx-19.3.6.5,1 depends on shared library: libwx_gtk2u_fl-2.8.so - not found
===>   Installing existing package /packages/All/wx28-gtk2-contrib-2.8.12_7.txz
[pkg.skunkwerks.at] Installing wx28-gtk2-contrib-2.8.12_7...
[pkg.skunkwerks.at] `-- Installing wx28-gtk2-contrib-common-2.8.12_7...
[pkg.skunkwerks.at] `-- Extracting wx28-gtk2-contrib-common-2.8.12_7: .......... done
[pkg.skunkwerks.at] Extracting wx28-gtk2-contrib-2.8.12_7: .......... done
===>   erlang-wx-19.3.6.5,1 depends on shared library: libwx_gtk2u_fl-2.8.so - found (/usr/local/lib/libwx_gtk2u_fl-2.8.so)
===>   Returning to build of erlang-wx-19.3.6.5,1
===========================================================================

...


checking for GL/glu.h... yes
/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/./configure: wx-config: not found
checking for debug build of wxWidgets... checking for wx-config... /usr/local/bin/wxgtk2u-2.8-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=yes)... no
checking for standard build of wxWidgets... checking for wx-config... /usr/local/bin/wxgtk2u-2.8-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=no)... yes (version 2.8.12)
checking for wxWidgets static library... no
checking if wxwidgets have opengl support... no
checking for GLintptr... yes
checking for GLintptrARB... yes
checking for GLchar... yes
checking for GLcharARB... yes
checking for GLhalfARB... yes
checking for GLint64EXT... yes
checking GLU Callbacks uses Tiger Style... no
checking for wx/stc/stc.h... no
configure: WARNING: Can not find wx/stc/stc.h  -g -Wall -O2 -fPIC -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -Wno-deprecated-declarations -fomit-frame-pointer -fno-strict-aliasing -isystem /usr/local/include  -D_GNU_SOURCE -D_THREAD_SAFE -D_REENTRANT -I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -D_THREAD_SAFE
checking if we can link wxwidgets programs... no
configure: WARNING: Can not link wx program are all developer packages installed?

wx             : Can not link the wx driver, wx will NOT be useable



# poudriere build

*********************************************************************
===>  Building for erlang-wx-19.3.6.5,1
cd /tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx && gmake ERL_TOP=/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3 TARGET=amd64-portbld-freebsd12.0
gmake[1]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx'
=== Entering application wx
gmake[2]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/src'
gmake[2]: Nothing to be done for 'opt'.
gmake[2]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/src'
gmake[2]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples'
gmake[3]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/demo'
gmake[3]: Nothing to be done for 'opt'.
gmake[3]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/demo'
gmake[3]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/sudoku'
gmake[3]: Nothing to be done for 'opt'.
gmake[3]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/sudoku'
gmake[3]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/simple'
gmake[3]: Nothing to be done for 'opt'.
gmake[3]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/simple'
gmake[3]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/xrc'
gmake[3]: Nothing to be done for 'opt'.
gmake[3]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples/xrc'
gmake[2]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/examples'
gmake[2]: Entering directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/doc/src'
gmake[2]: Nothing to be done for 'opt'.
gmake[2]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/doc/src'
=== Leaving application wx
gmake[1]: Leaving directory '/tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx'
/usr/bin/strip /tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/priv/amd64-portbld-freebsd12.0/erl_gl.so
strip: open /tmp/usr/ports/lang/erlang-wx/work/otp_src_19.3/lib/wx/priv/amd64-portbld-freebsd12.0/erl_gl.so failed: No such file or directory
*** Error code 1

Stop.
Comment 1 Dave Cottlehuber freebsd_committer freebsd_triage 2018-02-27 13:39:30 UTC
Created attachment 191052 [details]
poudriere log on 12.0-CURRENT
Comment 2 Dave Cottlehuber freebsd_committer freebsd_triage 2018-02-27 15:09:02 UTC
Created attachment 191055 [details]
configure log from in-tree make

with help from zi@ we see some interesting things in config.log. It's not failing
to find the header, its failing on compiling due to a clash between who defines exit:

configure:6661: checking for wx/stc/stc.h
configure:6680: c++ -c  -g -Wall -O2 -fPIC -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -Wno-deprecated-declarations -fomit-frame-pointer -fno-strict-aliasing -isystem /usr/local/include  -D_GNU_SOURCE -D_THREAD_SAFE -D_REENTRANT -I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -D_THREAD_SAFE -isystem /usr/local/include  -D_GNU_SOURCE -D_THREAD_SAFE -D_REENTRANT conftest.cc >&5
In file included from conftest.cc:34:
In file included from /usr/local/include/wx-2.8/wx/wx.h:16:
In file included from /usr/local/include/wx-2.8/wx/object.h:20:
In file included from /usr/local/include/wx-2.8/wx/memory.h:16:
In file included from /usr/local/include/wx-2.8/wx/string.h:43:
In file included from /usr/include/c++/v1/stdlib.h:94:
/usr/include/stdlib.h:97:1: error: function declared '[[noreturn]]' after its first declaration
_Noreturn void   exit(int);
^
/usr/include/sys/cdefs.h:280:22: note: expanded from macro '_Noreturn'
#define _Noreturn               [[noreturn]]
                                  ^
conftest.cc:9:6: note: declaration missing '[[noreturn]]' attribute is here
void exit (int);
     ^
In file included from conftest.cc:34:
In file included from /usr/local/include/wx-2.8/wx/wx.h:16:
In file included from /usr/local/include/wx-2.8/wx/object.h:20:
In file included from /usr/local/include/wx-2.8/wx/memory.h:16:
In file included from /usr/local/include/wx-2.8/wx/string.h:43:
In file included from /usr/include/c++/v1/stdlib.h:94:
/usr/include/stdlib.h:97:17: error: declaration of 'exit' has a different language linkage
_Noreturn void   exit(int);
                 ^
conftest.cc:9:6: note: previous declaration is here
void exit (int);
     ^
2 errors generated.
configure:6686: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #ifdef __cplusplus
| void exit (int);
| #endif
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define SIZEOF_VOID_P 8
| #define HAVE_GL_GL_H 1
| #define HAVE_GL_GLU_H 1
| #define HAVE_GLINTPTR 1
| #define HAVE_GLINTPTRARB 1
| #define HAVE_GLCHAR 1
| #define HAVE_GLCHARARB 1
| #define HAVE_GLHALFARB 1
| #define HAVE_GLINT64EXT 1
| /* end confdefs.h.  */
| #ifdef WIN32
|        # include <windows.h>
|          #endif
|          #include "wx/wx.h"
| 
| #include <wx/stc/stc.h>
configure:6710: result: no
configure:6720: WARNING: Can not find wx/stc/stc.h  -g -Wall -O2 -fPIC -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -Wno-deprecated-declarations -fomit-frame-pointer -fno-strict-aliasing -isystem /usr/local/include  -D_GNU_SOURCE -D_THREAD_SAFE -D_REENTRANT -I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -D_THREAD_SAFE


which clashes with that already defined in /usr/include/stdlib.h
Comment 3 Dave Cottlehuber freebsd_committer freebsd_triage 2018-03-20 23:00:30 UTC
reported upstream as https://bugs.erlang.org/browse/ERL-590
Comment 4 Dave Cottlehuber freebsd_committer freebsd_triage 2018-03-21 09:17:08 UTC
Progress - either use:

1. use devel/llvm50 to compile against
2. regenerate the otp build tools which gives a newer check for wx that doesn't fail. I've asked the OTP team if that's something they need to do in next release, or us.

diffs attached for both sets of changes. 

olgeni: can you let me know which is preferred from your end, and I'll submit patches for all the lang/erlang-* ports in phab to fix this.
Comment 5 Dave Cottlehuber freebsd_committer freebsd_triage 2018-03-21 09:18:23 UTC
Created attachment 191691 [details]
require LLVM50 compiler so that wx detection works again
Comment 6 Dave Cottlehuber freebsd_committer freebsd_triage 2018-03-21 10:25:56 UTC
Created attachment 191697 [details]
extracted from changes in `./otp_build autoconf` in $ERL_TOP

alternative to locking compiler version to LLVM50. Upstream will probably update their autoconf version in their build system at least for OTP 21 and higher.
Comment 7 Jimmy Olgeni freebsd_committer freebsd_triage 2018-04-07 11:38:37 UTC
(In reply to Dave Cottlehuber from comment #6)

I think changing 'configure' would be the easiest way (and less build-intensive).

Looking into it...
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-04-10 13:15:16 UTC
A commit references this bug:

Author: olgeni
Date: Tue Apr 10 13:14:43 UTC 2018
New revision: 466962
URL: https://svnweb.freebsd.org/changeset/ports/466962

Log:
  lang/erlang{,-wx,-runtime19,-runtime20}: regenerate the
  'configure' script for WX so that it doesn't fail on 12.x.

  PR:		226241
  Submitted by:	dch

Changes:
  head/lang/erlang/files/patch-lib_wx_configure
  head/lang/erlang-runtime19/files/patch-lib_wx_configure
  head/lang/erlang-runtime20/files/patch-lib_wx_configure
  head/lang/erlang-wx/files/patch-lib_wx_configure
Comment 9 Dave Cottlehuber freebsd_committer freebsd_triage 2018-04-14 20:49:34 UTC
thanks olgeni works for me.