[Git][ghc/ghc][wip/backports] 8 commits: testsuite: Only run llvm ways if llc is available
Ben Gamari
gitlab at gitlab.haskell.org
Thu Sep 17 18:50:57 UTC 2020
Ben Gamari pushed to branch wip/backports at Glasgow Haskell Compiler / GHC
Commits:
c2030f00 by Ben Gamari at 2020-09-07T16:16:05-04:00
testsuite: Only run llvm ways if llc is available
As noted in #18560, we previously would always run the LLVM ways since
`configure` would set `SettingsLlcCommand` to something non-null when
it otherwise couldn't find the `llc` executable. Now we rather probe for
the existence of the `llc` executable in the testsuite driver.
Fixes #18560.
(cherry picked from commit aa4b744d51aa6bdb46064f981ea8e001627921d6)
- - - - -
6dbd1054 by Sylvain Henry at 2020-09-07T16:20:38-04:00
Remove outdated note
- - - - -
c23275f4 by Sylvain Henry at 2020-09-07T16:20:38-04:00
Bignum: add missing compat import/export functions
- - - - -
214b2b69 by Ben Gamari at 2020-09-07T20:28:21-04:00
gitlab-ci: Accept Centos 7 C.utf8 locale
Centos apparently has C.utf8 rather than C.UTF-8.
(cherry picked from commit d9f85dd25a26a04d3485470afb3395ee2dec6464)
(cherry picked from commit 9374737005c9fa36a870111f100fe27f9a0efd8e)
- - - - -
b093074e by Ben Gamari at 2020-09-07T20:28:26-04:00
gitlab-ci: Handle distributions without locales
Previously we would assume that the `locale` utility exists. However,
this is not so on Alpine as musl's locale support is essentially
non-existent.
(cherry picked from commit 17cdb7ac3b557a245fee1686e066f9f770ddc21e)
(cherry picked from commit c10ff55fddf8c6708d679e91f3253dc642b91565)
- - - - -
3e55edd9 by Ben Gamari at 2020-09-08T09:46:42-04:00
gitlab-ci: Rename RELEASE variable to RELEASE_JOB
This interfered with the autoconf variable of the same name, breaking
pre-release builds.
(cherry picked from commit 15dca84793d5ec4ff922726477923e40caa075eb)
- - - - -
12d9742c by Zubin Duggal at 2020-09-16T14:38:15-04:00
Export enrichHie from GHC.Iface.Ext.Ast
This is useful for `ghcide`
Backport of !4037
- - - - -
36fc0a06 by Ben Gamari at 2020-09-17T14:50:46-04:00
Bump Win32 submodule to 2.9.0.0
Also bumps Cabal, directory
(cherry picked from commit 9c6c1ebc9ab2f18d711a8793c7f0ec36e989d687)
- - - - -
13 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/ghc.cabal.in
- ghc/ghc-bin.cabal.in
- hadrian/src/Settings/Builders/RunTest.hs
- libraries/Cabal
- libraries/directory
- libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs
- testsuite/config/ghc
- testsuite/driver/testglobals.py
- testsuite/mk/test.mk
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -66,7 +66,7 @@ workflow:
when: always
expire_in: 1 year
rules:
- - if: '$RELEASE == "yes"'
+ - if: '$RELEASE_JOB == "yes"'
############################################################
# Runner Tags
=====================================
.gitlab/ci.sh
=====================================
@@ -58,6 +58,12 @@ function run() {
TOP="$(pwd)"
function setup_locale() {
+ # Musl doesn't provide locale support at all...
+ if ! which locale > /dev/null; then
+ info "No locale executable. Skipping locale setup..."
+ return
+ fi
+
# BSD grep terminates early with -q, consequently locale -a will get a
# SIGPIPE and the pipeline will fail with pipefail.
shopt -o -u pipefail
@@ -70,6 +76,9 @@ function setup_locale() {
elif locale -a | grep -q en_US.UTF-8; then
# Centos doesn't have C.UTF-8
export LANG=en_US.UTF-8
+ elif locale -a | grep -q en_US.utf8; then
+ # Centos doesn't have C.UTF-8
+ export LANG=en_US.utf8
else
error "Failed to find usable locale"
info "Available locales:"
=====================================
compiler/GHC/Builtin/Names.hs
=====================================
@@ -116,35 +116,6 @@ known keys. See
Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)
in GHC.Builtin.Types.
-Note [The integer library]
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Clearly, we need to know the names of various definitions of the integer
-library, e.g. the type itself, `mkInteger` etc. But there are two possible
-implementations of the integer library:
-
- * integer-gmp (fast, but uses libgmp, which may not be available on all
- targets and is GPL licensed)
- * integer-simple (slow, but pure Haskell and BSD-licensed)
-
-We want the compiler to work with either one. The way we achieve this is:
-
- * When compiling the integer-{gmp,simple} library, we pass
- -this-unit-id integer-wired-in
- to GHC (see the cabal file libraries/integer-{gmp,simple}.
- * This way, GHC can use just this UnitID (see Module.integerUnitId) when
- generating code, and the linker will succeed.
-
-Unfortuately, the abstraction is not complete: When using integer-gmp, we
-really want to use the S# constructor directly. This is controlled by
-the `integerLibrary` field of `DynFlags`: If it is IntegerGMP, we use
-this constructor directly (see CorePrep.lookupIntegerSDataConName)
-
-When GHC reads the package data base, it (internally only) pretends it has UnitId
-`integer-wired-in` instead of the actual UnitId (which includes the version
-number); just like for `base` and other packages, as described in
-Note [Wired-in units] in GHC.Unit.Module. This is done in
-GHC.Unit.State.findWiredInUnits.
-}
{-# LANGUAGE CPP #-}
=====================================
compiler/GHC/Iface/Ext/Ast.hs
=====================================
@@ -19,7 +19,7 @@ Main functions for .hie file generation
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-module GHC.Iface.Ext.Ast ( mkHieFile, mkHieFileWithSource, getCompressedAsts) where
+module GHC.Iface.Ext.Ast ( mkHieFile, mkHieFileWithSource, getCompressedAsts, enrichHie) where
import GHC.Utils.Outputable(ppr)
=====================================
compiler/ghc.cabal.in
=====================================
@@ -77,7 +77,7 @@ Library
ghci == @ProjectVersionMunged@
if os(windows)
- Build-Depends: Win32 >= 2.3 && < 2.7
+ Build-Depends: Win32 >= 2.3 && < 2.10
else
if flag(terminfo)
Build-Depends: terminfo == 0.4.*
=====================================
ghc/ghc-bin.cabal.in
=====================================
@@ -45,7 +45,7 @@ Executable ghc
ghc == @ProjectVersionMunged@
if os(windows)
- Build-Depends: Win32 >= 2.3 && < 2.7
+ Build-Depends: Win32 >= 2.3 && < 2.10
else
Build-Depends: unix >= 2.7 && < 2.9
@@ -102,4 +102,4 @@ Executable ghc
Default-Extensions:
NoImplicitPrelude
, ScopedTypeVariables
- , BangPatterns
\ No newline at end of file
+ , BangPatterns
=====================================
hadrian/src/Settings/Builders/RunTest.hs
=====================================
@@ -70,7 +70,6 @@ runTestBuilderArgs = builder RunTest ? do
withSMP <- getBooleanSetting TestGhcWithSMP
debugged <- getBooleanSetting TestGhcDebugged
keepFiles <- expr (testKeepFiles <$> userSetting defaultTestArgs)
- withLlvm <- expr (not . null <$> settingsFileSetting SettingsFileSetting_LlcCommand)
accept <- expr (testAccept <$> userSetting defaultTestArgs)
(acceptPlatform, acceptOS) <- expr . liftIO $
@@ -126,8 +125,6 @@ runTestBuilderArgs = builder RunTest ? do
, arg "-e", arg $ asBool "config.have_profiling=" (hasLibWay profiling)
, arg "-e", arg $ asBool "config.have_fast_bignum=" (bignumBackend /= "native" && not bignumCheck)
, arg "-e", arg $ asBool "ghc_with_smp=" withSMP
- , arg "-e", arg $ asBool "ghc_with_llvm=" withLlvm
-
, arg "-e", arg $ "config.ghc_dynamic_by_default=" ++ show hasDynamicByDefault
, arg "-e", arg $ "config.ghc_dynamic=" ++ show hasDynamic
=====================================
libraries/Cabal
=====================================
@@ -1 +1 @@
-Subproject commit 1d886476c443b227bf93eba62781a6cad5012d9e
+Subproject commit 5139d6e72d391bffa3cf06f08884277799eb0b45
=====================================
libraries/directory
=====================================
@@ -1 +1 @@
-Subproject commit 3d9ca6edc0703860829ab3210db78bb4c4ff72b9
+Subproject commit c16afcda5708ee9944afa7ea6858e5be894fe67e
=====================================
libraries/integer-gmp/src/GHC/Integer/GMP/Internals.hs
=====================================
@@ -57,9 +57,6 @@ module GHC.Integer.GMP.Internals
, bigNatToInt
, bigNatToWord
, indexBigNat#
- , importBigNatFromByteArray
- , exportBigNatToMutableByteArray
-
-- ** 'BigNat' arithmetic operations
, plusBigNat
@@ -112,9 +109,17 @@ module GHC.Integer.GMP.Internals
-- ** Export
, exportBigNatToAddr
+ , exportIntegerToAddr
+
+ , exportBigNatToMutableByteArray
+ , exportIntegerToMutableByteArray
-- ** Import
, importBigNatFromAddr
+ , importIntegerFromAddr
+
+ , importBigNatFromByteArray
+ , importIntegerFromByteArray
) where
import GHC.Integer
@@ -373,6 +378,18 @@ exportBigNatToAddr (BN# b) addr endian = IO \s ->
case B.bigNatToAddr# b addr endian s of
(# s', w #) -> (# s', W# w #)
+{-# DEPRECATED importIntegerFromAddr "Use integerFromAddr# instead" #-}
+importIntegerFromAddr :: Addr# -> Word# -> Int# -> IO Integer
+importIntegerFromAddr addr sz endian = IO \s ->
+ case I.integerFromAddr# sz addr endian s of
+ (# s', i #) -> (# s', i #)
+
+{-# DEPRECATED exportIntegerToAddr "Use integerToAddr# instead" #-}
+exportIntegerToAddr :: Integer -> Addr# -> Int# -> IO Word
+exportIntegerToAddr i addr endian = IO \s ->
+ case I.integerToAddr# i addr endian s of
+ (# s', w #) -> (# s', W# w #)
+
wordToBigNat :: Word# -> BigNat
wordToBigNat w = BN# (B.bigNatFromWord# w)
@@ -398,3 +415,13 @@ importBigNatFromByteArray ba off sz endian = case runRW# (B.bigNatFromByteArray#
exportBigNatToMutableByteArray :: BigNat -> MutableByteArray# RealWorld -> Word# -> Int# -> IO Word
exportBigNatToMutableByteArray (BN# ba) mba off endian = IO (\s -> case B.bigNatToMutableByteArray# ba mba off endian s of
(# s', r #) -> (# s', W# r #))
+
+{-# DEPRECATED importIntegerFromByteArray "Use integerFromByteArray# instead" #-}
+importIntegerFromByteArray :: ByteArray# -> Word# -> Word# -> Int# -> Integer
+importIntegerFromByteArray ba off sz endian = case runRW# (I.integerFromByteArray# sz ba off endian) of
+ (# _, r #) -> r
+
+{-# DEPRECATED exportIntegerToMutableByteArray "Use integerToMutableByteArray# instead" #-}
+exportIntegerToMutableByteArray :: Integer -> MutableByteArray# RealWorld -> Word# -> Int# -> IO Word
+exportIntegerToMutableByteArray i mba off endian = IO (\s -> case I.integerToMutableByteArray# i mba off endian s of
+ (# s', r #) -> (# s', W# r #))
=====================================
testsuite/config/ghc
=====================================
@@ -64,10 +64,6 @@ else:
if (config.have_profiling and ghc_with_threaded_rts):
config.run_ways.append('profthreaded')
-if (ghc_with_llvm and not config.unregisterised):
- config.compile_ways.append('optllvm')
- config.run_ways.append('optllvm')
-
# WinIO I/O manager for Windows
if windows:
winio_ways = ['winio', 'winio_threaded']
@@ -195,6 +191,17 @@ def get_compiler_info():
config.have_ncg = compilerInfoDict.get("Have native code generator", "NO") == "YES"
+ # Detect whether an LLVM toolhain is available
+ llc_path = compilerInfoDict.get("LLVM llc command")
+ config.have_llvm = shutil.which(llc_path) is not None
+ if config.unregisterised:
+ print("Unregisterised build; skipping LLVM ways...")
+ elif config.have_llvm:
+ config.compile_ways.append('optllvm')
+ config.run_ways.append('optllvm')
+ else:
+ print("Failed to find `llc` command; skipping LLVM ways...")
+
# Whether GHC itself was built using the LLVM backend. We need to know this
# since some tests in ext-interp fail when stage2 ghc is built using
# LLVM. See #16087.
=====================================
testsuite/driver/testglobals.py
=====================================
@@ -115,6 +115,9 @@ class TestConfig:
self.way_flags = {} # type: Dict[WayName, List[str]]
self.way_rts_flags = {} # type: Dict[WayName, List[str]]
+ # Do we have a functional LLVM toolchain?
+ self.have_llvm = False
+
# Do we have vanilla libraries?
self.have_vanilla = False
=====================================
testsuite/mk/test.mk
=====================================
@@ -188,18 +188,6 @@ else
RUNTEST_OPTS += -e ghc_with_smp=False
endif
-# Does the LLVM backend work?
-ifeq "$(LLC)" ""
-RUNTEST_OPTS += -e ghc_with_llvm=False
-else ifeq "$(TargetARCH_CPP)" "powerpc"
-RUNTEST_OPTS += -e ghc_with_llvm=False
-else ifneq "$(LLC)" "llc"
-# If we have a real detected value for LLVM, then it really ought to work
-RUNTEST_OPTS += -e ghc_with_llvm=True
-else
-RUNTEST_OPTS += -e ghc_with_llvm=False
-endif
-
ifeq "$(WINDOWS)" "YES"
RUNTEST_OPTS += -e windows=True
else
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f67f6d07a7ae2753c48e3c06378900f3fedf3f2c...36fc0a06c1dc9bd01e61ec6728aac954d347c3d1
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f67f6d07a7ae2753c48e3c06378900f3fedf3f2c...36fc0a06c1dc9bd01e61ec6728aac954d347c3d1
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200917/edee8219/attachment-0001.html>
More information about the ghc-commits
mailing list