From 876c5f9e68fcdd670f4bf68f9b0e643539937888 Mon Sep 17 00:00:00 2001
From: Amir Mohammad Saied <amirsaied@gmail.com>
Date: Sun, 16 Jul 2017 10:57:04 +0100
Subject: [PATCH] Print the build profile in one line

---
 .../Distribution/Client/ProjectOrchestration.hs      |  7 ++++---
 .../BuildDeps/InternalLibrary1/cabal.out             |  4 +---
 .../UseLocalPackage/use-local-version-of-package.out |  4 +---
 .../PackageTests/BuildToolDepends/setup.out          |  4 +---
 .../PackageTests/BuildTools/External/cabal.out       |  4 +---
 .../PackageTests/BuildTools/Internal/cabal.out       |  4 +---
 .../PackageTests/CustomSegfault/cabal.out            |  1 +
 .../PackageTests/CustomWithoutCabal/cabal.out        |  4 +---
 .../CustomWithoutCabalDefaultMain/cabal.out          |  4 +---
 cabal-testsuite/PackageTests/Exec/cabal.out          |  4 +---
 cabal-testsuite/PackageTests/ExecModern/cabal.out    |  4 +---
 .../PackageTests/InternalLibraries/cabal.out         |  4 +---
 .../NewBuild/MonitorCabalFiles/cabal.out             |  8 ++------
 .../PackageTests/NewBuild/T3827/cabal.out            |  4 +---
 .../PackageTests/NewBuild/T4017/cabal.out            |  4 +---
 .../PackageTests/NewBuild/T4405/cabal.out            |  4 +---
 .../NewConfigure/LocalConfigOverwrite/cabal.out      |  4 +---
 .../PackageTests/Regression/T3436/cabal.out          |  4 +---
 .../T4154/install-time-with-constraint.out           |  4 +---
 .../PackageTests/Regression/T4202/cabal.out          | 12 +++---------
 .../PackageTests/TestSuiteTests/ExeV10/cabal.out     |  4 +---
 21 files changed, 27 insertions(+), 69 deletions(-)

diff --git a/cabal-install/Distribution/Client/ProjectOrchestration.hs b/cabal-install/Distribution/Client/ProjectOrchestration.hs
index 40fff66449..894c8caad7 100644
--- a/cabal-install/Distribution/Client/ProjectOrchestration.hs
+++ b/cabal-install/Distribution/Client/ProjectOrchestration.hs
@@ -762,9 +762,10 @@ printPlan verbosity
     showMonitorChangedReason  MonitorFirstRun     = "first run"
     showMonitorChangedReason  MonitorCorruptCache = "cannot read state cache"
 
-    showBuildProfile = "Build profile:\n" ++ (unlines [
-      "  with-compiler: " ++ (showCompilerId . pkgConfigCompiler) elaboratedShared,
-      "  optimization: " ++ (show (fromMaybe NormalOptimisation (Setup.flagToMaybe packageConfigOptimization)))])
+    showBuildProfile = "Build profile: " ++ (intercalate ", " [
+      "with-compiler: " ++ (showCompilerId . pkgConfigCompiler) elaboratedShared,
+      "optimization: " ++ (show (fromMaybe NormalOptimisation (Setup.flagToMaybe packageConfigOptimization)))]
+      ) ++ "\n"
 
 -- | If there are build failures then report them and throw an exception.
 --
diff --git a/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.out b/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.out
index b405b64662..1a390a98be 100644
--- a/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.out
+++ b/cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - InternalLibrary1-0.1 (exe:lemon) (first run)
 Configuring InternalLibrary1-0.1...
diff --git a/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/use-local-version-of-package.out b/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/use-local-version-of-package.out
index 4f867aa1ae..808fb52eb1 100644
--- a/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/use-local-version-of-package.out
+++ b/cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/use-local-version-of-package.out
@@ -2,9 +2,7 @@
 Downloading the latest package list from test-local-repo
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - pkg-1.0 (exe:my-exe) (first run)
 Configuring pkg-1.0...
diff --git a/cabal-testsuite/PackageTests/BuildToolDepends/setup.out b/cabal-testsuite/PackageTests/BuildToolDepends/setup.out
index 4ba89ac057..57493f50d6 100644
--- a/cabal-testsuite/PackageTests/BuildToolDepends/setup.out
+++ b/cabal-testsuite/PackageTests/BuildToolDepends/setup.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - pre-proc-999.999.999 (exe:zero-to-one) (first run)
  - client-0.1.0.0 (exe:hello-world) (first run)
