summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-08-30 03:27:57 +0200
committerandromeda <andromeda@lenovo>2026-08-30 03:27:57 +0200
commit50ec74ff09bca2f5b38d0c80b7d3ef788675c23b (patch)
treede1ea7dfa059144ba11d3c89a779b230c49ac8d5
parent7d40506d00a02c6b68f69b3761c1cfffaa98a642 (diff)
[ghc-9.14] add bootstrapped ghc@9.14.1
-rw-r--r--andromeda/packages/haskell.scm83
-rw-r--r--patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff64
-rw-r--r--patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff50
3 files changed, 197 insertions, 0 deletions
diff --git a/andromeda/packages/haskell.scm b/andromeda/packages/haskell.scm
index 9e3ec0f..c4509ac 100644
--- a/andromeda/packages/haskell.scm
+++ b/andromeda/packages/haskell.scm
@@ -1,6 +1,7 @@
(define-module (andromeda packages haskell)
#:use-module (gnu packages)
#:use-module (gnu packages haskell)
+ #:use-module (gnu packages llvm)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix packages)
@@ -75,3 +76,85 @@
(files (list (string-append "lib/ghc-" version)))
(file-pattern ".*\\.conf\\.d$")
(file-type 'directory)))))))
+
+(define-public ghc-9.14
+ (let ((base ghc-9.12))
+ (package
+ (inherit base)
+ (name "ghc")
+ (version "9.14.1")
+ (source
+ (origin
+ (patches (list (local-file "../../patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff")))
+ (method url-fetch)
+ (uri (string-append "https://downloads.haskell.org/~ghc/" version
+ "/ghc-" version "-src.tar.xz"))
+ (sha256
+ (base32
+ "0xqy20y6kpb10f99zains403va3ainiqf9wz52im8rgqkaf7g0ra"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments base)
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (replace 'check
+ (lambda* (#:key (tests? #t) (parallel-tests? #f) (make-flags '())
+ #:allow-other-keys)
+ (if tests?
+ (apply invoke "_build/bin/hadrian"
+ `(,@(if parallel-tests?
+ (list (string-append
+ "-j"
+ (number->string (parallel-job-count))))
+ '())
+ ,@make-flags
+ "test"
+ ,(string-append
+ "--broken-test=" ; marks broken tests that totally fail
+ (string-join
+ (list "callstack001"
+ "callstack002"
+ "T15904"
+ "T25204"
+ "T16521"
+ "T27225" ; unpatched shebang in testsuite/tests/ghc-api/settings-escape/T25204.hs
+ "T27225b"
+ "T7275"
+ "toplevel_scc_1")))
+ ,(string-append ; skips tests that only partially fail
+ "--skip-test="
+ (string-join
+ (list "CallerCc1"
+ "scc001")))
+ "--skip-perf"))
+ (format #t "test suite not run~%"))))))))
+ (native-inputs
+ (modify-inputs (package-native-inputs base)
+ (replace "ghc" base)
+ (prepend llvm-20)
+ (prepend (specification->package "clang@20.1.8"))
+ (replace "ghc-testsuite.tar.xz"
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://downloads.haskell.org/~ghc/"
+ version "/ghc-" version "-testsuite.tar.xz"))
+ (sha256
+ (base32
+ "1va5ls4ng32hq8236w2aq5k0gjwxzdmwgfjf6b8z7pgpy0hzrbl4"))
+ (patches (append (search-patches "ghc-testsuite-recomp015-execstack.patch") (list (local-file "../../patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff"))))))
+ (replace "hadrian-bootstrap-sources.tar.gz"
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://downloads.haskell.org/~ghc/" version
+ "/hadrian-bootstrap-sources/"
+ "hadrian-bootstrap-sources-"
+ (package-version base) ".tar.gz"))
+ (sha256
+ (base32
+ "11sz4wlibzbndpddfyd8gi1w5fkvq34xiq48kqnilgddvd5mj5yw"))))))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "GHC_PACKAGE_PATH")
+ (files (list (string-append "lib/ghc-" version)))
+ (file-pattern ".*\\.conf\\.d$")
+ (file-type 'directory)))))))
diff --git a/patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff b/patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff
new file mode 100644
index 0000000..1a5a365
--- /dev/null
+++ b/patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff
@@ -0,0 +1,64 @@
+diff --git a/hadrian/src/CommandLine.hs b/hadrian/src/CommandLine.hs
+index 6b5688059158..39b5b475c52f 100644
+--- a/hadrian/src/CommandLine.hs
++++ b/hadrian/src/CommandLine.hs
+@@ -71,6 +71,7 @@ data TestArgs = TestArgs
+ , testJUnit :: Maybe FilePath
+ , testMetricsFile:: Maybe FilePath
+ , testOnly :: [String]
++ , testSkip :: [String]
+ , testOnlyPerf :: Bool
+ , testSkipPerf :: Bool
+ , testRootDirs :: [FilePath]
+@@ -100,6 +101,7 @@ defaultTestArgs = TestArgs
+ , testJUnit = Nothing
+ , testMetricsFile= Nothing
+ , testOnly = []
++ , testSkip = []
+ , testOnlyPerf = False
+ , testSkipPerf = False
+ , testRootDirs = []
+@@ -191,6 +193,13 @@ readTestOnly tests = Right $ \flags ->
+ where tests' = maybe [] words tests
+ tests'' flags = testOnly (testArgs flags) ++ tests'
+
++readTestSkip :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
++readTestSkip tests = Right $ \flags ->
++ flags { testArgs = (testArgs flags) { testSkip = tests'' flags } }
++
++ where tests' = maybe [] words tests
++ tests'' flags = testSkip (testArgs flags) ++ tests'
++
+ readTestOnlyPerf :: Either String (CommandLineArgs -> CommandLineArgs)
+ readTestOnlyPerf = Right $ \flags -> flags { testArgs = (testArgs flags) { testOnlyPerf = True } }
+
+@@ -306,6 +315,8 @@ optDescrs =
+ "Output testsuite performance metrics summary."
+ , Option [] ["only"] (OptArg readTestOnly "TESTS")
+ "Test cases to run."
++ , Option [] ["skip-test"] (OptArg readTestSkip "TESTS")
++ "Test cases to skip."
+ , Option [] ["only-perf"] (NoArg readTestOnlyPerf)
+ "Only run performance tests."
+ , Option [] ["skip-perf"] (NoArg readTestSkipPerf)
+diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs
+index 0531294ea961..b890282059b8 100644
+--- a/hadrian/src/Settings/Builders/RunTest.hs
++++ b/hadrian/src/Settings/Builders/RunTest.hs
+@@ -360,6 +360,7 @@ getTestArgs = do
+ haveDocs <- willDocsBeBuilt
+ let configFileArg= ["--config-file=" ++ (testConfigFile args)]
+ testOnlyArg = map ("--only=" ++) (testOnly args ++ testEnvTargets)
++ testSkipArg = map ("--skip=" ++) (testSkip args)
+ onlyPerfArg = if testOnlyPerf args
+ then Just "--only-perf-tests"
+ else Nothing
+@@ -399,6 +400,6 @@ getTestArgs = do
+ inTreeArg = [ "-e", "config.in_tree_compiler=" ++
+ show (isInTreeCompiler (testCompiler args) || testHasInTreeFiles args) ]
+
+- pure $ configFileArg ++ testOnlyArg ++ speedArg
++ pure $ configFileArg ++ testOnlyArg ++ testSkipArg ++ speedArg
+ ++ catMaybes [ onlyPerfArg, skipPerfArg, summaryArg
+ , junitArg, metricsArg, verbosityArg ]
+ ++ configArgs ++ wayArgs ++ compilerArg ++ ghcPkgArg \ No newline at end of file
diff --git a/patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff b/patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff
new file mode 100644
index 0000000..5702f01
--- /dev/null
+++ b/patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff
@@ -0,0 +1,50 @@
+diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
+index 36bc6a454a87..8d4a2a10c1b8 100644
+--- a/testsuite/driver/runtests.py
++++ b/testsuite/driver/runtests.py
+@@ -79,6 +79,7 @@ def get_compiler_info() -> TestConfig:
+ parser.add_argument("--unexpected-output-dir", help="directory in which to place unexpected output")
+ parser.add_argument("--target-wrapper", help="wrapper executable to use when executing binaries compiled for the target")
+ parser.add_argument("--only", action="append", help="just this test (can be give multiple --only= flags)")
++parser.add_argument("--skip", action="append", help="skip this test (can be given multiple --skip= flags)")
+ parser.add_argument("--way", action="append", help="just this way")
+ parser.add_argument("--skipway", action="append", help="skip this way")
+ parser.add_argument("--threads", type=int, help="threads to run simultaneously")
+@@ -135,6 +136,9 @@ def get_compiler_info() -> TestConfig:
+ config.only = args.only
+ config.run_only_some_tests = True
+
++if args.skip:
++ config.skip = set(args.skip)
++
+ if args.way:
+ for way in args.way:
+ if way not in all_ways:
+diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
+index b41a7e084dec..bff8e7d5d695 100644
+--- a/testsuite/driver/testglobals.py
++++ b/testsuite/driver/testglobals.py
+@@ -31,6 +31,9 @@ def __init__(self):
+ self.run_only_some_tests = False
+ self.only = set()
+
++ # Skip these tests
++ self.skip = set()
++
+ # Don't fail on out-of-tolerance stat failures
+ self.ignore_perf_increases = False
+ self.ignore_perf_decreases = False
+diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
+index c74f5d4346c9..97631734ac7e 100644
+--- a/testsuite/driver/testlib.py
++++ b/testsuite/driver/testlib.py
+@@ -1526,6 +1526,9 @@ def test(name: TestName,
+ # report on any tests we couldn't find and error out.
+ config.only.remove(name)
+
++ if name in config.skip:
++ return
++
+ # Make a deep copy of the default_testopts, as we need our own copy
+ # of any dictionaries etc inside it. Otherwise, if one test modifies
+ # them, all tests will see the modified version!