← Back to team overview

kicad-developers team mailing list archive

Re: wxPython version check

 

On 2/18/2015 7:08 PM, Miguel Ángel Ajo wrote:
> Hmm, if I re-run cmake or, as Wayne suggested, I run 
> make rebuild_cache, WXPYTHON_VERSION turns into “3.0” inside config.h
> 
> I will add that workaround to the kicad fedora builder, but…
> why does that happen?

Good question.  You would think CMake would rebuild the cache when any
of the CMake files were modified but it doesn't.  I've had issues with
this in the past.

> 
> Miguel Ángel Ajo
> 
> On Thursday, 19 de February de 2015 at 00:41, Miguel Ángel Ajo wrote:
> 
>> Hmm, it seems that in my system it’s getting an empty string ‘’,
>>
>> where does WXPYTHON_VERSION come from?
>>
>> /// The wxPython version found during configuration.
>> #if defined( KICAD_SCRIPTING_WXPYTHON )
>> #define WXPYTHON_VERSION                ""
>> #endif
>>
>> Shouldn’t that match WXPYTHON_VERSION_FOUND from CMakeCache.txt ? 
>>
>>
>> Miguel Ángel Ajo
>>
>> On Thursday, 19 de February de 2015 at 00:35, Miguel Ángel Ajo wrote:
>>
>>> KICAD_SCRIPTING_WXPYTHON:BOOL=ON
>>> and
>>> WXPYTHON_VERSION_FOUND:STRING=3.0
>>>
>>> I wonder what’s wrong with my “wxversion” thing… the exact error is:
>>>
>>> [ajo@kicad kicad-5430]$ pcbnew
>>> Traceback (most recent call last):
>>>   File "<string>", line 1, in <module>
>>>   File "/usr/lib64/python2.7/site-packages/wxversion.py", line 149,
>>> in select
>>>     bestMatch = _get_best_match(installed, versions, optionsRequired)
>>>   File "/usr/lib64/python2.7/site-packages/wxversion.py", line 273,
>>> in _get_best_match
>>>     score = pkg.Score(_wxPackageInfo(ver), optionsRequired)
>>>   File "/usr/lib64/python2.7/site-packages/wxversion.py", line 357,
>>> in __init__
>>>     self.version = tuple([int(x) for x in segments[0].split('.')])
>>> ValueError: invalid literal for int() with base 10: ''
>>> ImportError: No module named wx._core_
>>>
>>>
>>> If I do this in console, it seems to work
>>> >>> import wxversion
>>> >>> wxversion.select('3.0')
>>> >>>
>>>  I will try to check what’s really getting through WXPYTHON_VERSION,
>>> or why is it failing
>>> in my system when inside pcbnew.
>>>
>>> Miguel Ángel Ajo
>>>
>>> On Wednesday, 18 de February de 2015 at 23:38, Miguel Ángel Ajo wrote:
>>>
>>>> Hi Wayne,
>>>>
>>>> I don’t have direct access to the CmakeCache (due that I’m relying
>>>> on copr for my builds),
>>>> but I could try to replicate locally, btw, this is from the build logs:
>>>>
>>>> -- Found wxWidgets:
>>>> -pthread;;;-lwx_gtk2u_gl-3.0;-lwx_gtk2u_aui-3.0;-lwx_gtk2u_adv-3.0;-lwx_gtk2u_html-3.0;-lwx_gtk2u_core-3.0;-lwx_baseu_net-3.0;-lwx_baseu-3.0;-lwx_baseu_xml-3.0;-lwx_gtk2u_stc-3.0
>>>> (found suitable version "3.0.2", minimum required is "3.0.0")
>>>>
>>>>
>>>> and I set KICAD_SCRIPTING_WXPYTHON on cmake:
>>>>
>>>> https://copr-be.cloud.fedoraproject.org/results/mangelajo/kicad/fedora-21-x86_64/kicad-5429-nightlies.fc22/build.log.gz
>>>>
>>>> I’m going to debug a bit to see what’s happening, and read the
>>>> thread about the wxPython changes that
>>>> I didn’t have time to read in full.
>>>>
>>>> Best reagards,
>>>> Miguel Ángel.
>>>>
>>>> Miguel Ángel Ajo
>>>>
>>>> On Wednesday, 18 de February de 2015 at 18:05, Wayne Stambaugh wrote:
>>>>
>>>>> Miguel,
>>>>>
>>>>> What is the output of:
>>>>>
>>>>> grep WXPYTHON < kicad_build_path/CMakeCache.txt
>>>>>
>>>>> You should see something like this:
>>>>>
>>>>> KICAD_SCRIPTING_WXPYTHON:BOOL=ON
>>>>> WXPYTHON_VERSION_FOUND:STRING=3.0
>>>>>
>>>>> If WXPYTHON_VERSON_FOUND is empty, run `make rebuild_cache`.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Wayne
>>>>>
>>>>> On 2/18/2015 10:44 AM, Miguel Ángel Ajo wrote:
>>>>>> It looks like something related to the python paths not
>>>>>> being able to find wx._core_.
>>>>>>
>>>>>> I’ll put some time tonight on it.
>>>>>>
>>>>>> Miguel Ángel Ajo
>>>>>>
>>>>>> On Wednesday, 18 de February de 2015 at 16:33, Brian Sidebotham wrote:
>>>>>>
>>>>>>> On 18 February 2015 at 14:26, Miguel Ángel Ajo
>>>>>>> <majopela@xxxxxxxxxx <mailto:majopela@xxxxxxxxxx>
>>>>>>> <mailto:majopela@xxxxxxxxxx>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Hmm, this crashes in the fedora nightly build during pcbnew startup,
>>>>>>>> I need
>>>>>>>> to investigate why.
>>>>>>>>
>>>>>>>> https://github.com/KiCad/kicad-source-mirror/commit/69553d6fa31a60a4694395f0dcadfdbd787c21a8#diff-cdb8e872a96e63280c27292a5845cfbeR147
>>>>>>>>
>>>>>>>> snprintf( cmd, 1023, "import wxversion; wxversion.select('%s')",
>>>>>>>> WXPYTHON_VERSION );
>>>>>>>> PyRun_SimpleString( cmd );
>>>>>>>
>>>>>>> Probably a missing
>>>>>>>
>>>>>>> PyLock lock;
>>>>>>>
>>>>>>> Also, we don't need to use snprintf here, we can simply use:
>>>>>>>
>>>>>>> const char* cmd = "import wxversion; wxversion.select('"
>>>>>>> WXPYTHON_VERSION "')";
>>>>>>>
>>>>>>> instead.
>>>>>>>
>>>>>>> Sorry I don't have time to investigate the crash right now. Good
>>>>>>> Luck.
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>> Brian.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>>>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>>>>> More help : https://help.launchpad.net/ListHelp
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>>>> More help : https://help.launchpad.net/ListHelp
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>>> More help : https://help.launchpad.net/ListHelp
>>>>
>>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp
> 



References