diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2022-11-07 18:25:49 +0100 |
---|---|---|
committer | Sylvain Henry <sylvain@haskus.fr> | 2022-11-07 18:25:49 +0100 |
commit | 484fe97fb6ebaa73c7f7ab2f3934dc94ab0bfa8b (patch) | |
tree | bd5f0d898ba879fbc08f3d1b25f0cf69912de6bd | |
parent | f3d760a5df24e0e18e6644781ff799a182a9a9ed (diff) | |
download | haskell-484fe97fb6ebaa73c7f7ab2f3934dc94ab0bfa8b.tar.gz |
Try to fix CI, take N
-rwxr-xr-x | .gitlab/ci.sh | 26 | ||||
-rwxr-xr-x | .gitlab/gen_ci.hs | 22 | ||||
-rw-r--r-- | .gitlab/jobs.yaml | 4 |
3 files changed, 30 insertions, 22 deletions
diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 67191c67c7..7e2b8faff8 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -594,20 +594,18 @@ function test_hadrian() { fi - if [ -n "${CROSS_TARGET:-}" ]; then - if [ -n "${CROSS_EMULATOR:-}" ]; then - local instdir="$TOP/_build/install" - local test_compiler="$instdir/bin/${cross_prefix}ghc$exe" - install_bindist _build/bindist/ghc-*/ "$instdir" - echo 'main = putStrLn "hello world"' > hello.hs - echo "hello world" > expected - run "$test_compiler" hello.hs - $CROSS_EMULATOR ./hello > actual - run diff expected actual - else - info "Cannot test cross-compiled build without CROSS_EMULATOR being set." - return - fi + if [[ "${CROSS_EMULATOR:-}" == "NOT_SET" ]]; then + info "Cannot test cross-compiled build without CROSS_EMULATOR being set." + return + elif[[ "${CROSS_EMULATOR:-}" != "NOT_NEEDED" ]]; then + local instdir="$TOP/_build/install" + local test_compiler="$instdir/bin/${cross_prefix}ghc$exe" + install_bindist _build/bindist/ghc-*/ "$instdir" + echo 'main = putStrLn "hello world"' > hello.hs + echo "hello world" > expected + run "$test_compiler" hello.hs + $CROSS_EMULATOR ./hello > actual + run diff expected actual elif [[ -n "${REINSTALL_GHC:-}" ]]; then run_hadrian \ test \ diff --git a/.gitlab/gen_ci.hs b/.gitlab/gen_ci.hs index c8ecf9605f..2fa323dbe5 100755 --- a/.gitlab/gen_ci.hs +++ b/.gitlab/gen_ci.hs @@ -109,6 +109,11 @@ bignumString :: BignumBackend -> String bignumString Gmp = "gmp" bignumString Native = "native" +data CrossEmulator + = NoEmulator + | NoEmulatorNeeded + | Emulator String + -- | A BuildConfig records all the options which can be modified to affect the -- bindists produced by the compiler. data BuildConfig @@ -120,7 +125,7 @@ data BuildConfig , withAssertions :: Bool , withNuma :: Bool , crossTarget :: Maybe String - , crossEmulator :: Maybe String + , crossEmulator :: CrossEmulator , configureWrapper :: Maybe String , fullyStatic :: Bool , tablesNextToCode :: Bool @@ -164,7 +169,7 @@ vanilla = BuildConfig , withAssertions = False , withNuma = False , crossTarget = Nothing - , crossEmulator = Nothing + , crossEmulator = NoEmulator , configureWrapper = Nothing , fullyStatic = False , tablesNextToCode = True @@ -197,7 +202,7 @@ staticNativeInt :: BuildConfig staticNativeInt = static { bignumBackend = Native } crossConfig :: String -- ^ target triple - -> Maybe String -- ^ emulator for testing + -> CrossEmulator -- ^ emulator for testing -> Maybe String -- ^ Configure wrapper -> BuildConfig crossConfig triple emulator configure_wrapper = @@ -642,7 +647,12 @@ job arch opsys buildConfig = (jobName, Job {..}) , "CONFIGURE_ARGS" =: configureArgsStr buildConfig , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig) , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig) - , maybe mempty ("CROSS_EMULATOR" =:) (crossEmulator buildConfig) + , case crossEmulator buildConfig of + NoEmulator -> case crossTarget buildConfig of + Nothing -> mempty + Just _ -> "CROSS_EMULATOR" =: "NOT_SET" -- we need an emulator but it isn't set. Won't run the testsuite + Emulator s -> "CROSS_EMULATOR" =: s + NoEmulatorNeeded -> "CROSS_EMULATOR" =: "NOT_NEEDED" , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty ] @@ -818,8 +828,8 @@ jobs = Map.fromList $ concatMap flattenJobGroup $ , standardBuilds I386 (Linux Debian9) , allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) static) , disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) staticNativeInt)) - , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Just "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - , validateBuilds Amd64 (Linux Debian11) (crossConfig "js-unknown-ghcjs" (Just "") (Just "emconfigure") + , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) + , validateBuilds Amd64 (Linux Debian11) (crossConfig "js-unknown-ghcjs" NoEmulatorNeeded (Just "emconfigure") ) { bignumBackend = Native , buildFlavour = Release diff --git a/.gitlab/jobs.yaml b/.gitlab/jobs.yaml index 4165777dd8..dd1b34c77e 100644 --- a/.gitlab/jobs.yaml +++ b/.gitlab/jobs.yaml @@ -1384,7 +1384,7 @@ "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--with-intree-gmp", "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "", + "CROSS_EMULATOR": "NOT_NEEDED", "CROSS_TARGET": "js-unknown-ghcjs", "TEST_ENV": "x86_64-linux-deb11-int_native-cross_js-unknown-ghcjs-release", "XZ_OPT": "-9" @@ -3928,7 +3928,7 @@ "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--with-intree-gmp", "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "", + "CROSS_EMULATOR": "NOT_NEEDED", "CROSS_TARGET": "js-unknown-ghcjs", "TEST_ENV": "x86_64-linux-deb11-int_native-cross_js-unknown-ghcjs-release" } |