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
-
5339f6f0
by Andreas Klebinger at 2026-02-07T10:48:40-05:00
-
0e1cd2e0
by Evan Piro at 2026-02-08T10:35:16-08:00
-
580be06d
by Michael Alan Dorman at 2026-02-08T20:07:43-05:00
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:
| ... | ... | @@ -655,7 +655,6 @@ function install_bindist() { |
| 655 | 655 | }
|
| 656 | 656 | |
| 657 | 657 | function test_hadrian() {
|
| 658 | - start_section test-hadrian "Test via Hadrian"
|
|
| 659 | 658 | check_msys2_deps _build/stage1/bin/ghc --version
|
| 660 | 659 | check_release_build
|
| 661 | 660 | |
| ... | ... | @@ -777,7 +776,6 @@ function test_hadrian() { |
| 777 | 776 | info "STAGE2_TEST=$?"
|
| 778 | 777 | |
| 779 | 778 | fi
|
| 780 | - end_section test-hadrian
|
|
| 781 | 779 | }
|
| 782 | 780 | |
| 783 | 781 | function summarise_hi_files() {
|
| 1 | +packages: . |
| ... | ... | @@ -11,8 +11,6 @@ import GHC.Platform |
| 11 | 11 | |
| 12 | 12 | import GHC.Linker.Config
|
| 13 | 13 | |
| 14 | -import GHC.Driver.DynFlags
|
|
| 15 | - |
|
| 16 | 14 | import GHC.Unit.Types
|
| 17 | 15 | import GHC.Unit.State
|
| 18 | 16 | import GHC.Unit.Env
|
| ... | ... | @@ -23,6 +21,7 @@ import GHC.Runtime.Interpreter |
| 23 | 21 | |
| 24 | 22 | import GHC.Utils.Exception
|
| 25 | 23 | import GHC.Utils.Logger
|
| 24 | +import GHC.Driver.Session
|
|
| 26 | 25 | |
| 27 | 26 | import Data.List (isPrefixOf, nub, sort, intersperse, intercalate)
|
| 28 | 27 | import Data.Char
|
| 1 | -#!/usr/bin/env python3
|
|
| 2 | -from typing import Dict, List, Set, NamedTuple
|
|
| 3 | - |
|
| 4 | -import os
|
|
| 5 | -import subprocess
|
|
| 6 | -import ast
|
|
| 7 | - |
|
| 8 | -import extra_files
|
|
| 9 | -extra_src_files = extra_files.extra_src_files # type: Dict[str, List[str]]
|
|
| 10 | - |
|
| 11 | -found_tests = set() # type: Set[str]
|
|
| 12 | -fixed_tests = set() # type: Set[str]
|
|
| 13 | - |
|
| 14 | -def extras(name: str) -> str:
|
|
| 15 | - return 'extra_files(%s)' % (extra_src_files[name],)
|
|
| 16 | - |
|
| 17 | -def list_extras(name: str, col: int) -> str:
|
|
| 18 | - return extras(name) + ',\n' + ' ' * (col + 1)
|
|
| 19 | - |
|
| 20 | -def find_all_T_files(basedir: bytes) -> List[bytes]:
|
|
| 21 | - result = [] # type: List[bytes]
|
|
| 22 | - for dirpath, dirnames, filenames in os.walk(basedir):
|
|
| 23 | - for f in filenames:
|
|
| 24 | - if f.endswith(b'.T'):
|
|
| 25 | - result.append(os.path.join(dirpath, f))
|
|
| 26 | - return result
|
|
| 27 | - |
|
| 28 | -# Delete del bytes from (line, col) and then insert the string ins there.
|
|
| 29 | -Fixup = NamedTuple('Fixup', [('line', int),
|
|
| 30 | - ('col', int),
|
|
| 31 | - ('delete', int),
|
|
| 32 | - ('insert', str)])
|
|
| 33 | - |
|
| 34 | -class TestVisitor(ast.NodeVisitor):
|
|
| 35 | - def __init__(self) -> None:
|
|
| 36 | - self.fixups = [] # type: List[Fixup]
|
|
| 37 | - |
|
| 38 | - def visit_Call(self, node: ast.AST) -> None:
|
|
| 39 | - self.generic_visit(node)
|
|
| 40 | - assert isinstance(node, ast.Call)
|
|
| 41 | - |
|
| 42 | - if isinstance(node.func, ast.Name) and node.func.id == 'test':
|
|
| 43 | - assert(len(node.args) == 4)
|
|
| 44 | - name_expr, setup, test_fn, args = node.args
|
|
| 45 | - if not(isinstance(name_expr, ast.Str)):
|
|
| 46 | - return
|
|
| 47 | - name = name_expr.s
|
|
| 48 | - if name in extra_src_files:
|
|
| 49 | - found_tests.add(name)
|
|
| 50 | - if isinstance(setup, ast.Name):
|
|
| 51 | - if setup.id == 'normal':
|
|
| 52 | - # Kill it
|
|
| 53 | - self.fixups.append(Fixup(
|
|
| 54 | - line=setup.lineno, col=setup.col_offset,
|
|
| 55 | - delete=len(setup.id), insert=extras(name)))
|
|
| 56 | - else:
|
|
| 57 | - # Make a lit
|
|
| 58 | - self.fixups.append(Fixup(
|
|
| 59 | - line=setup.lineno, col=setup.col_offset,
|
|
| 60 | - delete=0,
|
|
| 61 | - insert='[' + list_extras(name, setup.col_offset)))
|
|
| 62 | - self.fixups.append(Fixup(
|
|
| 63 | - line=setup.lineno,
|
|
| 64 | - col=setup.col_offset + len(setup.id),
|
|
| 65 | - delete=0, insert=']'))
|
|
| 66 | - fixed_tests.add(name)
|
|
| 67 | - elif isinstance(setup, ast.List):
|
|
| 68 | - # Insert into list at start
|
|
| 69 | - if not setup.elts:
|
|
| 70 | - ins = extras(name) # no need for comma, newline
|
|
| 71 | - # Don't try to delete the list because someone
|
|
| 72 | - # might have written "[ ]" for some reason
|
|
| 73 | - else:
|
|
| 74 | - ins = list_extras(name, setup.col_offset)
|
|
| 75 | - self.fixups.append(Fixup(
|
|
| 76 | - line=setup.lineno, col=setup.col_offset + 1,
|
|
| 77 | - delete=0, insert=ins))
|
|
| 78 | - fixed_tests.add(name)
|
|
| 79 | - else:
|
|
| 80 | - assert False # we fixed them all manually already
|
|
| 81 | - |
|
| 82 | -basedir = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'])
|
|
| 83 | -basedir = basedir[0:-1] # delete trailing newline
|
|
| 84 | -print(basedir)
|
|
| 85 | -for f in find_all_T_files(basedir):
|
|
| 86 | - print(f)
|
|
| 87 | - text = open(f).read()
|
|
| 88 | - mod = ast.parse(text)
|
|
| 89 | - tv = TestVisitor()
|
|
| 90 | - tv.visit(mod)
|
|
| 91 | - |
|
| 92 | - lines = text.split('\n')
|
|
| 93 | - if not tv.fixups:
|
|
| 94 | - # Don't rewrite files unnecessarily
|
|
| 95 | - # (libraries/Win32 has Windows line endings)
|
|
| 96 | - continue
|
|
| 97 | - for fixup in reversed(tv.fixups):
|
|
| 98 | - l = list(lines[fixup.line-1])
|
|
| 99 | - l[fixup.col:fixup.col + fixup.delete] = fixup.insert
|
|
| 100 | - lines[fixup.line-1] = ''.join(l)
|
|
| 101 | - open(f, 'w').write('\n'.join(lines)) |
| ... | ... | @@ -31,7 +31,6 @@ import testutil |
| 31 | 31 | from cpu_features import have_cpu_feature
|
| 32 | 32 | import perf_notes as Perf
|
| 33 | 33 | from perf_notes import MetricChange, PerfStat, StatsException, AlwaysAccept, RelativeMetricAcceptanceWindow
|
| 34 | -extra_src_files = {'T4198': ['exitminus1.c']} # TODO: See #12223
|
|
| 35 | 34 | |
| 36 | 35 | from my_typing import *
|
| 37 | 36 | |
| ... | ... | @@ -1644,7 +1643,7 @@ async def test_common_work(name: TestName, opts, |
| 1644 | 1643 | if f.startswith(name) and not f == name and
|
| 1645 | 1644 | not f.endswith(testdir_suffix) and
|
| 1646 | 1645 | not os.path.splitext(f)[1] in do_not_copy)
|
| 1647 | - for filename in (opts.extra_files + extra_src_files.get(name, [])):
|
|
| 1646 | + for filename in (opts.extra_files):
|
|
| 1648 | 1647 | if filename.startswith('/'):
|
| 1649 | 1648 | framework_fail(name, None,
|
| 1650 | 1649 | 'no absolute paths in extra_files please: ' + filename)
|
| ... | ... | @@ -27,6 +27,7 @@ test('T3231', |
| 27 | 27 | [''])
|
| 28 | 28 | test('T4198',
|
| 29 | 29 | [pre_cmd('{compiler} exitminus1.c -no-hs-main -o exitminus1'),
|
| 30 | + extra_files(['exitminus1.c']),
|
|
| 30 | 31 | js_broken(22349),
|
| 31 | 32 | req_process],
|
| 32 | 33 | compile_and_run,
|