diff --git a/cabal-testsuite/PackageTests/BuildTools/External/cabal.out b/cabal-testsuite/PackageTests/BuildTools/External/cabal.out
index ffd690f30e..9eab0ac040 100644
--- a/cabal-testsuite/PackageTests/BuildTools/External/cabal.out
+++ b/cabal-testsuite/PackageTests/BuildTools/External/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - happy-999.999.999 (exe:happy) (first run)
  - client-0.1.0.0 (exe:hello-world) (first run)
diff --git a/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out b/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out
index c8744a279f..37de994b1f 100644
--- a/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out
+++ b/cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - foo-0.1.0.0 (exe:my-cpp) (first run)
  - foo-0.1.0.0 (lib) (first run)
diff --git a/cabal-testsuite/PackageTests/CustomSegfault/cabal.out b/cabal-testsuite/PackageTests/CustomSegfault/cabal.out
index f13f773c93..5114651371 100644
--- a/cabal-testsuite/PackageTests/CustomSegfault/cabal.out
+++ b/cabal-testsuite/PackageTests/CustomSegfault/cabal.out
@@ -1,5 +1,6 @@
 # cabal new-build
 Resolving dependencies...
+Build profile: with-compiler: ghc-<GHCVER>, optimization: NormalOptimisation
 In order, the following will be built:
  - plain-0.1.0.0 (lib:plain) (first run)
 cabal: Failed to build plain-0.1.0.0-inplace. The failure occurred during the configure step. The build process segfaulted (i.e. SIGSEGV).
diff --git a/cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.out b/cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.out
index fa4e5f8495..534f8f60cf 100644
--- a/cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.out
+++ b/cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Warning: <ROOT>/custom-setup-without-cabal.cabal: This package requires at least Cabal version 99999
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - custom-setup-without-cabal-1.0 (lib:custom-setup-without-cabal) (first run)
diff --git a/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.out b/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.out
index 5d7a3ab73a..485f8a076e 100644
--- a/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.out
+++ b/cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.out
@@ -1,7 +1,5 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - custom-setup-without-cabal-defaultMain-1.0 (lib:custom-setup-without-cabal-defaultMain) (first run)
diff --git a/cabal-testsuite/PackageTests/Exec/cabal.out b/cabal-testsuite/PackageTests/Exec/cabal.out
index fda0068855..5dcd67280f 100644
--- a/cabal-testsuite/PackageTests/Exec/cabal.out
+++ b/cabal-testsuite/PackageTests/Exec/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - my-0.1 (exe:my-executable) (first run)
 Configuring my-0.1...
diff --git a/cabal-testsuite/PackageTests/ExecModern/cabal.out b/cabal-testsuite/PackageTests/ExecModern/cabal.out
index aa5ad7124a..97ddcc4a38 100644
--- a/cabal-testsuite/PackageTests/ExecModern/cabal.out
+++ b/cabal-testsuite/PackageTests/ExecModern/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - my-0.1 (exe:my-executable) (first run)
 Configuring executable 'my-executable' for my-0.1..
diff --git a/cabal-testsuite/PackageTests/InternalLibraries/cabal.out b/cabal-testsuite/PackageTests/InternalLibraries/cabal.out
index 43b1ec77ed..4184d77d82 100644
--- a/cabal-testsuite/PackageTests/InternalLibraries/cabal.out
+++ b/cabal-testsuite/PackageTests/InternalLibraries/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - p-0.1.0.0 (lib:q) (first run)
  - p-0.1.0.0 (exe:foo) (first run)
diff --git a/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/cabal.out b/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/cabal.out
index 3ecc043ff3..f2e8d3aa66 100644
--- a/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/cabal.out
+++ b/cabal-testsuite/PackageTests/NewBuild/MonitorCabalFiles/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - q-0.1.0.0 (exe:q) (first run)
 Configuring executable 'q' for q-0.1.0.0..
@@ -10,9 +8,7 @@ Preprocessing executable 'q' for q-0.1.0.0..
 Building executable 'q' for q-0.1.0.0..
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - p-1.0 (lib) (first run)
  - q-0.1.0.0 (exe:q) (configuration changed)
