From 10afda0796cf543390fa5670d757b3ff7a558224 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 28 Oct 2025 13:16:20 -0700 Subject: [PATCH] [libc][hdrgen] Fix `includes` sorting in JSON emission (#165460) The JSON output support in hdrgen had a bug that tripped when used with headers that use special-case headers like to supply some times, as well as llvm-libc-types/*.h headers. --- libc/utils/hdrgen/hdrgen/header.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libc/utils/hdrgen/hdrgen/header.py b/libc/utils/hdrgen/hdrgen/header.py index 2118db6e5fb7..715d4b7c9b7e 100644 --- a/libc/utils/hdrgen/hdrgen/header.py +++ b/libc/utils/hdrgen/hdrgen/header.py @@ -241,7 +241,5 @@ class HeaderFile: return { "name": self.name, "standards": self.standards, - "includes": [ - str(file) for file in sorted({COMMON_HEADER} | self.includes()) - ], + "includes": sorted(str(file) for file in {COMMON_HEADER} | self.includes()), }