Magnus pushed to branch wip/mangoiv/ci-stages at Glasgow Haskell Compiler / GHC
Commits:
-
e3098d06
by mangoiv at 2026-10-28T10:59:42+01:00
3 changed files:
Changes:
| ... | ... | @@ -693,6 +693,9 @@ function test_hadrian_stage1() { |
| 693 | 693 | |
| 694 | 694 | function test_hadrian() {
|
| 695 | 695 | |
| 696 | + # if a bindist tar exists, the variable $bindist_tar will be set
|
|
| 697 | + # that way we can later check for its existance to find whether
|
|
| 698 | + # we are running with a bindist.
|
|
| 696 | 699 | find_bindist_tar
|
| 697 | 700 | dist_dir="_build/bindist"
|
| 698 | 701 | |
| ... | ... | @@ -777,8 +780,8 @@ function test_hadrian() { |
| 777 | 780 | run_hadrian \
|
| 778 | 781 | test \
|
| 779 | 782 | --summary-junit=./junit.xml \
|
| 780 | - --test-compiler="${test_compiler}" \
|
|
| 781 | 783 | --test-have-intree-files \
|
| 784 | + --test-compiler="${test_compiler}" \
|
|
| 782 | 785 | ${TEST_WAYS[@]/#/--test-way=} \
|
| 783 | 786 | "runtest.opts+=${RUNTEST_ARGS:-}" \
|
| 784 | 787 | "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \
|
| ... | ... | @@ -872,6 +872,7 @@ job arch opsys buildConfig = |
| 872 | 872 | , "bash .gitlab/ci.sh configure" -- configure needs to be run because hadrian gets its config like that
|
| 873 | 873 | , "bash .gitlab/ci.sh test_hadrian" ]
|
| 874 | 874 | | otherwise
|
| 875 | + -- see Note [Workaround for docker permissions]
|
|
| 875 | 876 | = [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++
|
| 876 | 877 | [ ".gitlab/ci.sh setup"
|
| 877 | 878 | , ".gitlab/ci.sh configure"
|
| ... | ... | @@ -886,6 +887,7 @@ job arch opsys buildConfig = |
| 886 | 887 | ]
|
| 887 | 888 | | otherwise
|
| 888 | 889 | = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++
|
| 890 | + -- see Note [Workaround for docker permissions]
|
|
| 889 | 891 | [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++
|
| 890 | 892 | [ ".gitlab/ci.sh setup"
|
| 891 | 893 | , ".gitlab/ci.sh configure"
|
| ... | ... | @@ -984,6 +986,19 @@ job arch opsys buildConfig = |
| 984 | 986 | |
| 985 | 987 | jobAllowFailure = False
|
| 986 | 988 | |
| 989 | +{-
|
|
| 990 | +Note [Workaround for docker permissions]
|
|
| 991 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
| 992 | +In GHC's CI, (docker) containers try to run build and tests as the user ghc
|
|
| 993 | +which is unusual. Sometimes we have files in the file tree that are owned
|
|
| 994 | +by root (which is the user that containers usually run as) so we have to
|
|
| 995 | +chown them.
|
|
| 996 | + |
|
| 997 | +Since running as user ghc in the CI yields virtually no extra protection in
|
|
| 998 | +any situation, we will remove this in the future and replace it by better
|
|
| 999 | +non-filesystem-based virtualisation.
|
|
| 1000 | +-}
|
|
| 1001 | + |
|
| 987 | 1002 | ---------------------------------------------------------------------------
|
| 988 | 1003 | -- Job Modifiers
|
| 989 | 1004 | ---------------------------------------------------------------------------
|
| ... | ... | @@ -154,7 +154,7 @@ getTestExePath testGhc pkg = do |
| 154 | 154 | bindir <- getBinaryDirectory testGhc
|
| 155 | 155 | compiler_path <- getCompilerPath testGhc
|
| 156 | 156 | cross <- getBooleanSetting TestCrossCompiling
|
| 157 | - tgt <- getHostTarget -- FIXME: is this right -- ask rodrigo about the targettarget and query/get versions of this function
|
|
| 157 | + tgt <- getHostTarget
|
|
| 158 | 158 | let cross_prefix = if cross then dropWhileEnd ((/=) '-') (takeFileName compiler_path) else ""
|
| 159 | 159 | -- get relative path for the given program in the given stage
|
| 160 | 160 | liftIO $ makeAbsolute (bindir </> (cross_prefix ++ programBasename pkg) <.> exe (tgtArchOs tgt))
|