Comments (6)
The upgrade to PowerShell 7.4.x actions/runner-images#9115 might be the cause here. The older version is 7.2.x and PowerShell 7.4 changed how arguments are escaped. In particularly how double quotes are treated in an argument value has changed. For example the first example was run with pwsh 7.2.18 while the second example with 7.4.1.
PS C:\Users\vagrant-domain\Downloads\PowerShell-7.2.18-win-x64> C:\temp\print_argv.exe --option '""'
"C:\temp\print_argv.exe" --option ""
[0] --option
[1]
PS C:\Users\vagrant-domain\Downloads\PowerShell-7.4.1-win-x64> C:\temp\print_argv.exe --option '""'
"C:\temp\print_argv.exe" --option "\"\""
[0] --option
[1] ""
There are three things you can do to go back to the old behaviour:
- Don't use the inner double quotes, pwsh will quote the empty string for you when calling the exe
- Set Set `$PSNativeCommandArgumentPassing = 'Legacy' https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.4#psnativecommandargumentpassing
- Have the underlying Python code being called here handle a literal string value of
""
as the--option
(and other affected args) value
PS C:\Users\vagrant-domain\Downloads\PowerShell-7.4.1-win-x64> $PSNativeCommandArgumentPassing
Windows
PS C:\Users\vagrant-domain\Downloads\PowerShell-7.4.1-win-x64> C:\temp\print_argv.exe --option '""'
"C:\temp\print_argv.exe" --option "\"\""
[0] --option
[1] ""
PS C:\Users\vagrant-domain\Downloads\PowerShell-7.4.1-win-x64> C:\temp\print_argv.exe --option ''
"C:\temp\print_argv.exe" --option ""
[0] --option
[1]
PS C:\Users\vagrant-domain\Downloads\PowerShell-7.4.1-win-x64> $PSNativeCommandArgumentPassing = 'Legacy'
PS C:\Users\vagrant-domain\Downloads\PowerShell-7.4.1-win-x64> C:\temp\print_argv.exe --option '""'
"C:\temp\print_argv.exe" --option ""
[0] --option
[1]
Adding further fuel to that suggestion I can see the runner version of a working build is 20240122.1.0
and a failed build is 20240128.1.0
.
Image: windows-2022
Version: 20240122.1.0
Included Software: https://github.com/actions/runner-images/blob/win22/20240122.1/images/windows/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20240122.1
Image: windows-2022
Version: 20240128.1.0
Included Software: https://github.com/actions/runner-images/blob/win22/20240128.1/images/windows/Windows2022-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20240128.1
from cibuildwheel.
Does anyone remember/know why we double quote on powershell in the first place? I added it in #1346 but not sure it's needed, at least for non-paths. I think it might have been needed for paths with spaces?
from cibuildwheel.
The problem with --x "" --y
is that it resolves to --x
, --y
, rather that --x
, empty string, --y
. Is there a way to pass an empty string in powershell 7.3/7.4?
from cibuildwheel.
Is there a way to pass an empty string in powershell 7.3/7.4?
Yep see my 3 workarounds in #1740 (comment).
Essentially the new quoting rules will pass through the actual value that was bound in the pwsh binder and an empty string value will be quoted. You either need to change the code (and break 7.2 compatbility), revert back to the old argument quoting rules, or handle a double quote literal value in the Python argparse code. I went with option 2 in my PR because it is the simplest one available.
from cibuildwheel.
According to the docs, we could just use Python as a shell instead...? Though I can't remember the issue with Meson that's mentioned in the comment here.
from cibuildwheel.
You need cmd or powershell to get MSVC properly configured. If you run from other places, you get GCC instead. This affects other build systems too unless they look up MSVC via the registry.
from cibuildwheel.
Related Issues (20)
- "symbol not found" in MacOS arm64 wheels for C-extension dependent on NumPy HOT 2
- Sporadic timeouts in oci_container.py HOT 1
- Troubleshooting Python 3.12 uWSGI wheel HOT 16
- Note about `actions/upload-artifact@v4` HOT 25
- Feature Request: flag to skip build if there is not a numpy wheel available HOT 2
- Access environment variables in config-settings
- No build identifiers selected, even though build_config is cp312-* HOT 2
- [FR] Make it easier to run `cibuildwheel` against unlisted Python builds HOT 7
- Cross compilation yields x86-64 wheel HOT 1
- Failure on ubuntu22.04: sizeof(Big Struct) differs between binary wheel and local "pip install" HOT 1
- Ubuntu: ABI difference between pip install (SYSV) and cibuildwheel (GNU/Linux)? HOT 4
- How to cross-compile dylib on macos? HOT 4
- Multi-line test commands can spuriously pass HOT 4
- Update PyPy to 7.3.15 HOT 7
- Transient failures for Windows AMD64 builds when searching for `pyproject.toml` HOT 10
- Support arm64 macOS runner for GitHub Actions HOT 14
- Uninformative error message - Issue with Windows Build HOT 3
- Allow copying artifacts to `/output` in case of test failure on docker
- Conan package builds HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cibuildwheel.