[libcxx-commits] [libcxx] [libcxx] [test] Quote the python executable in the executor (PR #68208)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 4 04:31:55 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

<details>
<summary>Changes</summary>

This reapplies the change from
c218c80c730a14a1cbcebd588b18220a879702c6, which was lost in the refactoring in 78d649a417b48cb8a2ba2e755f0e7c8fb8b1bb83.

On Windows, the Python interpreter is by default installed in a path like "C:\Program Files\Python38\python.exe", which requires quoting when included in a concatenated command string (as opposed to a command list, where each argument is a separate element).

This doesn't show up in the CI environments as they use Python installed in a different directory, like C:\Python.

---
Full diff: https://github.com/llvm/llvm-project/pull/68208.diff


1 Files Affected:

- (modified) libcxx/utils/libcxx/test/params.py (+1-1) 


``````````diff
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index d4e4b722347d623..16dcc837108c550 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -320,7 +320,7 @@ def getStdFlag(cfg, std):
     Parameter(
         name="executor",
         type=str,
-        default=f"{sys.executable} {Path(__file__).resolve().parent.parent.parent / 'run.py'}",
+        default=f"\"{sys.executable}\" {Path(__file__).resolve().parent.parent.parent / 'run.py'}",
         help="Custom executor to use instead of the configured default.",
         actions=lambda executor: [AddSubstitution("%{executor}", executor)],
     )

``````````

</details>


https://github.com/llvm/llvm-project/pull/68208


More information about the libcxx-commits mailing list