Regression in 2.9.5 source build

There’s a regression in the build process. Because wxWebView requires a version of webkit-gtk not available for any release of RHEL, it can’t be built. In 2.9.4, it would be disabled during configure and skipped over when building. In 2.9.5, configure correctly detects the system can’t support it:

checking for WEBKIT… configure: WARNING: webkitgtk not found.

configure: WARNING: WebKit not available, disabling wxWebView

checking for CAIRO… yes

checking for cairo_push_group… yes

checking for GST… yes

But then it goes off and tries compiling it anyways:

building ‘_html2’ extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -DSWIG_TYPE_TABLE=wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK_ -Iinclude -Isrc -I/builddir/build/BUILD/wxPython-src-2.9.5.0/bld/lib/wx/include/gtk2-unicode-2.9 -I/builddir/build/BUILD/wxPython-src-2.9.5.0/include -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/goes/include/python2.7 -c src/gtk/html2_wrap.cpp -o build/temp.linux-x86_64-2.7/src/gtk/html2_wrap.o -pthread -O3

In file included from src/gtk/html2_wrap.cpp:2672:

include/wx/wxPython/wxPython.h: In function ‘bool wxPyCoreAPI_IMPORT()’:

include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from string constant to ‘char*’

include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from string constant to ‘char*’

src/gtk/html2_wrap.cpp: At global scope:

src/gtk/html2_wrap.cpp:2773: error: ISO C++ forbids declaration of ‘wxWebView’ with no type

src/gtk/html2_wrap.cpp:2773: error: ‘wxWebView’ declared as a ‘virtual’ field

src/gtk/html2_wrap.cpp:2773: error: expected ‘;’ before ‘*’ token

src/gtk/html2_wrap.cpp:2775: error: ISO C++ forbids declaration of ‘wxWebView’ with no type

src/gtk/html2_wrap.cpp:2775: error: ‘wxWebView’ declared as a ‘virtual’ field

src/gtk/html2_wrap.cpp:2775: error: expected ‘;’ before ‘*’ token

src/gtk/html2_wrap.cpp:2789: error: expected ‘;’ before ‘(’ token

src/gtk/html2_wrap.cpp:2790: error: expected ‘;’ before ‘static’

src/gtk/html2_wrap.cpp: In member function ‘const wxString& wxWebViewEvent::GetTarget() const’:

src/gtk/html2_wrap.cpp:2848: warning: returning reference to temporary

src/gtk/html2_wrap.cpp: In member function ‘const wxString& wxWebViewEvent::GetURL() const’:

src/gtk/html2_wrap.cpp:2849: warning: returning reference to temporary

src/gtk/html2_wrap.cpp: In function ‘PyObject* _wrap_WebViewFactory_Create__SWIG_0(PyObject*, int, PyObject**)’:

src/gtk/html2_wrap.cpp:3231: error: ‘class wxWebViewFactory’ has no member named ‘Create’

src/gtk/html2_wrap.cpp: In function ‘PyObject* _wrap_WebViewFactory_Create__SWIG_1(PyObject*, int, PyObject**)’:

src/gtk/html2_wrap.cpp:3321: error: ‘class wxWebViewFactory’ has no member named ‘Create’

src/gtk/html2_wrap.cpp: In function ‘PyObject* _wrap_WebView_PreNew(PyObject*, PyObject*, PyObject*)’:

src/gtk/html2_wrap.cpp:3516: error: no matching function for call to ‘wxWebView::New(const wxString&)’

src/gtk/html2_wrap.cpp:2790: note: candidates are: static wxWebView* wxWebView::New(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, const wxString&, long int, const wxString&)

error: command ‘gcc’ failed with exit status 1

Mears wrote:

There's a regression in the build process. Because wxWebView requires a
version of webkit-gtk not available for any release of RHEL, it can't be
built. In 2.9.4, it would be disabled during configure and skipped over
when building. In 2.9.5, configure correctly detects the system can't
support it:
checking for WEBKIT... configure: WARNING: webkitgtk not found.
configure: WARNING: WebKit not available, disabling wxWebView
checking for CAIRO... yes
checking for cairo_push_group... yes
checking for GST... yes

But then it goes off and tries compiling it anyways:
building '_html2' extension

It was building it before too, but it is using a set of empty stub classes and such that raise an exception when they are used. What you've found is an error in that stub code. Try adding this forward declaration around line 2737 of src/gtk/html2_wrap.cpp and let me know how it goes:

class wxWebView;

···

--
Robin Dunn
Software Craftsman

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -DSWIG_TYPE_TABLE=wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK_ -Iinclude -Isrc -I/builddir/build/BUILD/wxPython-src-2.9.5.0/bld/lib/wx/include/gtk2-unicode-2.9 -I/builddir/build/BUILD/wxPython-src-2.9.5.0/include -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/goes/include/python2.7 -c src/gtk/html2_wrap.cpp -o build/temp.linux-x86_64-2.7/src/gtk/html2_wrap.o -pthread -O3

In file included from src/gtk/html2_wrap.cpp:2672:

include/wx/wxPython/wxPython.h: In function ‘bool wxPyCoreAPI_IMPORT()’:

include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from string constant to ‘char*’

include/wx/wxPython/wxPython.h:39: warning: deprecated conversion from string constant to ‘char*’

src/gtk/html2_wrap.cpp: At global scope:

src/gtk/html2_wrap.cpp:2789: error: expected ‘;’ before ‘(’ token

src/gtk/html2_wrap.cpp:2790: error: expected ‘;’ before ‘static’

src/gtk/html2_wrap.cpp: In member function ‘const wxString& wxWebViewEvent::GetTarget() const’:

src/gtk/html2_wrap.cpp:2848: warning: returning reference to temporary

src/gtk/html2_wrap.cpp: In member function ‘const wxString& wxWebViewEvent::GetURL() const’:

src/gtk/html2_wrap.cpp:2849: warning: returning reference to temporary

src/gtk/html2_wrap.cpp: In function ‘PyObject* _wrap_WebView_PreNew(PyObject*, PyObject*, PyObject*)’:

src/gtk/html2_wrap.cpp:3516: error: no matching function for call to ‘wxWebView::New(const wxString&)’

src/gtk/html2_wrap.cpp:2790: note: candidates are: static wxWebView* wxWebView::New(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, const wxString&, long int, const wxString&)

error: command ‘gcc’ failed with exit status 1

···

On Monday, September 9, 2013 6:12:57 PM UTC-6, Robin Dunn wrote:

It was building it before too, but it is using a set of empty stub
classes and such that raise an exception when they are used. What
you’ve found is an error in that stub code. Try adding this forward
declaration around line 2737 of src/gtk/html2_wrap.cpp and let me know
how it goes:

class wxWebView;

Here are the patches I needed:

— wxPython-src-2.9.5.0/wxPython/src/gtk/html2_wrap.cpp 2013-05-18 12:47:49.000000000 -0600

+++ wxPython-src-2.9.5.0-patch/wxPython/src/gtk/html2_wrap.cpp 2013-09-11 11:13:06.179333082 -0600

@@ -2683,7 +2683,7 @@

#include <wx/sharedptr.h>

#include <wx/vector.h>

···

+class wxWebView;

enum wxWebViewZoom

{

@@ -2784,12 +2784,12 @@

class wxWebView : public wxControl

{

public:

  • virtual bool Create(wxWindow*, wxWindowID, const wxString&, const wxPoint&,

  •                    const wxSize&, long style, const wxString&) { _RaiseError(); return false; }
    
  • static wxWebView* New(wxWebViewBackend) { _RaiseError(); return NULL; }

  • static wxWebView* New(wxWindow*, wxWindowID, const wxString&, const wxPoint& ,

  •                      const wxSize& , const wxString&, long style,
    
  •                      const wxString&) { _RaiseError(); return NULL; }
    
  • virtual bool Create(wxWindow* parent, wxWindowID id, const wxString& url, const wxPoint& pos,

  •                    const wxSize& size, long style, const wxString& name) { _RaiseError(); return false; }
    
  • static wxWebView* New(const wxString& backend) { _RaiseError(); return NULL; }

  • static wxWebView* New(wxWindow* parent, wxWindowID id, const wxString& url, const wxPoint& pos,

  •                      const wxSize&  size, const wxString& backend, long style,
    
  •                      const wxString& name) { _RaiseError(); return NULL; }
    

virtual wxString GetCurrentTitle() const { return wxEmptyString; }

virtual wxString GetCurrentURL() const { return wxEmptyString; }

— wxPython-src-2.9.5.0/wxPython/setup.py 2013-02-27 13:14:01.000000000 -0700

+++ wxPython-src-2.9.5.0-patch/wxPython/setup.py 2013-09-11 09:54:08.882270829 -0600

@@ -946,6 +946,7 @@

DATA_FILES += find_data_files(‘wx/tools/Editra/tests/syntax’, ‘*’)

DATA_FILES += find_data_files(‘wx/tools/Editra’, ‘[A-Z]*’, recursive=False)

+DATA_FILES += [“src/wx.pth”]

import pprint

pprint.pprint(DATA_FILES)

Mears wrote:

Here are the patches I needed:

Thanks.

···

--
Robin Dunn
Software Craftsman

Dunno whether this failure is related. I tried to build 2.9.5.0 on Ubuntu 12.04, starting from

cd wxPython-src-2.9.5.0/wxPython

sudo python2.7 build-wxpython.py --build_dir=…/bld

Here is the failure:

building ‘_html2’ extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK_ -Iinclude -Isrc -I/home/bruce/Downloads/wxPython-src-2.9.5.0/bld/lib/wx/include/gtk2-unicode-2.9 -I/home/bruce/Downloads/wxPython-src-2.9.5.0/include -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/python2.7 -c src/gtk/html2_wrap.cpp -o build/temp.linux-x86_64-2.7/src/gtk/html2_wrap.o -pthread -O3 -pthread

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]

src/gtk/html2_wrap.cpp: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:

src/gtk/html2_wrap.cpp:864:42: warning: format not a string literal and no format arguments [-Wformat-security]

In file included from src/gtk/html2_wrap.cpp:2672:0:

include/wx/wxPython/wxPython.h: In function ‘bool wxPyCoreAPI_IMPORT()’:

include/wx/wxPython/wxPython.h:39:80: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

include/wx/wxPython/wxPython.h:39:80: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

src/gtk/html2_wrap.cpp: At global scope:

src/gtk/html2_wrap.cpp:2773:13: error: ‘wxWebView’ does not name a type

src/gtk/html2_wrap.cpp:2775:13: error: ‘wxWebView’ does not name a type

src/gtk/html2_wrap.cpp:2789:23: error: expected ‘;’ at end of member declaration

src/gtk/html2_wrap.cpp:2789:43: error: function definition does not declare parameters

src/gtk/html2_wrap.cpp:2792:74: error: declaration of ‘static wxWebView* wxWebView::New(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, const wxString&, long int, const wxString&)’

src/gtk/html2_wrap.cpp:2789:43: error: conflicts with previous declaration ‘wxWebView* wxWebView::New’

src/gtk/html2_wrap.cpp: In member function ‘const wxString& wxWebViewEvent::GetTarget() const’:

src/gtk/html2_wrap.cpp:2848:48: warning: returning reference to temporary [enabled by default]

src/gtk/html2_wrap.cpp: In member function ‘const wxString& wxWebViewEvent::GetURL() const’:

src/gtk/html2_wrap.cpp:2849:45: warning: returning reference to temporary [enabled by default]

src/gtk/html2_wrap.cpp: In function ‘PyObject* _wrap_WebViewFactory_Create__SWIG_0(PyObject*, int, PyObject**)’:

src/gtk/html2_wrap.cpp:3231:35: error: ‘class wxWebViewFactory’ has no member named ‘Create’

src/gtk/html2_wrap.cpp: In function ‘PyObject* _wrap_WebViewFactory_Create__SWIG_1(PyObject*, int, PyObject**)’:

src/gtk/html2_wrap.cpp:3321:35: error: ‘class wxWebViewFactory’ has no member named ‘Create’

src/gtk/html2_wrap.cpp: In function ‘PyObject* _wrap_WebView_PreNew(PyObject*, PyObject*, PyObject*)’:

src/gtk/html2_wrap.cpp:3516:65: error: no matching function for call to ‘wxWebView::New(const wxString&)’

src/gtk/html2_wrap.cpp:3516:65: note: candidate is:

src/gtk/html2_wrap.cpp:2790:23: note: static wxWebView* wxWebView::New(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, const wxString&, long int, const wxString&)

src/gtk/html2_wrap.cpp:2790:23: note: candidate expects 8 arguments, 1 provided

error: command ‘gcc’ failed with exit status 1

ERROR: failed building wxPython.

Bruce Sherwood wrote:

Dunno whether this failure is related. I tried to build 2.9.5.0 on
Ubuntu 12.04, starting from

cd wxPython-src-2.9.5.0/wxPython
sudo python2.7 build-wxpython.py --build_dir=../bld

Here is the failure:

Yes, it looks like the same issue. Try installing the libwebkitgtk-dev and its dependencies, if the version is new enough then that should take care of the problem. Otherwise the patch should fix the stub workaround.

···

--
Robin Dunn
Software Craftsman

Installing libwebkitgtk-dev 1.8.3 made no difference.

Besides the patch above that should be applyed, there are build errors on Mandriva/Mageia.

There was changes in wxPython-src-2.9.5.0/build/tools/builder.py since 2.9.4.1
args.extend might error if NoneType. In the clean, build, install defs. Not sure how the truth checks got lost since then but here are the fixed files. Files in attachments.

Changes to these three defs. Also, added (parenthesis) around print statements…

def clean(self, dir=None, projectFile=None, options=):
“”"
dir = the directory containing the project file
projectFile = Some formats need to explicitly specify the project file’s name
“”"
if self.isAvailable():
args = [self.getProgramPath()]
pfArg = self.getProjectFileArg(projectFile)
if pfArg:
args.extend(pfArg)
args.append(“clean”)
if options:
args.extend(options)
result = runInDir(args, dir)
return result

    return False

def build(self, dir=None, projectFile=None, targets=None, options=[]):
    if self.isAvailable():
        args = [self.getProgramPath()]
        pfArg = self.getProjectFileArg(projectFile)
        if pfArg:
            args.extend(pfArg)
        # Important Note: if extending args, check it first!
        # NoneTypes are not iterable and will crash the clean, build, or install!
        # Very very irritating when this happens right at the end.
        if options:
            args.extend(options)
        result = runInDir(args, dir)
        return result

    return 1

def install(self, dir=None, projectFile=None, options=[]):
    if self.isAvailable():
        args = [self.getProgramPath()]
        pfArg = self.getProjectFileArg(projectFile)
        if pfArg:
            args.extend(pfArg)
        args.append("install")
        if options:
            args.extend(options)
        result = runInDir(args, dir)
        return result

    return 1

Also the Mandriva/Mageia Patch Lines to wxPython-src-2.9.5.0\wxPython\config.py
from the mageia build question thread.

Mandriva / Mageia -----------------------------------------

     self.linker_so = [el for el in self.linker_so if el != '-Wl,--no-undefined']
     compiler_so = [el for el in compiler_so if el != '-Werror=format-security']
     # Mandriva / Mageia -----------------------------------------

Trimed Trailing Whitespace, in both files.

… and then open terminal/konsole

cd wxPython-src-2.9.5.0/wxPython
python2.7 build-wxpython.py --build_dir=../bld

And Built Successfully.
Dang, that only took 6 failed builds to do… Nice.
@Robin: Include these fixes in the 2.9.5.1 also please.

builder.py (7.72 KB)

config.py (43.3 KB)

Bruce Sherwood wrote:

Installing libwebkitgtk-dev 1.8.3 made no difference.

1.10.0 on Ubuntu 12.10 works for me. I think it was supposed to work with 1.3 or better. Did you do a full clean and rebuild after installing the new packages? If so then using the patch mentioned before should allow you to complete the build with empty stubs in place of the html2 classes. Or watch the output of the wxWidgets configure step to see if there are more clues about what else it needs for the webview classes.

···

--
Robin Dunn
Software Craftsman

Metallicow wrote:

Also the Mandriva/Mageia Patch Lines to
wxPython-src-2.9.5.0\wxPython\config.py
from the mageia build question thread.

    # Mandriva / Mageia -----------------------------------------
    self.linker_so = [el for el in self.linker_so if el !=
    '-Wl,--no-undefined']
    compiler_so = [el for el in compiler_so if el !=
    '-Werror=format-security']
    # Mandriva / Mageia -----------------------------------------

What exactly is the problem if these flags are left in? I expect that those are coming from distutils which is getting them from the flags used to build Python, so if they are really causing problems then it should be Madriva's Python package that is fixed, not hacking around it here.

···

--
Robin Dunn
Software Craftsman

Without those 2 lines, it wasn’t building/installing right on Mandriva/Mageia. Not a real biggie adding those 2 lines manually if building from source on those specific distros.
If those lines will affect other linux builds from completing, then maybe they shouldn’t be included in the source. I haven’t tried building on any other distro yet with those lines included.
I’ll leave that decision up to you as to whether they should be included or not as you probably have test built on more distros than I have.

···

On Wednesday, September 25, 2013 2:17:01 PM UTC-5, Robin Dunn wrote:

Metallicow wrote:

Also the Mandriva/Mageia Patch Lines to

wxPython-src-2.9.5.0\wxPython\config.py

from the mageia build question thread.

# Mandriva / Mageia -----------------------------------------
self.linker_so = [el for el in self.linker_so if el !=
'-Wl,--no-undefined']
compiler_so = [el for el in compiler_so if el !=
'-Werror=format-security']
# Mandriva / Mageia -----------------------------------------

What exactly is the problem if these flags are left in? I expect that
those are coming from distutils which is getting them from the flags
used to build Python, so if they are really causing problems then it
should be Madriva’s Python package that is fixed, not hacking around it
here.

I think the patch should be applied (minus the Mandriva/Mageia comments). As you mentioned, the default behavior of distutils is to use the same build flags used to build Python. -Werror=format-security has or is being added by many distributions as a security measure. Mandriva and it’s derivatives require it for their official packages (read Python), Fedora will be requiring it as of Fedora 21, Ubuntu 13.04+ (?), and probably others that I’m too lazy to research. In other words, the presence of this flag in many distributions’ Python package compilation is preventing WxPython from building because it makes potentially unsafe calls to printf. Of course, the printf invocations could and probably should be cleaned up, but in the interim, that flag should be removed, if present.

The linker flag is to prevent underlinking, which you can read about here: Mandriva

Even if you don’t agree with Mandriva’s rational, no harm will come from removing that flag from your build script (WxPython won’t build with it).

···

On Wednesday, September 25, 2013 1:17:01 PM UTC-6, Robin Dunn wrote:

What exactly is the problem if these flags are left in? I expect that
those are coming from distutils which is getting them from the flags
used to build Python, so if they are really causing problems then it
should be Madriva’s Python package that is fixed, not hacking around it
here.

I use Mandriva/Mageia too.
I modify /usr/local/wxPython-src-2.8.12.1/wxPython/config.py
And the compile works fine …
Hope this helps you.

···

Le 16/01/2014 08:51, Mears a écrit :

    On Wednesday, September 25, 2013 1:17:01 PM UTC-6,

Robin Dunn wrote:

      What

exactly is the problem if these flags are left in? I expect
that

      those are coming from distutils which is getting them from the

flags

      used to build Python, so if they are really causing problems

then it

      should be Madriva's Python package that is fixed, not hacking

around it

      here.
      I think the patch should be applied (minus the

Mandriva/Mageia comments). As you mentioned, the default
behavior of distutils is to use the same build flags used to
build Python. -Werror=format-security has or is being added by
many distributions as a security measure. Mandriva and it’s
derivatives require it for their official packages (read
Python), Fedora will be requiring it as of Fedora 21, Ubuntu
13.04+ (?), and probably others that I’m too lazy to research.
In other words, the presence of this flag in many
distributions’ Python package compilation is preventing
WxPython from building because it makes potentially unsafe
calls to printf. Of course, the printf invocations could and
probably should be cleaned up, but in the interim, that flag
should be removed, if present.

      The linker flag is to prevent underlinking, which you can

read about here:

        Even if you don't agree with

Mandriva’s rational, no harm will come from removing that
flag from your build script (WxPython won’t build with it).

  You received this message because you are subscribed to the Google

Groups “wxPython-users” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to .
For more options, visit .

` class
MyUnixCCompiler(distutils.unixccompiler.UnixCCompiler):
``

``                  def _compile(self, obj, src, ext, cc_args,

extra_postargs, pp_opts):
``

``                compiler_so = self.compiler_so

``

``                if sys.platform == 'darwin':

``

``                          compiler_so =

_darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
``

``                      # Mandriva / Mageia

``

``                      self.linker_so = [el for el in

self.linker_so
``

``                                        if el !=

‘-Wl,–no-undefined’]
``

``                compiler_so = [el for el in compiler_so \

``

``                                     if el !=

‘-Werror=format-security’]
``

``                      # Mandriva / Mageia

``

``                try:

``

``                          self.spawn(compiler_so + cc_args +

[src, ‘-o’, obj] +
``

``                               extra_postargs)

``

``                except DistutilsExecError, msg:

``

``                    raise CompileError, msg

``

`

-- Hugues JEAN-BAPTISTE ()
AGORINFO S.A.S. ()

http://wiki.mandriva.com/en/Underlinkingwxpython-users+unsubscribe@googlegroups.com
https://groups.google.com/groups/opt_out
hjb@agorinfo.frhttp://www.agorinfo.fr

What exactly is the problem if these flags are left in? I expect that
those are coming from distutils which is getting them from the flags
used to build Python, so if they are really causing problems then it
should be Madriva’s Python package that is fixed, not hacking around it
here.

I think the patch should be applied (minus the Mandriva/Mageia comments). As you mentioned, the default behavior of distutils is to use the same build flags used to build Python. -Werror=format-security has or is being added by many distributions as a security measure. Mandriva and it’s derivatives require it for their official packages (read Python), Fedora will be requiring it as of Fedora 21, Ubuntu 13.04+ (?), and probably others that I’m too lazy to research. In other words, the presence of this flag in many distributions’ Python package compilation is preventing WxPython from building because it makes potentially unsafe calls to printf. Of course, the printf invocations could and probably should be cleaned up, but in the interim, that flag should be removed, if present.

The linker flag is to prevent underlinking, which you can read about here: http://wiki.mandriva.com/en/Underlinking

Even if you don’t agree with Mandriva’s rational, no harm will come from removing that flag from your build script (WxPython won’t build with it).

For wxPython to build on Mandriva/Mageia those lines are NEEDED at the present time. Mageia may fix this in later versions at some point.
Robin went ahead and added them to the source, but they are commented out.
So basically in the case that you are building on mandriva/mageia.derivs…
users can easily uncomment out those lines and the build will pass.

It would probably be better to have a platform.linux_distribution() few lines specifically for targeting/handling affected distros.
for Ex:

···

On Thursday, January 16, 2014 1:51:30 AM UTC-6, Mears wrote:

On Wednesday, September 25, 2013 1:17:01 PM UTC-6, Robin Dunn wrote:
platDistro = platform.linux_distribution()
if ‘mageia’ in platDistro or ‘mandriva’ in platDistro:
# …run linker code

Mageia isn’t going to “fix” anything. Those flags were added to to system packages consciously, and other distros [1] [2] are taking the same steps. The fact is, WxPython isn’t going to build against official Python packages on any distribution where the packaging policy includes those flags, so there’s no reason to make the exclusion distro specific.

[1] - Issue #1185: Enable "-Werror=format-security" by default - fesco - Pagure.io

[2] - ToolChain/CompilerFlags - Ubuntu Wiki

···

On Saturday, January 18, 2014 4:28:34 AM UTC-7, Metallicow wrote:

For wxPython to build on Mandriva/Mageia those lines are NEEDED at the present time. Mageia may fix this in later versions at some point.
Robin went ahead and added them to the source, but they are commented out.
So basically in the case that you are building on mandriva/mageia.derivs…
users can easily uncomment out those lines and the build will pass.

It would probably be better to have a platform.linux_distribution() few lines specifically for targeting/handling affected distros.
for Ex:

platDistro = platform.linux_distribution()
if ‘mageia’ in platDistro or ‘mandriva’ in platDistro:
# …run linker code

So… I am assuming you are suggesting that the wxPython build scripts need to be rewritten better to handle building wxPython successfully on the affected distros because of this build issue?
Is there a draft anyone or yourself has written that addresses this issue?
If not, then leaving that portion in the code commented out is the best that can be done ATM until better solutions arise.
…Reading back through the change logs, It appears community users was jumping Robins case at the time to help update the build scripts to be better. Maybe it is time for some more improvements again…?

As being “Cross-platform”, wxPython “should” build just fine under all different flavors of linux; not be picky about which ones as is with the current situation.
Any Ideas?

···

On Wednesday, January 22, 2014 11:01:41 PM UTC-6, Mears wrote:

Mageia isn’t going to “fix” anything. Those flags were added to to system packages consciously, and other distros [1] [2] are taking the same steps. The fact is, WxPython isn’t going to build against official Python packages on any distribution where the packaging policy includes those flags, so there’s no reason to make the exclusion distro specific.

[1] - https://fedorahosted.org/fesco/ticket/1185

[2] - https://wiki.ubuntu.com/ToolChain/CompilerFlags