msys2 command line argument syntax
See original GitHub issueI’ve been using msys2 to build Python wheels in python-flint and it works excellently so many thanks!
I did have one issue though that was awkward (at the time) to diagnose and fix and i wonder if there is a better way to solve this in general. The problem is that I wanted to call msys2 and ask it to run a shell script with command line arguments that are Windows paths e.g. like:
> msys2 -c bin/myscript.sh C:\Path\To\File
The msys2 command expects a single command line argument though so it needed to be more like:
> msys2 -c "bin/myscript.sh C:\Path\To\File"
Now the problem is (I think) that msys2 parses this as bash syntax so my script ends up being called like:
$ bin/myscript.sh C:PathToFile
I could work around this with an extra batch file that turns the arguments into environment variables: https://github.com/fredrik-johansson/python-flint/blob/e08d3dfc236f6b38fcc11bcde5c621993761a806/bin/cibw_repair_wheel_command_windows.bat#L2-L5
Could there be a way to invoke the msys2 command and have it just take separate string arguments and treat them faithfully as the strings that they are? Perhaps something like:
> msys2 -cc bin/myscript.sh C:\Path\To\File
Note that I can’t just escape the slashes etc because the paths are generated indirectly: https://github.com/fredrik-johansson/python-flint/blob/e08d3dfc236f6b38fcc11bcde5c621993761a806/.github/workflows/buildwheel.yml#L52-L53
Issue Analytics
- State:
- Created 9 months ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
It should be equivalent to https://gist.github.com/lazka/6d89a3cd85b0a64112f18c4cb7ef5f91
The problem is that I’m passing command lines into another tool: https://github.com/fredrik-johansson/python-flint/blob/e08d3dfc236f6b38fcc11bcde5c621993761a806/.github/workflows/buildwheel.yml#L52-L53 I don’t think that setting the shell for GA to msys will change the way that cibuildwheel runs the commands.