[PATCH] gdb: prefere python3 if it is installed
Christian Mauderer
oss at c-mauderer.de
Sun Aug 22 09:12:53 UTC 2021
On 21/08/2021 04:56, Chris Johns wrote:
> On 21/8/21 4:08 am, oss at c-mauderer.de wrote:
>> Started to test both (MSYS2 and Cygwin) and I start to suspect that our manual
>> needs some minor updates. I'm taking notes ...
>
> Oh awesome, I am sooo grateful.
>
> Thanks
> Chris
>
Hello,
building on Windows is at least difficult and it takes ages (about 10
hours for a build on msys2 even if I provided a lot of cores to the VM).
It seems that you were right to suspect that the change might make
trouble (at least in one of the four cases that I tested). I don't post
a patch for the manual at the moment because I didn't manage to build a
complete toolchain yet.
I'll continue to investigate the problems but it will take a bit longer
because every test needs horrible long. An intermediate report:
All tests have been done with rtems-source-builder 5 branch with my
additional patch.
== Results on cygwin
Packets mentioned in the manual:
- gcc4-core Does not exist.
Installed gcc-core instead
- gcc4-g++: Does not exist.
Installed gcc-g++ instead
- mingw64-x86_64-g++ does not exist.
Installed mingw64-x86_64-gcc-g++ instead
- mingw-zlib-devel: Does not exist.
No replacement found.
- zlib-devel is now at "Libs"
- I had to install libreadline-devel and libreadline7 in the testing
version 8.1-1. Otherwise the build stopped with the information that
system readline isn't recent enough.
- The packet "python" doesn't exist. It's now either python2 or python3.
I tried both:
For python2 I installed python2 and python2-devel.
For python3 I removed python2* and installed python3 and python3-devel.
In both cases, the build system detected the correct python. But I
received errors like the following in the log:
`````````````````
configure: WARNING: MPFR is missing or unusable; some features may be
unavailable.
checking whether to use python... /usr/bin/python3
checking for python... no
configure: error: no usable python found at /usr/bin/python3
make[1]: *** [Makefile:8869: configure-gdb] Error 1
make[1]: Leaving directory
'/home/User/rtems-source-builder/rtems/build/sparc-rtems5-gdb-9.1-x86_64-pc-cygwin-1/build'
make: *** [Makefile:855: all] Error 2
shell cmd failed: sh -ex
/home/User/rtems-source-builder/rtems/build/sparc-rtems5-gdb-9.1-x86_64-pc-cygwin-1/do-build
error: building sparc-rtems5-gdb-9.1-x86_64-pc-cygwin-1
See error report:
rsb-report-sparc-rtems5-gdb-9.1-x86_64-pc-cygwin-1.txt
Build Set: Time 0:15:27.798085
`````````````````
I suspect that I would need a mingw64-x86_64-python2/3. But that packet
does not exist.
Any hints what I could try?
== Result on mingw
Beneath the packets in the manual, I had to install flex.
First test was with python2. That is where my patch made problems: If I
installed "python" (which is python3) like said in the manual, gdb
detected python3 and wanted to use that (due to my patch). I only
install mingw64/mingw-w64-x86_64-python2 like said in the manual so that
didn't work. If I removed "python" again, I had to use a workarround for
RSB to work (PYTHONIOENCODING=UTF-8 ../source-builder/sb-set-builder
--prefix=/opt/rtems/5 5/rtems-sparc) and then the first 10 hours build
fine (gdb, gcc, ...) but the build stopped when building rtems-tools
with the following error in the log file:
`````````````````
++ pwd
+ build_top=/c/msys64/home/User/rtems-source-builder/rtems/build/rt01
+ test x86_64-w64-mingw32 '!=' x86_64-w64-mingw32
+ RT_HOST=
+ cd rtems-tools-0a5d2057749066e7d184836e92c7ce5334fccc90
+ ./waf distclean configure --prefix=/c/msys64/home/User/rtems-python2/5
/usr/bin/env: ‘python’: No such file or directory
shell cmd failed: sh -ex
/c/msys64/home/User/rtems-source-builder/rtems/build/rt01/do-build
error: building rt01
Build Set: Time 21:29:33.633738
`````````````````
Which somehow makes sense because I removed the "python" packet.
If I tried with python3 instead (removed
"mingw64/mingw-w64-x86_64-python2" and added "mingw-w64-x86_64-python"
and "python") I didn't need the workarround with the PYTHONIOENCODING.
But the build stopped a lot earlier with the following message in the log:
`````````````````
reporting: devel/expat-2.1.0-1.cfg -> expat-2.1.0-x86_64-w64-mingw32-1.xml
making dir:
c:\msys64\home\User\rtems-source-builder\rtems\build\tmp\e2xwm1-197609\c\msys64\home\User\rtems-python3\5\share\rtems\rsb
config: tools/rtems-gdb-9.1-1.cfg
error: shell macro failed: sh -c
"/c/msys64/home/User/rtems-source-builder/source-builder/sb/rtems-build-dep
-c x86_64-w64-mingw32-gcc -I '-IC:/msys64/mingw64/include/python3.9
-IC:/msys64/mingw64/include/python3.9
-IC:/msys64/mingw64/include/python3.9
-IC:/msys64/mingw64/include/python3.9' -H Python.h": 2: sh: -c: line 1:
unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
Build Set: Time 0:08:18.194738
`````````````````
Seems that somewhere a opening quotation mark is added where it
shouldn't be.
Best regards
Christian
More information about the devel
mailing list