← Back to team overview

kicad-developers team mailing list archive

Re: Python scripting cmake build macros.

 

On 24 January 2013 22:42, Brian Sidebotham <brian.sidebotham@xxxxxxxxx>wrote:

> A quick test to build wxPython with a freshly compiled python-mingw with
> binascii package results in the next problem. One that looks a bit more
> fundamental to sort out:
>
> This is what I get compiling the most basic of extension with this
> python-mingw, the error is the same when trying to build wxPython too:
>
> KiCad-WinbuilderC:\kicad-winbuilder-dev\kicad-winbuilder\src\wx\testmodule>python
> setup.py build -c mingw32
> running build
> running build_ext
> Warning: Can't read registry to find the necessary compiler setting
> Make sure that Python modules _winreg, win32api or win32con are installed.
> building 'hello' extension
> C:\kicad-winbuilder-dev\kicad-winbuilder\env\mingw\bin\gcc.exe -mno-cygwin
> -mdll
>  -O -Wall -IC:\kicad-winbuilder-dev\kicad-winbuilder\env\python\include
> -IC:\kic
> ad-winbuilder-dev\kicad-winbuilder\env\python\PC -c testmodule.c -o
> build\temp.w
> in32-2.7\Release\testmodule.o
> Traceback (most recent call last):
>   File "setup.py", line 8, in <module>
>     ext_modules = [module1])
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\core.py", line 152, in setup
>     dist.run_commands()
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\dist.py", line 953, in run_commands
>     self.run_command(cmd)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\dist.py", line 972, in run_command
>     cmd_obj.run()
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\command\build.py", line 127, in run
>     self.run_command(cmd_name)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\cmd.py", line 326, in run_command
>     self.distribution.run_command(command)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\dist.py", line 972, in run_command
>     cmd_obj.run()
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\command\build_ext.py", line 340, in run
>     self.build_extensions()
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\command\build_ext.py", line 449, in build_extensions
>     self.build_extension(ext)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\command\build_ext.py", line 499, in build_extension
>     depends=ext.depends)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\ccompiler.py", line 624, in compile
>     self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\cygwinccompiler.py", line 164, in _compile
>     extra_postargs)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\ccompiler.py", line 925, in spawn
>     spawn(cmd, dry_run=self.dry_run)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\spawn.py", line 36, in spawn
>     _spawn_nt(cmd, search_path, dry_run=dry_run)
>   File
> "C:\kicad-winbuilder-dev\kicad-winbuilder\env\python\lib\python2.7\distut
> ils\spawn.py", line 69, in _spawn_nt
>     rc = os.spawnv(os.P_WAIT, executable, cmd)
> AttributeError: 'module' object has no attribute 'spawnv'
>
> Basically it's down to not having pywin32 installed or any other win32api
> module. The trouble is they all seem to require compiling with msvc.
>
> I've run out of time again.
>
> Best Regards, Brian.
>
>
>
Hi Guys,

Sorry I missed most of the discussion today, but appear to have dropped and
bomb before I stopped following!

The mail I sent above details the tie-in with pywin32, although I notice
now upon re-reading that this may just be python's distutils trying to
access the registry and failing.

I am assuming here that we need to execute this python build using the new
python-mingw executable on windows to compile wxPython? I don't see how
that part can be done under Linux?

This is entirely where the link to pywin32 came from - which is essentially
distutils rather than wxPython.

Best Regards, Brian.

Follow ups

References