Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: d112b440 by Sven Tennie at 2026-02-07T10:47:56-05:00 Add cabal.project file to generate-ci This fixes the HLS setup for our CI code generation script (generate-ci). The project file simply makes `generate-ci` of the cabal file discoverable. - - - - - 5339f6f0 by Andreas Klebinger at 2026-02-07T10:48:40-05:00 CI: Don't collapse test results. This puts test output back into the primary test log instead of a subsection removing the need to expand a section to see test results. While the intention was good in practice the old behaviour mostly wastes time by requiring expansion of the section. Fixes #26882 - - - - - 0e1cd2e0 by Evan Piro at 2026-02-08T10:35:16-08:00 Linker.MacOS reduce dynflags import - - - - - 580be06d by Michael Alan Dorman at 2026-02-08T20:07:43-05:00 Remove `extra_src_files` variable from `testsuite/driver/testlib.py` While reading through the test harness code, I noticed this variable with a TODO attached that referenced #12223. Although that bug is closed, it strongly implied that this special-case variable that only affected a single test was expected to be removed at some point. I also looked at 3415bcaa0b1903b5e12dfaadb5b774718e406eab---where it was added---whose commit message suggested that it would have been desirable to remove it, but that there were special circumstances that meant it had to remain (though it doesn't elucidate what those special circumstances are). However, the special circumstances were mentioned as if the test was in a different location than is currently is, so I decided to try changing the test to use the standard `extra_files` mechanism, which works in local testing. This also seems like a reasonable time to remove the script that was originally used in the transition, since it doesn't really serve a purpose anymore. - - - - - 6 changed files: - .gitlab/ci.sh - + .gitlab/generate-ci/cabal.project - compiler/GHC/Linker/MacOS.hs - − testsuite/driver/kill_extra_files.py - testsuite/driver/testlib.py - testsuite/tests/process/all.T Changes: ===================================== .gitlab/ci.sh ===================================== @@ -655,7 +655,6 @@ function install_bindist() { } function test_hadrian() { - start_section test-hadrian "Test via Hadrian" check_msys2_deps _build/stage1/bin/ghc --version check_release_build @@ -777,7 +776,6 @@ function test_hadrian() { info "STAGE2_TEST=$?" fi - end_section test-hadrian } function summarise_hi_files() { ===================================== .gitlab/generate-ci/cabal.project ===================================== @@ -0,0 +1 @@ +packages: . ===================================== compiler/GHC/Linker/MacOS.hs ===================================== @@ -11,8 +11,6 @@ import GHC.Platform import GHC.Linker.Config -import GHC.Driver.DynFlags - import GHC.Unit.Types import GHC.Unit.State import GHC.Unit.Env @@ -23,6 +21,7 @@ import GHC.Runtime.Interpreter import GHC.Utils.Exception import GHC.Utils.Logger +import GHC.Driver.Session import Data.List (isPrefixOf, nub, sort, intersperse, intercalate) import Data.Char ===================================== testsuite/driver/kill_extra_files.py deleted ===================================== @@ -1,101 +0,0 @@ -#!/usr/bin/env python3 -from typing import Dict, List, Set, NamedTuple - -import os -import subprocess -import ast - -import extra_files -extra_src_files = extra_files.extra_src_files # type: Dict[str, List[str]] - -found_tests = set() # type: Set[str] -fixed_tests = set() # type: Set[str] - -def extras(name: str) -> str: - return 'extra_files(%s)' % (extra_src_files[name],) - -def list_extras(name: str, col: int) -> str: - return extras(name) + ',\n' + ' ' * (col + 1) - -def find_all_T_files(basedir: bytes) -> List[bytes]: - result = [] # type: List[bytes] - for dirpath, dirnames, filenames in os.walk(basedir): - for f in filenames: - if f.endswith(b'.T'): - result.append(os.path.join(dirpath, f)) - return result - -# Delete del bytes from (line, col) and then insert the string ins there. -Fixup = NamedTuple('Fixup', [('line', int), - ('col', int), - ('delete', int), - ('insert', str)]) - -class TestVisitor(ast.NodeVisitor): - def __init__(self) -> None: - self.fixups = [] # type: List[Fixup] - - def visit_Call(self, node: ast.AST) -> None: - self.generic_visit(node) - assert isinstance(node, ast.Call) - - if isinstance(node.func, ast.Name) and node.func.id == 'test': - assert(len(node.args) == 4) - name_expr, setup, test_fn, args = node.args - if not(isinstance(name_expr, ast.Str)): - return - name = name_expr.s - if name in extra_src_files: - found_tests.add(name) - if isinstance(setup, ast.Name): - if setup.id == 'normal': - # Kill it - self.fixups.append(Fixup( - line=setup.lineno, col=setup.col_offset, - delete=len(setup.id), insert=extras(name))) - else: - # Make a lit - self.fixups.append(Fixup( - line=setup.lineno, col=setup.col_offset, - delete=0, - insert='[' + list_extras(name, setup.col_offset))) - self.fixups.append(Fixup( - line=setup.lineno, - col=setup.col_offset + len(setup.id), - delete=0, insert=']')) - fixed_tests.add(name) - elif isinstance(setup, ast.List): - # Insert into list at start - if not setup.elts: - ins = extras(name) # no need for comma, newline - # Don't try to delete the list because someone - # might have written "[ ]" for some reason - else: - ins = list_extras(name, setup.col_offset) - self.fixups.append(Fixup( - line=setup.lineno, col=setup.col_offset + 1, - delete=0, insert=ins)) - fixed_tests.add(name) - else: - assert False # we fixed them all manually already - -basedir = subprocess.check_output(['git', 'rev-parse', '--show-toplevel']) -basedir = basedir[0:-1] # delete trailing newline -print(basedir) -for f in find_all_T_files(basedir): - print(f) - text = open(f).read() - mod = ast.parse(text) - tv = TestVisitor() - tv.visit(mod) - - lines = text.split('\n') - if not tv.fixups: - # Don't rewrite files unnecessarily - # (libraries/Win32 has Windows line endings) - continue - for fixup in reversed(tv.fixups): - l = list(lines[fixup.line-1]) - l[fixup.col:fixup.col + fixup.delete] = fixup.insert - lines[fixup.line-1] = ''.join(l) - open(f, 'w').write('\n'.join(lines)) ===================================== testsuite/driver/testlib.py ===================================== @@ -31,7 +31,6 @@ import testutil from cpu_features import have_cpu_feature import perf_notes as Perf from perf_notes import MetricChange, PerfStat, StatsException, AlwaysAccept, RelativeMetricAcceptanceWindow -extra_src_files = {'T4198': ['exitminus1.c']} # TODO: See #12223 from my_typing import * @@ -1644,7 +1643,7 @@ async def test_common_work(name: TestName, opts, if f.startswith(name) and not f == name and not f.endswith(testdir_suffix) and not os.path.splitext(f)[1] in do_not_copy) - for filename in (opts.extra_files + extra_src_files.get(name, [])): + for filename in (opts.extra_files): if filename.startswith('/'): framework_fail(name, None, 'no absolute paths in extra_files please: ' + filename) ===================================== testsuite/tests/process/all.T ===================================== @@ -27,6 +27,7 @@ test('T3231', ['']) test('T4198', [pre_cmd('{compiler} exitminus1.c -no-hs-main -o exitminus1'), + extra_files(['exitminus1.c']), js_broken(22349), req_process], compile_and_run, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fc6968179641973af5adf5589e71d14... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fc6968179641973af5adf5589e71d14... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)