summaryrefslogtreecommitdiff
path: root/.gitlab/gen_ci.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2022-02-10 08:24:24 +0000
committerSylvain Henry <sylvain@haskus.fr>2022-11-29 09:44:31 +0100
commitcc25d52e0f65d54c052908c7d91d5946342ab88a (patch)
tree0f35764ee3b9b0451ac999b64d2db9fa074fa3dd /.gitlab/gen_ci.hs
parentdef47dd32491311289bff26230b664c895f178cc (diff)
downloadhaskell-cc25d52e0f65d54c052908c7d91d5946342ab88a.tar.gz
Add Javascript backend
Add JS backend adapted from the GHCJS project by Luite Stegeman. Some features haven't been ported or implemented yet. Tests for these features have been disabled with an associated gitlab ticket. Bump array submodule Work funded by IOG. Co-authored-by: Jeffrey Young <jeffrey.young@iohk.io> Co-authored-by: Luite Stegeman <stegeman@gmail.com> Co-authored-by: Josh Meredith <joshmeredith2008@gmail.com>
Diffstat (limited to '.gitlab/gen_ci.hs')
-rwxr-xr-x.gitlab/gen_ci.hs31
1 files changed, 25 insertions, 6 deletions
diff --git a/.gitlab/gen_ci.hs b/.gitlab/gen_ci.hs
index db338b88d4..bf2ad41025 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,8 @@ data BuildConfig
, withAssertions :: Bool
, withNuma :: Bool
, crossTarget :: Maybe String
- , crossEmulator :: Maybe String
+ , crossEmulator :: CrossEmulator
+ , configureWrapper :: Maybe String
, fullyStatic :: Bool
, tablesNextToCode :: Bool
, threadSanitiser :: Bool
@@ -163,7 +169,8 @@ vanilla = BuildConfig
, withAssertions = False
, withNuma = False
, crossTarget = Nothing
- , crossEmulator = Nothing
+ , crossEmulator = NoEmulator
+ , configureWrapper = Nothing
, fullyStatic = False
, tablesNextToCode = True
, threadSanitiser = False
@@ -195,11 +202,13 @@ 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 =
+crossConfig triple emulator configure_wrapper =
vanilla { crossTarget = Just triple
, crossEmulator = emulator
+ , configureWrapper = configure_wrapper
}
llvm :: BuildConfig
@@ -636,8 +645,14 @@ job arch opsys buildConfig = (jobName, Job {..})
, "BUILD_FLAVOUR" =: flavourString jobFlavour
, "BIGNUM_BACKEND" =: bignumString (bignumBackend buildConfig)
, "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 -> mempty
, if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty
]
@@ -813,7 +828,11 @@ 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"))
+ , 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
+ }
]
where