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 fixup! ci: build and test stage - - - - - 3 changed files: - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs - hadrian/src/Oracles/TestSettings.hs Changes: ===================================== .gitlab/ci.sh ===================================== @@ -693,6 +693,9 @@ function test_hadrian_stage1() { function test_hadrian() { + # if a bindist tar exists, the variable $bindist_tar will be set + # that way we can later check for its existance to find whether + # we are running with a bindist. find_bindist_tar dist_dir="_build/bindist" @@ -777,8 +780,8 @@ function test_hadrian() { run_hadrian \ test \ --summary-junit=./junit.xml \ - --test-compiler="${test_compiler}" \ --test-have-intree-files \ + --test-compiler="${test_compiler}" \ ${TEST_WAYS[@]/#/--test-way=} \ "runtest.opts+=${RUNTEST_ARGS:-}" \ "runtest.opts+=--unexpected-output-dir=$TOP/unexpected-test-output" \ ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -872,6 +872,7 @@ job arch opsys buildConfig = , "bash .gitlab/ci.sh configure" -- configure needs to be run because hadrian gets its config like that , "bash .gitlab/ci.sh test_hadrian" ] | otherwise + -- see Note [Workaround for docker permissions] = [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++ [ ".gitlab/ci.sh setup" , ".gitlab/ci.sh configure" @@ -886,6 +887,7 @@ job arch opsys buildConfig = ] | otherwise = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++ + -- see Note [Workaround for docker permissions] [ "sudo chown ghc:ghc -R ." | Linux {} <- [opsys]] ++ [ ".gitlab/ci.sh setup" , ".gitlab/ci.sh configure" @@ -984,6 +986,19 @@ job arch opsys buildConfig = jobAllowFailure = False +{- +Note [Workaround for docker permissions] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In GHC's CI, (docker) containers try to run build and tests as the user ghc +which is unusual. Sometimes we have files in the file tree that are owned +by root (which is the user that containers usually run as) so we have to +chown them. + +Since running as user ghc in the CI yields virtually no extra protection in +any situation, we will remove this in the future and replace it by better +non-filesystem-based virtualisation. +-} + --------------------------------------------------------------------------- -- Job Modifiers --------------------------------------------------------------------------- ===================================== hadrian/src/Oracles/TestSettings.hs ===================================== @@ -154,7 +154,7 @@ getTestExePath testGhc pkg = do bindir <- getBinaryDirectory testGhc compiler_path <- getCompilerPath testGhc cross <- getBooleanSetting TestCrossCompiling - tgt <- getHostTarget -- FIXME: is this right -- ask rodrigo about the targettarget and query/get versions of this function + tgt <- getHostTarget let cross_prefix = if cross then dropWhileEnd ((/=) '-') (takeFileName compiler_path) else "" -- get relative path for the given program in the given stage liftIO $ makeAbsolute (bindir </> (cross_prefix ++ programBasename pkg) <.> exe (tgtArchOs tgt)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3098d062cd2852da936e000eac72856... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3098d062cd2852da936e000eac72856... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help