Skip to content

[lldb] Remove python helper getCompilerBinary() #100660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kendalharland
Copy link
Contributor

@kendalharland kendalharland commented Jul 25, 2024

This causes a number of tests be UNRESOLVED on Windows if getCompiler() has a space in the name, because getCompilerBinary() unconditionally splits on whitespace and returns the first result, which might just be"C:\Program" if using a compiler such as clang-cl cl from the absolute path to Visual studio's installation directory.

@llvmbot
Copy link
Member

llvmbot commented Jul 25, 2024

@llvm/pr-subscribers-lldb

Author: Kendal Harland (kendalharland)

Changes

This causes a number of tests be UNRESOLVED on Windows if getCompiler() has a space in the name, because getCompilerBinary() unconditionally splits on whitespace and returns the first result, which might just be"C:\Program" if using a compiler such as clang-cl cl from Visual studio's installation directory.


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

1 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/lldbplatformutil.py (+1-6)
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index e3c6fd1a99568..0bbe1db424630 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -266,16 +266,11 @@ def getCompiler():
     return module.getCompiler()
 
 
-def getCompilerBinary():
-    """Returns the compiler binary the test suite is running with."""
-    return getCompiler().split()[0]
-
-
 def getCompilerVersion():
     """Returns a string that represents the compiler version.
     Supports: llvm, clang.
     """
-    compiler = getCompilerBinary()
+    compiler = getCompiler()
     version_output = subprocess.check_output([compiler, "--version"], errors="replace")
     m = re.search("version ([0-9.]+)", version_output)
     if m:

@DavidSpickett DavidSpickett changed the title Remove python helper getCompilerBinary() [lldb] Remove python helper getCompilerBinary() Jul 26, 2024
@DavidSpickett
Copy link
Collaborator

Seems fine to me, but there is a use of it in lldb/packages/Python/lldbsuite/test/lldbtest.py that should also be removed.

@DavidSpickett
Copy link
Collaborator

And the CI failure is one of our old friends:

Timed Out Tests (1):
  lldb-api :: functionalities/fork/concurrent_vfork/TestConcurrentVFork.py

That you can safely ignore.

@kendalharland
Copy link
Contributor Author

Seems fine to me, but there is a use of it in lldb/packages/Python/lldbsuite/test/lldbtest.py that should also be removed.

Not sure how I missed that one. Ty!

@kendalharland kendalharland force-pushed the kendal/remove-get-compiler-binary branch from c779fac to 6769752 Compare July 26, 2024 17:41
@kendalharland
Copy link
Contributor Author

Thanks for the reviews! I'll need help merging from someone with write access

@JDevlieghere JDevlieghere merged commit 3e593b9 into llvm:main Jul 26, 2024
4 of 5 checks passed
@kendalharland kendalharland deleted the kendal/remove-get-compiler-binary branch August 8, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants