Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: d523ded8 by Andreas Klebinger at 2026-02-04T04:56:06-05:00 testsuite: Explicitly use utf-8 encoding in rts-includes linter. Not doing so caused failures on windows, as python failed to pick a reasonable encoding even with locale set. Fixes #26850 - - - - - f2387447 by Zubin Duggal at 2026-02-04T04:56:06-05:00 Bump transformers submodule to 0.6.3.0 Fixes #26790 - - - - - 2 changed files: - libraries/transformers - testsuite/tests/linters/regex-linters/check-rts-includes.py Changes: ===================================== libraries/transformers ===================================== @@ -1 +1 @@ -Subproject commit cee47cca7705edafe0a5839439e679edbd61890a +Subproject commit 0d615bc2457d5d2c695dcfdb902d88c1225beff3 ===================================== testsuite/tests/linters/regex-linters/check-rts-includes.py ===================================== @@ -12,12 +12,16 @@ import re INCLUDE_RE = re.compile('# *include ([<"][^">]+[>"])') def get_includes(file: Path) -> List[Tuple[int, str]]: - txt = file.read_text() - return [ (line_no+1, m.group(1) ) - for (line_no, line) in enumerate(txt.split('\n')) - for m in [INCLUDE_RE.match(line)] - if m is not None - if m.group(1) != "rts/PosixSource.h"] + try: + txt = file.read_text(encoding="utf-8") + return [ (line_no+1, m.group(1) ) + for (line_no, line) in enumerate(txt.split('\n')) + for m in [INCLUDE_RE.match(line)] + if m is not None + if m.group(1) != "rts/PosixSource.h"] + except Exception as e: + e.add_note(f"While reading includes from {file}") + raise def in_rts_dir(path: Path) -> bool: return len(path.parts) > 0 and path.parts[0] == 'rts' @@ -40,9 +44,14 @@ class RtsHIncludeOrderLinter(Linter): '"ghcplatform.h"', } - includes = get_includes(path) - headers = [x[1] for x in includes] - lines = path.read_text().split('\n') + try: + includes = get_includes(path) + headers = [x[1] for x in includes] + lines = path.read_text(encoding="utf-8").split('\n') + # #26850 + except Exception as e: + e.add_note(f"Error while decoding path {path}") + raise e if '"PosixSource.h"' in headers: for line_no, header in includes: @@ -69,18 +78,22 @@ class PrivateIncludeLinter(Linter): def lint(self, path: Path): private = False - lines = path.read_text().split('\n') - for line_no, include in get_includes(path): - if include == '"BeginPrivate.h"': - private = True - elif include == '"EndPrivate.h"': - private = False - elif private: - self.add_warning(Warning( - path=path, - line_no=line_no, - line_content=lines[line_no-1], - message='System header %s found inside of <BeginPrivate.h> block' % include)) + try: + lines = path.read_text(encoding="utf-8").split('\n') + for line_no, include in get_includes(path): + if include == '"BeginPrivate.h"': + private = True + elif include == '"EndPrivate.h"': + private = False + elif private: + self.add_warning(Warning( + path=path, + line_no=line_no, + line_content=lines[line_no-1], + message='System header %s found inside of <BeginPrivate.h> block' % include)) + except Exception as e: + e.add_note(f"While handling {path}") + raise e linters = [ RtsHIncludeOrderLinter(), View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4628176246bfb9bb8a31fa782653ef0... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4628176246bfb9bb8a31fa782653ef0... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)