Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
incompatible_windows_escape_python_args: on Windows, enables correct escaping of py_binary.args and py_test.args #7974
Add --incompatible_windows_escape_python_args flag (default: false).
This is a no-op on Linux/macOS.
On Linux/macOS/non-Windows: the flag is a no-op.
On Windows: This flag affects how py_binary and py_test targets are built, how their launcher escapes command line flags. When this flag is true, the launcher escapes command line flags using Windows-style escaping (correct behavior). When the flag is false, the launcher uses Bash-style escaping (buggy behavior).
The output of a py_binary or py_test is an
To build py_binary/py_test rules, Bazel appends the zip file and some metadata to the launcher. The launcher reads the data from its tail, then sets up the environment and runs Python, passing the command line arguments along.
However the launcher escapes arguments badly. This is the same bug for Python as #7486 was for Java. The solution is similar: use
Related bug: #7958
The new flag
None, as of 2019-04-08.
We don't expect any breakages when this flag is enabled. However if it breaks your build or if it breaks your py_binaries or py_tests, please let us know so we can help fixing it and provide a migration recipe.