Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#3792 closed defect (fixed)

RSB fails to build on MSYS2

Reported by: Jeff Mayes Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: admin Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Fresh install of Windows 10, with updates. Then installed MSYS2 as instructed here:
https://docs.rtems.org/branches/master/user/hosts/windows.html#msys2

Fetched the RSB, and then tried to build rtems-sparc tools, like this…

$ ../source-builder/sb-set-builder --prefix=/home/mayes/dev/rtems/5 5/rtems-sparc
RTEMS Source Builder - Set Builder, 5 (b45df48a51bc)
Build Set: 5/rtems-sparc
Build Set: 5/rtems-autotools.bset
Build Set: 5/rtems-autotools-internal.bset
config: tools/rtems-autoconf-2.69-1.cfg



config: devel/expat-2.1.0-1.cfg
package: expat-2.1.0-x86_64-w64-mingw32-1
building: expat-2.1.0-x86_64-w64-mingw32-1
sizes: expat-2.1.0-x86_64-w64-mingw32-1: 9.229MB (installed: 2.037MB)
cleaning: expat-2.1.0-x86_64-w64-mingw32-1
reporting: devel/expat-2.1.0-1.cfg -> expat-2.1.0-x86_64-w64-mingw32-1.txt
reporting: devel/expat-2.1.0-1.cfg -> expat-2.1.0-x86_64-w64-mingw32-1.xml
config: tools/rtems-gdb-8.3-1.cfg
error: shell macro failed: sh -c "/mingw64/bin/python2-config --ldflags | awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print "lib"substr($i,3)"*";}'": 1: }/python/{for(i=1;i<NF;++i)if(match($i,.*lpython.*)) print libsubstr($i,3)*;}': -c: line 0: unexpected EOF while looking for matching `
}/python/{for(i=1;i<NF;++i)if(match($i,.*lpython.*)) print libsubstr($i,3)*;}': -c: line 1: syntax error: unexpected end of file
Build FAILED
Build Set: Time 0:07:19.564000
Build FAILED

This happens when using Python3 and also when using Python2.

Change History (3)

comment:1 Changed on 09/05/19 at 23:24:07 by Chris Johns

The issue is due to the shell command string containing " character that are not escaped. On MinGW these commands have to use the MSYS2 shell and not the host's shell which is some form of cmd.exe. The command to invoke the MSYS2 shell is ...

https://git.rtems.org/rtems-source-builder/tree/source-builder/sb/config.py#n430

The wrapping of the string in "" effects the shell's processing.

comment:2 Changed on 09/05/19 at 23:31:43 by Chris Johns

The failing command on Windows is:

sh -c "/mingw64/bin/python2-config --ldflags | awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print "lib"substr($i,3)"*";}'"

comment:3 Changed on 09/06/19 at 01:53:14 by Chris Johns <chrisj@…>

Resolution: fixed
Status: assignedclosed

In [changeset:"d8b2719ae6f71c3380fc32aa34ac0796b98af236/rtems-source-builder" d8b2719/rtems-source-builder]:

sb/config: Escape double quotes on Windows for shell macros

Closes #3792

Note: See TracTickets for help on using tickets.