Sven Tennie pushed to branch wip/supersven/hadrian-cross-stage3 at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • .gitlab/generate-ci/gen_ci.hs
    ... ... @@ -283,6 +283,18 @@ crossConfig triple emulator configure_wrapper =
    283 283
                 , configureWrapper = configure_wrapper
    
    284 284
                 }
    
    285 285
     
    
    286
    +-- | cross-compiled compilers (build /= host/target)
    
    287
    +stage3CrossConfig :: String       -- ^ target triple
    
    288
    +            -> CrossEmulator -- ^ emulator for testing
    
    289
    +            -> Maybe String -- ^ Configure wrapper
    
    290
    +            -> BuildConfig
    
    291
    +stage3CrossConfig triple emulator configure_wrapper =
    
    292
    +    vanilla { crossTarget = Just triple
    
    293
    +            , crossStage  = Just 3
    
    294
    +            , crossEmulator = emulator
    
    295
    +            , configureWrapper = configure_wrapper
    
    296
    +            }
    
    297
    +
    
    286 298
     llvm :: BuildConfig
    
    287 299
     llvm = vanilla { llvmBootstrap = True }
    
    288 300
     
    
    ... ... @@ -370,6 +382,8 @@ testEnv arch opsys bc =
    370 382
         , ["zstd"  | withZstd bc ]
    
    371 383
         , ["no_tntc"  | not (tablesNextToCode bc) ]
    
    372 384
         , ["cross_"++triple  | Just triple <- pure $ crossTarget bc ]
    
    385
    +    -- TODO: Is there something better than `show` for this?
    
    386
    +    , ["stage_" ++ show stage | Just stage <- pure (crossStage bc), Just triple <- pure (crossTarget bc), "riscv" `isInfixOf` triple ]
    
    373 387
         , [flavourString (mkJobFlavour bc)]
    
    374 388
         ]
    
    375 389
     
    
    ... ... @@ -1290,9 +1304,12 @@ cross_jobs = [
    1290 1304
         -- x86 -> aarch64
    
    1291 1305
         validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing)
    
    1292 1306
     
    
    1293
    -    -- x86_64 -> riscv
    
    1307
    +    -- x86_64 (build/host) -> riscv (target)
    
    1294 1308
       , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian12Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing))
    
    1295 1309
     
    
    1310
    +    -- x86_64 (build) -> riscv (host/target)
    
    1311
    +  , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian12Riscv) (stage3CrossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing))
    
    1312
    +
    
    1296 1313
         -- x86_64 -> loongarch64
    
    1297 1314
       , addValidateRule LoongArch64 (validateBuilds Amd64 (Linux Ubuntu2404LoongArch64) (crossConfig "loongarch64-linux-gnu" (Emulator "qemu-loongarch64 -L /usr/loongarch64-linux-gnu") Nothing))
    
    1298 1315
     
    

  • .gitlab/jobs.yaml
    ... ... @@ -2442,7 +2442,7 @@
    2442 2442
           "XZ_OPT": "-9"
    
    2443 2443
         }
    
    2444 2444
       },
    
    2445
    -  "nightly-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate": {
    
    2445
    +  "nightly-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate": {
    
    2446 2446
         "after_script": [
    
    2447 2447
           ".gitlab/ci.sh save_cache",
    
    2448 2448
           ".gitlab/ci.sh save_test_output",
    
    ... ... @@ -2453,7 +2453,7 @@
    2453 2453
         "artifacts": {
    
    2454 2454
           "expire_in": "8 weeks",
    
    2455 2455
           "paths": [
    
    2456
    -        "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate.tar.xz",
    
    2456
    +        "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate.tar.xz",
    
    2457 2457
             "junit.xml",
    
    2458 2458
             "unexpected-test-output.tar.gz"
    
    2459 2459
           ],
    
    ... ... @@ -2496,7 +2496,7 @@
    2496 2496
         ],
    
    2497 2497
         "variables": {
    
    2498 2498
           "BIGNUM_BACKEND": "gmp",
    
    2499
    -      "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate",
    
    2499
    +      "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate",
    
    2500 2500
           "BUILD_FLAVOUR": "validate",
    
    2501 2501
           "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
    
    2502 2502
           "CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
    
    ... ... @@ -2504,7 +2504,73 @@
    2504 2504
           "CROSS_TARGET": "riscv64-linux-gnu",
    
    2505 2505
           "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
    
    2506 2506
           "RUNTEST_ARGS": "-e config.timeout=900",
    
    2507
    -      "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate",
    
    2507
    +      "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate",
    
    2508
    +      "XZ_OPT": "-9"
    
    2509
    +    }
    
    2510
    +  },
    
    2511
    +  "nightly-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate": {
    
    2512
    +    "after_script": [
    
    2513
    +      ".gitlab/ci.sh save_cache",
    
    2514
    +      ".gitlab/ci.sh save_test_output",
    
    2515
    +      ".gitlab/ci.sh clean",
    
    2516
    +      "cat ci_timings.txt"
    
    2517
    +    ],
    
    2518
    +    "allow_failure": false,
    
    2519
    +    "artifacts": {
    
    2520
    +      "expire_in": "8 weeks",
    
    2521
    +      "paths": [
    
    2522
    +        "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate.tar.xz",
    
    2523
    +        "junit.xml",
    
    2524
    +        "unexpected-test-output.tar.gz"
    
    2525
    +      ],
    
    2526
    +      "reports": {
    
    2527
    +        "junit": "junit.xml"
    
    2528
    +      },
    
    2529
    +      "when": "always"
    
    2530
    +    },
    
    2531
    +    "cache": {
    
    2532
    +      "key": "x86_64-linux-deb12-riscv-$CACHE_REV",
    
    2533
    +      "paths": [
    
    2534
    +        "cabal-cache",
    
    2535
    +        "toolchain"
    
    2536
    +      ]
    
    2537
    +    },
    
    2538
    +    "dependencies": [],
    
    2539
    +    "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-riscv:$DOCKER_REV",
    
    2540
    +    "needs": [
    
    2541
    +      {
    
    2542
    +        "artifacts": false,
    
    2543
    +        "job": "hadrian-ghc-in-ghci"
    
    2544
    +      }
    
    2545
    +    ],
    
    2546
    +    "rules": [
    
    2547
    +      {
    
    2548
    +        "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)",
    
    2549
    +        "when": "on_success"
    
    2550
    +      }
    
    2551
    +    ],
    
    2552
    +    "script": [
    
    2553
    +      "sudo chown ghc:ghc -R .",
    
    2554
    +      ".gitlab/ci.sh setup",
    
    2555
    +      ".gitlab/ci.sh configure",
    
    2556
    +      ".gitlab/ci.sh build_hadrian",
    
    2557
    +      ".gitlab/ci.sh test_hadrian"
    
    2558
    +    ],
    
    2559
    +    "stage": "full-build",
    
    2560
    +    "tags": [
    
    2561
    +      "x86_64-linux"
    
    2562
    +    ],
    
    2563
    +    "variables": {
    
    2564
    +      "BIGNUM_BACKEND": "gmp",
    
    2565
    +      "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate",
    
    2566
    +      "BUILD_FLAVOUR": "validate",
    
    2567
    +      "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
    
    2568
    +      "CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
    
    2569
    +      "CROSS_STAGE": "3",
    
    2570
    +      "CROSS_TARGET": "riscv64-linux-gnu",
    
    2571
    +      "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
    
    2572
    +      "RUNTEST_ARGS": "-e config.timeout=900",
    
    2573
    +      "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate",
    
    2508 2574
           "XZ_OPT": "-9"
    
    2509 2575
         }
    
    2510 2576
       },
    
    ... ... @@ -6610,7 +6676,7 @@
    6610 6676
           "TEST_ENV": "x86_64-linux-deb12-release"
    
    6611 6677
         }
    
    6612 6678
       },
    
    6613
    -  "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate": {
    
    6679
    +  "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate": {
    
    6614 6680
         "after_script": [
    
    6615 6681
           ".gitlab/ci.sh save_cache",
    
    6616 6682
           ".gitlab/ci.sh save_test_output",
    
    ... ... @@ -6621,7 +6687,7 @@
    6621 6687
         "artifacts": {
    
    6622 6688
           "expire_in": "2 weeks",
    
    6623 6689
           "paths": [
    
    6624
    -        "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate.tar.xz",
    
    6690
    +        "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate.tar.xz",
    
    6625 6691
             "junit.xml",
    
    6626 6692
             "unexpected-test-output.tar.gz"
    
    6627 6693
           ],
    
    ... ... @@ -6647,7 +6713,7 @@
    6647 6713
         ],
    
    6648 6714
         "rules": [
    
    6649 6715
           {
    
    6650
    -        "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate(\\s|$).*/)) || (($ONLY_JOBS == null) && ((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*RISC-V.*/)))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)",
    
    6716
    +        "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate(\\s|$).*/)) || (($ONLY_JOBS == null) && ((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*RISC-V.*/)))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)",
    
    6651 6717
             "when": "on_success"
    
    6652 6718
           }
    
    6653 6719
         ],
    
    ... ... @@ -6664,7 +6730,7 @@
    6664 6730
         ],
    
    6665 6731
         "variables": {
    
    6666 6732
           "BIGNUM_BACKEND": "gmp",
    
    6667
    -      "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate",
    
    6733
    +      "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate",
    
    6668 6734
           "BUILD_FLAVOUR": "validate",
    
    6669 6735
           "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
    
    6670 6736
           "CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
    
    ... ... @@ -6672,7 +6738,72 @@
    6672 6738
           "CROSS_TARGET": "riscv64-linux-gnu",
    
    6673 6739
           "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
    
    6674 6740
           "RUNTEST_ARGS": "-e config.timeout=900",
    
    6675
    -      "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate"
    
    6741
    +      "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_2-validate"
    
    6742
    +    }
    
    6743
    +  },
    
    6744
    +  "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate": {
    
    6745
    +    "after_script": [
    
    6746
    +      ".gitlab/ci.sh save_cache",
    
    6747
    +      ".gitlab/ci.sh save_test_output",
    
    6748
    +      ".gitlab/ci.sh clean",
    
    6749
    +      "cat ci_timings.txt"
    
    6750
    +    ],
    
    6751
    +    "allow_failure": false,
    
    6752
    +    "artifacts": {
    
    6753
    +      "expire_in": "2 weeks",
    
    6754
    +      "paths": [
    
    6755
    +        "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate.tar.xz",
    
    6756
    +        "junit.xml",
    
    6757
    +        "unexpected-test-output.tar.gz"
    
    6758
    +      ],
    
    6759
    +      "reports": {
    
    6760
    +        "junit": "junit.xml"
    
    6761
    +      },
    
    6762
    +      "when": "always"
    
    6763
    +    },
    
    6764
    +    "cache": {
    
    6765
    +      "key": "x86_64-linux-deb12-riscv-$CACHE_REV",
    
    6766
    +      "paths": [
    
    6767
    +        "cabal-cache",
    
    6768
    +        "toolchain"
    
    6769
    +      ]
    
    6770
    +    },
    
    6771
    +    "dependencies": [],
    
    6772
    +    "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb12-riscv:$DOCKER_REV",
    
    6773
    +    "needs": [
    
    6774
    +      {
    
    6775
    +        "artifacts": false,
    
    6776
    +        "job": "hadrian-ghc-in-ghci"
    
    6777
    +      }
    
    6778
    +    ],
    
    6779
    +    "rules": [
    
    6780
    +      {
    
    6781
    +        "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate(\\s|$).*/)) || (($ONLY_JOBS == null) && ((($CI_MERGE_REQUEST_LABELS =~ /.*full-ci.*/) || ($CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/) || ($CI_COMMIT_BRANCH == \"master\") || ($CI_COMMIT_BRANCH =~ /ghc-[0-9]+\\.[0-9]+/)) || ($CI_MERGE_REQUEST_LABELS =~ /.*RISC-V.*/)))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)",
    
    6782
    +        "when": "on_success"
    
    6783
    +      }
    
    6784
    +    ],
    
    6785
    +    "script": [
    
    6786
    +      "sudo chown ghc:ghc -R .",
    
    6787
    +      ".gitlab/ci.sh setup",
    
    6788
    +      ".gitlab/ci.sh configure",
    
    6789
    +      ".gitlab/ci.sh build_hadrian",
    
    6790
    +      ".gitlab/ci.sh test_hadrian"
    
    6791
    +    ],
    
    6792
    +    "stage": "full-build",
    
    6793
    +    "tags": [
    
    6794
    +      "x86_64-linux"
    
    6795
    +    ],
    
    6796
    +    "variables": {
    
    6797
    +      "BIGNUM_BACKEND": "gmp",
    
    6798
    +      "BIN_DIST_NAME": "ghc-x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate",
    
    6799
    +      "BUILD_FLAVOUR": "validate",
    
    6800
    +      "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
    
    6801
    +      "CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
    
    6802
    +      "CROSS_STAGE": "3",
    
    6803
    +      "CROSS_TARGET": "riscv64-linux-gnu",
    
    6804
    +      "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
    
    6805
    +      "RUNTEST_ARGS": "-e config.timeout=900",
    
    6806
    +      "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-stage_3-validate"
    
    6676 6807
         }
    
    6677 6808
       },
    
    6678 6809
       "x86_64-linux-deb12-unreg-validate": {