[Git][ghc/ghc][wip/explicit-perf-baseline] Things

Ben Gamari gitlab at gitlab.haskell.org
Mon Jul 6 02:16:50 UTC 2020



Ben Gamari pushed to branch wip/explicit-perf-baseline at Glasgow Haskell Compiler / GHC


Commits:
4b559f04 by Ben Gamari at 2020-07-05T22:16:44-04:00
Things

- - - - -


4 changed files:

- hadrian/src/Settings/Builders/RunTest.hs
- testsuite/driver/runtests.py
- testsuite/driver/testlib.py
- testsuite/mk/test.mk


Changes:

=====================================
hadrian/src/Settings/Builders/RunTest.hs
=====================================
@@ -105,38 +105,38 @@ runTestBuilderArgs = builder RunTest ? do
             , pure [ "--rootdir=" ++ testdir | testdir <- rootdirs ]
             , arg "-e", arg $ "windows=" ++ show windowsHost
             , arg "-e", arg $ "darwin=" ++ show osxHost
-            , arg "--config", arg $ "local=False"
-            , arg "--config", arg $ "cleanup=" ++ show (not keepFiles)
-            , arg "--config", arg $ "accept=" ++ show accept
-            , arg "--config", arg $ "accept_platform=" ++ show acceptPlatform
-            , arg "--config", arg $ "accept_os=" ++ show acceptOS
-            , arg "--config", arg $ "exeext=" ++ quote (if null exe then "" else "."<>exe)
-            , arg "--config", arg $ "compiler_debugged=" ++
+            , arg "-e", arg $ "config.local=False"
+            , arg "-e", arg $ "config.cleanup=" ++ show (not keepFiles)
+            , arg "-e", arg $ "config.accept=" ++ show accept
+            , arg "-e", arg $ "config.accept_platform=" ++ show acceptPlatform
+            , arg "-e", arg $ "config.accept_os=" ++ show acceptOS
+            , arg "-e", arg $ "config.exeext=" ++ quote (if null exe then "" else "."<>exe)
+            , arg "-e", arg $ "config.compiler_debugged=" ++
               show debugged
             , arg "-e", arg $ asBool "ghc_with_native_codegen=" withNativeCodeGen
 
-            , arg "--config", arg $ "have_interp=" ++ show withInterpreter
-            , arg "--config", arg $ "unregisterised=" ++ show unregisterised
+            , arg "-e", arg $ "config.have_interp=" ++ show withInterpreter
+            , arg "-e", arg $ "config.unregisterised=" ++ show unregisterised
 
-            , arg "--extra-hc-flag", arg (quote ghcFlags)
-            , arg "--config", arg $ asBool "ghc_with_dynamic_rts="  (hasRtsWay "dyn")
-            , arg "--config", arg $ asBool "ghc_with_threaded_rts=" (hasRtsWay "thr")
-            , arg "--config", arg $ asBool "have_vanilla="   (hasLibWay vanilla)
-            , arg "--config", arg $ asBool "have_dynamic="   (hasLibWay dynamic)
-            , arg "--config", arg $ asBool "have_profiling=" (hasLibWay profiling)
-            , arg "--config", arg $ asBool "have_fast_bignum=" (bignumBackend /= "native" && not bignumCheck)
-            , arg "--config", arg $ asBool "ghc_with_smp=" withSMP
-            , arg "--config", arg $ asBool "ghc_with_llvm=" withLlvm
+            , arg "-e", arg $ "ghc_compiler_always_flags=" ++ quote ghcFlags
+            , arg "-e", arg $ asBool "ghc_with_dynamic_rts="  (hasRtsWay "dyn")
+            , arg "-e", arg $ asBool "ghc_with_threaded_rts=" (hasRtsWay "thr")
+            , arg "-e", arg $ asBool "config.have_vanilla="   (hasLibWay vanilla)
+            , arg "-e", arg $ asBool "config.have_dynamic="   (hasLibWay dynamic)
+            , 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 "--config", arg $ "ghc_dynamic_by_default=" ++ show hasDynamicByDefault
-            , arg "--config", arg $ "ghc_dynamic=" ++ show hasDynamic
+            , arg "-e", arg $ "config.ghc_dynamic_by_default=" ++ show hasDynamicByDefault
+            , arg "-e", arg $ "config.ghc_dynamic=" ++ show hasDynamic
 
-            , arg "--config", arg $ "top=" ++ show (top -/- "testsuite")
-            , arg "--config", arg $ "wordsize=" ++ show wordsize
-            , arg "--config", arg $ "os="       ++ show os
-            , arg "--config", arg $ "arch="     ++ show arch
-            , arg "--config", arg $ "platform=" ++ show platform
+            , arg "-e", arg $ "config.top=" ++ show (top -/- "testsuite")
+            , arg "-e", arg $ "config.wordsize=" ++ show wordsize
+            , arg "-e", arg $ "config.os="       ++ show os
+            , arg "-e", arg $ "config.arch="     ++ show arch
+            , arg "-e", arg $ "config.platform=" ++ show platform
 
             , arg "--config", arg $ "gs=gs"                           -- Use the default value as in test.mk
             , arg "--config", arg $ "timeout_prog=" ++ show (top -/- timeoutProg)


