-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[lit] Use .format() over format strings literals
#155912
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces f-string formatting with .format() method calls for string formatting in the lit configuration file. The change affects error messages and feature name generation in PTXAS-related functions.
- Converts f-string literals to
.format()method calls for consistency - Updates RuntimeError messages and ToolSubst parameters
- Modifies feature name generation for PTXAS versions and architectures
|
@llvm/pr-subscribers-backend-nvptx Author: Justin Fargnoli (justinfargnoli) ChangesFull diff: https://github.com/llvm/llvm-project/pull/155912.diff 1 Files Affected:
diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index b23922d01483a..4a5d251f9a411 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -321,7 +321,7 @@ def ptxas_supported_isa_versions(ptxas, major_version, minor_version):
if supported_isa_versions:
return supported_isa_versions
if major_version >= 13:
- raise RuntimeError(f"ptxas {ptxas} does not support ISA version listing")
+ raise RuntimeError("ptxas {} does not support ISA version listing".format(ptxas))
cuda_version_to_isa_version = {
(12, 9): [(8, 8)],
@@ -404,7 +404,7 @@ def ptxas_supports_address_size_32(ptxas_executable):
return False
if "Missing .version directive at start of file" in result.stderr:
return True
- raise RuntimeError(f"Unexpected ptxas output: {result.stderr}")
+ raise RuntimeError("Unexpected ptxas output: {}".format(result.stderr))
def enable_ptxas(ptxas_executable):
@@ -412,20 +412,20 @@ def enable_ptxas(ptxas_executable):
tools.extend(
[
ToolSubst("%ptxas", ptxas_executable),
- ToolSubst("%ptxas-verify", f"{ptxas_executable} -c -"),
+ ToolSubst("%ptxas-verify", "{} -c -".format(ptxas_executable)),
]
)
major_version, minor_version = ptxas_version(ptxas_executable)
- config.available_features.add(f"ptxas-{major_version}.{minor_version}")
+ config.available_features.add("ptxas-{}.{}".format(major_version, minor_version))
for major, minor in ptxas_supported_isa_versions(
ptxas_executable, major_version, minor_version
):
- config.available_features.add(f"ptxas-isa-{major}.{minor}")
+ config.available_features.add("ptxas-isa-{}.{}".format(major, minor))
for sm in ptxas_supported_sms(ptxas_executable):
- config.available_features.add(f"ptxas-sm_{sm}")
+ config.available_features.add("ptxas-sm_{}".format(sm))
if ptxas_supports_address_size_32(ptxas_executable):
config.available_features.add("ptxas-ptr32")
|
|
@vvereschaka, is it possible for me to test out whether this fixes the issue? I attempted to test #154439 before submitting it, but it appeared that my branch needed to be from "llvm-project" (as opposed to my fork of "llvm-project") to be accepted by BuildBot. |
.format() over format strings literals
|
✅ With the latest revision this PR passed the Python code formatter. |
@justinfargnoli not a problem, I'll test it on the buildbot locally |
|
@justinfargnoli I still see the same error with these changes: |
|
Apologies, I misunderstood the error. I'll go forward with the revert. |
|
@justinfargnoli , here is a trace output on Windows for that part of code: the error message goes to stdout when using Win version of |
Fix #154439 (comment)