Cannot build wxpython on Garuda/Arch linux

I’ve tried many different approaches, but the dead end I’m at now is trying to follow this guide. The build log looks like it has an issue with siplib, but I’ve reinstalled sip and python-sip and I get the same error.

 Waf: Entering directory `/tmp/pip-req-build-nikactze/build/waf/3.12/gtk3'
  **** Compiler: gcc --version
       gcc (GCC) 14.1.1 20240522
       Copyright (C) 2024 Free Software Foundation, Inc.
       This is free software; see the source for copying conditions.  There is NO
       warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  /tmp/pip-req-build-nikactze/sphinxtools/constants.py:226: SyntaxWarning: invalid escape sequence '\w'
    CONSTANT_RE = re.compile('^([\w\s,]+)=', re.M)
  [  1/939] Compiling sip/siplib/sip_array.c
  [  2/939] Compiling sip/siplib/descriptors.c
  [  3/939] Compiling sip/siplib/apiversions.c
  [  4/939] Compiling sip/siplib/qtlib.c
  [  5/939] Compiling sip/siplib/voidptr.c
  [  6/939] Compiling sip/siplib/objmap.c
  [  7/939] Compiling sip/siplib/bool.cpp
  [  8/939] Compiling sip/siplib/threads.c
  [  9/939] Compiling sip/siplib/int_convertors.c
  [ 10/939] Compiling sip/siplib/siplib.c
  ../../../../sip/siplib/siplib.c: In function ‘parsePass1’:
  ../../../../sip/siplib/siplib.c:3900:20: error: assignment to ‘sipSimpleWrapper *’ {aka ‘struct _sipSimpleWrapper *’} from incompatible pointer type ‘PyObject *’ {aka ‘struct _object *’} [-Wincompatible-pointer-types]
   3900 |             *selfp = va_arg(va, PyObject *);
        |                    ^

  Waf: Leaving directory `/tmp/pip-req-build-nikactze/build/waf/3.12/gtk3'
  Build failed
   -> task in 'siplib' failed with exit status 1 (run with -v to display more information)
  Command '"/home/codeender/Documents/gitclone/temp_build/builder_py/bin/python3" /tmp/pip-req-build-nikactze/bin/waf-2.0.24 --wx_config=/tmp/pip-req-build-nikactze/build/wxbld/gtk3/wx-config --gtk3 --python="/home/codeender/Documents/gitclone/temp_build/builder_py/bin/python3" --out=build/waf/3.12/gtk3 configure build ' failed with exit code 1.
  Finished command: build_py (0m1.414s)
  Finished command: build (1m37.156s)
  Command '"/home/codeender/Documents/gitclone/temp_build/builder_py/bin/python3" -u build.py build' failed with exit code 1.
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /home/codeender/Documents/gitclone/temp_build/builder_py/bin/python3 -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-req-build-nikactze/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-xl7p87ub
  cwd: /tmp/pip-req-build-nikactze/
  Building wheel for wxPython (setup.py): finished with status 'error'
  ERROR: Failed building wheel for wxPython
  Running setup.py clean for wxPython
  Running command python setup.py clean
  running clean
  'build/lib.linux-x86_64-cpython-312' does not exist -- can't clean it
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-3.12' does not exist -- can't clean it
Failed to build wxPython
ERROR: Failed to build one or more wheels

the build log is too long for pastebin and I can’t attach files, but this is the last part where it failed.

I’m using python 3.12.4 if that’s relevant.

You can try this old recipe I still use with Linux OS and Virtualenv :
https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html

yes, this is the guide that I linked that isn’t working for me

Hello,

I have no experience with Garuda/Arch, but FWIW I have two pieces of advice:

  • build clean and even build clean_all are not always sufficient, so if you’ve been updating the version of some tools, including sip, you may want to do a new git clone in a new directory to get a clean source tree.

  • This azure builds script successfully compiles the latest version of wxPython on ubuntu, and it may contain helpful hints of what you need to do in Garuda/Arch.