diff --git a/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.out b/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.out
index 8c0cbd138e..8bcea1b9ca 100644
--- a/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.out
+++ b/cabal-testsuite/PackageTests/NewBuild/T3827/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - p-1.0 (lib) --enable-library-profiling (first run)
  - q-1.0 (exe:q) --enable-profiling (first run)
diff --git a/cabal-testsuite/PackageTests/NewBuild/T4017/cabal.out b/cabal-testsuite/PackageTests/NewBuild/T4017/cabal.out
index d151f5d709..dfb2122bd1 100644
--- a/cabal-testsuite/PackageTests/NewBuild/T4017/cabal.out
+++ b/cabal-testsuite/PackageTests/NewBuild/T4017/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - p-1.0 (lib) (first run)
  - q-1.0 (lib) (first run)
diff --git a/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.out b/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.out
index 6f2c83d7cc..c5b0e61092 100644
--- a/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.out
+++ b/cabal-testsuite/PackageTests/NewBuild/T4405/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - p-1.0 (lib) (first run)
  - q-1.0 (lib) (first run)
diff --git a/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.out b/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.out
index 96005c7a3d..e232a9d9f7 100644
--- a/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.out
+++ b/cabal-testsuite/PackageTests/NewConfigure/LocalConfigOverwrite/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-configure
 'cabal.project.local' file already exists. Now overwriting it.
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following would be built:
  - NewConfigure-0.1.0.0 (lib) (first run)
diff --git a/cabal-testsuite/PackageTests/Regression/T3436/cabal.out b/cabal-testsuite/PackageTests/Regression/T3436/cabal.out
index 1cb2a14bf2..8e7c356c90 100644
--- a/cabal-testsuite/PackageTests/Regression/T3436/cabal.out
+++ b/cabal-testsuite/PackageTests/Regression/T3436/cabal.out
@@ -1,9 +1,7 @@
 # cabal new-build
 Warning: <ROOT>/custom-setup/custom-setup.cabal: This package requires at least Cabal version 99999
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - Cabal-99999 (lib:Cabal) (first run)
  - custom-setup-1.0 (lib:custom-setup) (first run)
diff --git a/cabal-testsuite/PackageTests/Regression/T4154/install-time-with-constraint.out b/cabal-testsuite/PackageTests/Regression/T4154/install-time-with-constraint.out
index 3333ab916e..aa3cd7a8fe 100644
--- a/cabal-testsuite/PackageTests/Regression/T4154/install-time-with-constraint.out
+++ b/cabal-testsuite/PackageTests/Regression/T4154/install-time-with-constraint.out
@@ -2,9 +2,7 @@
 Downloading the latest package list from test-local-repo
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following would be built:
  - Cabal-99999 (lib) (requires download & build)
  - time-99999 (lib:time) (first run)
diff --git a/cabal-testsuite/PackageTests/Regression/T4202/cabal.out b/cabal-testsuite/PackageTests/Regression/T4202/cabal.out
index de11d0f565..ed138d86b1 100644
--- a/cabal-testsuite/PackageTests/Regression/T4202/cabal.out
+++ b/cabal-testsuite/PackageTests/Regression/T4202/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-build
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - p-1.0 (lib) (first run)
  - q-1.0 (exe:qexe) (first run)
@@ -13,17 +11,13 @@ Configuring executable 'qexe' for q-1.0..
 Preprocessing executable 'qexe' for q-1.0..
 Building executable 'qexe' for q-1.0..
 # cabal new-build
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - p-1.0 (lib) (file P.hs changed)
 Preprocessing library for p-1.0..
 Building library for p-1.0..
 # cabal new-build
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - q-1.0 (exe:qexe) (file <ROOT>/cabal.dist/work/dist/build/<ARCH>/ghc-<GHCVER>/p-1.0/cache/build changed)
 Preprocessing executable 'qexe' for q-1.0..
diff --git a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out
index 774105c32b..b53e34eec4 100644
--- a/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out
+++ b/cabal-testsuite/PackageTests/TestSuiteTests/ExeV10/cabal.out
@@ -1,8 +1,6 @@
 # cabal new-test
 Resolving dependencies...
-Build profile:
-  with-compiler: ghc-<GHCVER>
-  optimization: NormalOptimisation
+Build profile: with-compiler: ghc-<GHCVER>, optimization: MaximumOptimisation
 In order, the following will be built:
  - my-0.1 (lib) (first run)
  - my-0.1 (test:test-Short) (first run)
-- 
GitLab