=====================================
testsuite/driver/runtests.py
=====================================
@@ -294,7 +294,11 @@ def main() -> None:
     if args.rootdir:
         config.rootdirs = args.rootdir
 
-    config.compiler_always_flags = args.extra_hc_flag
+    config.compiler_always_flags = [
+        flag
+        for flags in args.extra_hc_flag
+        for flag in flags.split()
+    ]
 
     config.metrics_file = args.metrics_file
     hasMetricsFile = config.metrics_file is not None


=====================================
testsuite/driver/testlib.py
=====================================
@@ -2013,7 +2013,7 @@ def compare_outputs(way: WayName,
             else:
                 if_verbose(1, 'Accepting new output.')
 
-            write_file(str(expected_path) + suffix, actual_raw)
+            write_file(expected_path.with_suffix(expected_path.suffix + suffix), actual_raw)
             return True
         elif config.accept:
             if_verbose(1, 'No output. Deleting "{0}".'.format(expected_path))


=====================================
testsuite/mk/test.mk
=====================================
@@ -79,18 +79,18 @@ else
 dllext = .so
 endif
 
-RUNTEST_OPTS += --extra-hc-flag='$(TEST_HC_OPTS)'
+RUNTEST_OPTS += -e "ghc_compiler_always_flags='$(TEST_HC_OPTS)'"
 
 ifeq "$(GhcDebugged)" "YES"
-RUNTEST_OPTS += --config "compiler_debugged=True"
+RUNTEST_OPTS += -e "config.compiler_debugged=True"
 else
-RUNTEST_OPTS += --config "compiler_debugged=False"
+RUNTEST_OPTS += -e "config.compiler_debugged=False"
 endif
 
 ifeq "$(GhcWithNativeCodeGen)" "YES"
-RUNTEST_OPTS += --config "ghc_with_native_codegen=True"
+RUNTEST_OPTS += -e ghc_with_native_codegen=True
 else
-RUNTEST_OPTS += --config "ghc_with_native_codegen=False"
+RUNTEST_OPTS += -e ghc_with_native_codegen=False
 endif
 
 GHC_PRIM_LIBDIR := $(subst library-dirs: ,,$(shell "$(GHC_PKG)" field ghc-prim library-dirs --simple-output))
@@ -105,21 +105,21 @@ HAVE_READELF := $(shell if readelf --version > /dev/null 2> /dev/null; then echo
 BIGNUM_GMP := $(shell "$(GHC_PKG)" field ghc-bignum exposed-modules | grep GMP)
 
 ifeq "$(HAVE_VANILLA)" "YES"
-RUNTEST_OPTS += --config have_vanilla=True
+RUNTEST_OPTS += -e config.have_vanilla=True
 else
-RUNTEST_OPTS += --config have_vanilla=False
+RUNTEST_OPTS += -e config.have_vanilla=False
 endif
 
 ifeq "$(HAVE_DYNAMIC)" "YES"
-RUNTEST_OPTS += --config have_dynamic=True
+RUNTEST_OPTS += -e config.have_dynamic=True
 else
-RUNTEST_OPTS += --config have_dynamic=False
+RUNTEST_OPTS += -e config.have_dynamic=False
 endif
 
 ifeq "$(HAVE_PROFILING)" "YES"
-RUNTEST_OPTS += --config have_profiling=True
+RUNTEST_OPTS += -e config.have_profiling=True
 else
-RUNTEST_OPTS += --config have_profiling=False
+RUNTEST_OPTS += -e config.have_profiling=False
 endif
 
 ifeq "$(filter thr, $(GhcRTSWays))" "thr"
@@ -135,50 +135,50 @@ RUNTEST_OPTS += -e ghc_with_dynamic_rts=False
 endif
 
 ifeq "$(GhcWithInterpreter)" "NO"
-RUNTEST_OPTS += --config have_interp=False
+RUNTEST_OPTS += -e config.have_interp=False
 else ifeq "$(GhcStage)" "1"
-RUNTEST_OPTS += --config have_interp=False
+RUNTEST_OPTS += -e config.have_interp=False
 else
-RUNTEST_OPTS += --config have_interp=True
+RUNTEST_OPTS += -e config.have_interp=True
 endif
 
 ifeq "$(GhcUnregisterised)" "YES"
-RUNTEST_OPTS += --config unregisterised=True
+RUNTEST_OPTS += -e config.unregisterised=True
 else
-RUNTEST_OPTS += --config unregisterised=False
+RUNTEST_OPTS += -e config.unregisterised=False
 endif
 
 ifeq "$(HAVE_GDB)" "YES"
-RUNTEST_OPTS += --config have_gdb=True
+RUNTEST_OPTS += -e config.have_gdb=True
 else
-RUNTEST_OPTS += --config have_gdb=False
+RUNTEST_OPTS += -e config.have_gdb=False
 endif
 
 ifeq "$(HAVE_READELF)" "YES"
-RUNTEST_OPTS += --config have_readelf=True
+RUNTEST_OPTS += -e config.have_readelf=True
 else
-RUNTEST_OPTS += --config have_readelf=False
+RUNTEST_OPTS += -e config.have_readelf=False
 endif
 
 ifeq "$(BIGNUM_GMP)" ""
-RUNTEST_OPTS += --config have_fast_bignum=False
+RUNTEST_OPTS += -e config.have_fast_bignum=False
 else
-RUNTEST_OPTS += --config have_fast_bignum=True
+RUNTEST_OPTS += -e config.have_fast_bignum=True
 endif
 
 ifeq "$(GhcDynamicByDefault)" "YES"
-RUNTEST_OPTS += --config ghc_dynamic_by_default=True
+RUNTEST_OPTS += -e config.ghc_dynamic_by_default=True
 CABAL_MINIMAL_BUILD = --enable-shared --disable-library-vanilla
 else
-RUNTEST_OPTS += --config ghc_dynamic_by_default=False
+RUNTEST_OPTS += -e config.ghc_dynamic_by_default=False
 CABAL_MINIMAL_BUILD = --enable-library-vanilla --disable-shared
 endif
 
 ifeq "$(GhcDynamic)" "YES"
-RUNTEST_OPTS += --config ghc_dynamic=True
+RUNTEST_OPTS += -e config.ghc_dynamic=True
 CABAL_PLUGIN_BUILD = --enable-shared --disable-library-vanilla
 else
-RUNTEST_OPTS += --config ghc_dynamic=False
+RUNTEST_OPTS += -e config.ghc_dynamic=False
 CABAL_PLUGIN_BUILD = --enable-library-vanilla --disable-shared
 endif
 
@@ -213,9 +213,9 @@ RUNTEST_OPTS += -e darwin=False
 endif
 
 ifeq "$(IN_TREE_COMPILER)" "YES"
-RUNTEST_OPTS += --config in_tree_compiler=True
+RUNTEST_OPTS += -e config.in_tree_compiler=True
 else
-RUNTEST_OPTS += --config in_tree_compiler=False
+RUNTEST_OPTS += -e config.in_tree_compiler=False
 endif
 
 ifneq "$(THREADS)" ""
@@ -243,20 +243,20 @@ RUNTEST_OPTS += --test-env="$(TEST_ENV)"
 endif
 
 ifeq "$(CLEANUP)" "0"
-RUNTEST_OPTS += --config cleanup=False
+RUNTEST_OPTS += -e config.cleanup=False
 else ifeq "$(CLEANUP)" "NO"
-RUNTEST_OPTS += --config cleanup=False
+RUNTEST_OPTS += -e config.cleanup=False
 else
-RUNTEST_OPTS += --config cleanup=True
+RUNTEST_OPTS += -e config.cleanup=True
 endif
 
 ifeq "$(LOCAL)" "0"
 # See Note [Running tests in /tmp].
-RUNTEST_OPTS += --config local=False
+RUNTEST_OPTS += -e config.local=False
 else ifeq "$(LOCAL)" "NO"
-RUNTEST_OPTS += --config local=False
+RUNTEST_OPTS += -e config.local=False
 else
-RUNTEST_OPTS += --config local=True
+RUNTEST_OPTS += -e config.local=True
 endif
 
 RUNTEST_OPTS +=  \
@@ -315,30 +315,30 @@ RUNTEST_OPTS +=  \
 	$(EXTRA_RUNTEST_OPTS)
 
 ifeq "$(list_broken)" "YES"
-set_list_broken = --config list_broken=True
+set_list_broken = -e config.list_broken=True
 else
 set_list_broken =
 endif
 
 # See Note [validate and testsuite speed] in toplevel Makefile.
 ifneq "$(SPEED)" ""
-setspeed = --config speed="$(SPEED)"
+setspeed = -e config.speed="$(SPEED)"
 else ifeq "$(fast)" "YES"
 # Backward compatibility. Maybe some people are running 'make accept fast=YES'?
-setspeed = --config speed=2
+setspeed = -e config.speed=2
 else
 setspeed =
 endif
 
 ifeq "$(accept)" "YES"
-setaccept = --config accept=True
+setaccept = -e config.accept=True
 
 ifeq "$(PLATFORM)" "YES"
-setaccept += --config accept_platform=True
+setaccept += -e config.accept_platform=True
 endif
 
 ifeq "$(OS)" "YES"
-setaccept += --config accept_os=True
+setaccept += -e config.accept_os=True
 endif
 
 else



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4b559f04ab0ea6737e88717ff363d101535aedfa

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4b559f04ab0ea6737e88717ff363d101535aedfa
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/20200705/6b14edc3/attachment-0001.html>


More information about the ghc-commits mailing list