[compiler-rt] [compiler-rt] [test] Consume stderr from the subprocess for getting page size (PR #168857)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 03:15:39 PST 2025


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/168857

This avoids dozens of instances of benign error messages being printed when running the tests on e.g. Windows:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: module 'os' has no attribute 'sysconf'

>From 18c7fc6570265bb1ed70f8f791dac1b473c6ccb7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Thu, 20 Nov 2025 11:09:20 +0000
Subject: [PATCH] [compiler-rt] [test] Consume stderr from the subprocess for
 getting page size

This avoids dozens of instances of benign error messages being
printed when running the tests on e.g. Windows:

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: module 'os' has no attribute 'sysconf'
---
 compiler-rt/test/lit.common.cfg.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index ea22fb0babc46..d18400e875779 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -970,6 +970,7 @@ def target_page_size():
             shell=True,
             stdin=subprocess.PIPE,
             stdout=subprocess.PIPE,
+            stderr=subprocess.PIPE,
         )
         out, err = proc.communicate(b'import os; print(os.sysconf("SC_PAGESIZE"))')
         return int(out)



More information about the llvm-commits mailing list