[compiler-rt] [compiler-rt][lit] Check glibc without external packages (PR #158387)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 17:53:43 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r origin/main...HEAD compiler-rt/test/lit.common.cfg.py
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- lit.common.cfg.py	2025-09-13 00:48:37.000000 +0000
+++ lit.common.cfg.py	2025-09-13 00:53:19.131969 +0000
@@ -707,10 +707,11 @@
     config.substitutions.append(("%device_rundir/", ""))
     config.substitutions.append(("%push_to_device", "echo "))
     config.substitutions.append(("%adb_shell", "echo "))
 
 if config.target_os == "Linux" and not config.android:
+
     def add_glibc_versions(major, minor):
         any_glibc = False
         for required in [
             (2, 19),
             (2, 27),
@@ -721,11 +722,13 @@
             (2, 38),
             (2, 40),
         ]:
             if (major, minor) >= required:
                 (required_major, required_minor) = required
-                config.available_features.add(f"glibc-{required_major}.{required_minor}")
+                config.available_features.add(
+                    f"glibc-{required_major}.{required_minor}"
+                )
                 any_glibc = True
             if any_glibc:
                 config.available_features.add("glibc")
 
     # detect whether we are using glibc, and which version
@@ -747,11 +750,11 @@
         env={"LANG": "C"},
     )
     try:
         sout, _ = cmd.communicate(b"#include <features.h>")
         m = dict(re.findall(r"#define (__GLIBC__|__GLIBC_MINOR__) (\d+)", str(sout)))
-        add_glibc_versions(int(m['__GLIBC__']), int(m['__GLIBC_MINOR__']))
+        add_glibc_versions(int(m["__GLIBC__"]), int(m["__GLIBC_MINOR__"]))
     except:
         pass
 
 sancovcc_path = os.path.join(config.llvm_tools_dir, "sancov")
 if os.path.exists(sancovcc_path):

``````````

</details>


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


More information about the llvm-commits mailing list