Skip to content

Commit 528cf85

Browse files
committed
WIP: first steps
1 parent 2b0ccee commit 528cf85

File tree

197 files changed

+134
-679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+134
-679
lines changed

cabal-install/src/Distribution/Client/ProjectPlanning.hs

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ import Control.Monad.IO.Class (liftIO)
226226
import Control.Monad.State as State (State, execState, runState, state)
227227
import Data.Foldable (fold)
228228
import Data.List (deleteBy, groupBy)
229+
import qualified Data.List as L
229230
import qualified Data.List.NonEmpty as NE
230231
import qualified Data.Map as Map
231232
import qualified Data.Set as Set
@@ -407,13 +408,7 @@ rebuildProjectConfig
407408
localPackages <- phaseReadLocalPackages compiler (projectConfig <> cliConfig)
408409
return (projectConfig, localPackages)
409410

410-
let configfiles =
411-
[ text "-" <+> docProjectConfigPath path
412-
| Explicit path <- Set.toList . (if verbosity >= verbose then id else onlyTopLevelProvenance) $ projectConfigProvenance projectConfig
413-
]
414-
unless (null configfiles) $
415-
notice (verboseStderr verbosity) . render . vcat $
416-
text "Configuration is affected by the following files:" : configfiles
411+
informAboutConfigFiles projectConfig
417412

418413
return (projectConfig <> cliConfig, localPackages)
419414
where
@@ -460,6 +455,48 @@ rebuildProjectConfig
460455
projectConfigBuildOnly
461456
pkgLocations
462457

458+
informAboutConfigFiles projectConfig =
459+
unless (null configFiles)
460+
. out (verboseStderr verbosity)
461+
. render
462+
$ message
463+
where
464+
-- output mode is either 'notice' or 'info' depending on how trivial the information
465+
out
466+
| allProjectFilesInCWD = info
467+
| otherwise = notice
468+
where
469+
allProjectFilesInCWD =
470+
map projectConfigPathRoot configFiles
471+
L.\\ ["cabal.project", "cabal.project.local", "cabal.freeze"]
472+
== []
473+
474+
-- formatting depends on |config files| (the number of config files)
475+
message = case configFilesDoc of
476+
(_ : _ : _ : _) ->
477+
-- \|config files| > 2 => vertical list
478+
text "Configuration is affected by the following files:" <+> configFilesVertList
479+
[path1, path2] ->
480+
text "Configuration is affected by '" <+> path1 <+> text "' and '" <+> path2 <+> text "'"
481+
[path] ->
482+
text
483+
"Configuration is affected by '"
484+
<+> path
485+
<+> text "'"
486+
[] ->
487+
error "impossible" -- see `unless (null configFiles)` above
488+
where
489+
configFilesDoc = map docProjectConfigPath configFiles
490+
configFilesVertList = docProjectConfigFiles configFiles
491+
492+
configFiles =
493+
[ path
494+
| Explicit path <-
495+
Set.toList
496+
. (if verbosity >= verbose then id else onlyTopLevelProvenance)
497+
$ projectConfigProvenance projectConfig
498+
]
499+
463500
configureCompiler
464501
:: Verbosity
465502
-> DistDirLayout

cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external-target.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.external.project
2+
Configuration is affected by ' cabal.external.project '
43
Resolving dependencies...
54
Build profile: -w ghc-<GHCVER> -O1
65
In order, the following will be built:

cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.external.project
2+
Configuration is affected by ' cabal.external.project '
43
Resolving dependencies...
54
Build profile: -w ghc-<GHCVER> -O1
65
In order, the following will be built:

cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.internal.project
2+
Configuration is affected by ' cabal.internal.project '
43
Resolving dependencies...
54
Build profile: -w ghc-<GHCVER> -O1
65
In order, the following will be built:

cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.internal.project
2+
Configuration is affected by ' cabal.internal.project '
43
Resolving dependencies...
54
Build profile: -w ghc-<GHCVER> -O1
65
In order, the following will be built:

cabal-testsuite/PackageTests/Backpack/Includes2/cov.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal test
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/Backpack/Includes3/cabal-external.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.external.project
2+
Configuration is affected by ' cabal.external.project '
43
Resolving dependencies...
54
Build profile: -w ghc-<GHCVER> -O1
65
In order, the following will be built:
@@ -16,7 +15,8 @@ Configuring library for indef-0.1.0.0...
1615
Preprocessing library for indef-0.1.0.0...
1716
Building library instantiated with Data.Map = <Data.Map>
1817
for indef-0.1.0.0...
19-
Configuring library instantiated with Data.Map = containers-<VERSION>:Data.Map
18+
Configuring library instantiated with
19+
Data.Map = containers-<VERSION>:Data.Map
2020
for indef-0.1.0.0...
2121
Preprocessing library for indef-0.1.0.0...
2222
Building library instantiated with Data.Map = containers-<VERSION>:Data.Map

cabal-testsuite/PackageTests/Backpack/Includes3/cabal-internal.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.internal.project
2+
Configuration is affected by ' cabal.internal.project '
43
Resolving dependencies...
54
Build profile: -w ghc-<GHCVER> -O1
65
In order, the following will be built:
@@ -20,7 +19,8 @@ Configuring library 'indef' instantiated with
2019
Data.Map = containers-<VERSION>:Data.Map
2120
for I-0.1.0.0...
2221
Preprocessing library 'indef' for I-0.1.0.0...
23-
Building library 'indef' instantiated with Data.Map = containers-<VERSION>:Data.Map
22+
Building library 'indef' instantiated with
23+
Data.Map = containers-<VERSION>:Data.Map
2424
for I-0.1.0.0...
2525
Configuring executable 'exe' for I-0.1.0.0...
2626
Preprocessing executable 'exe' for I-0.1.0.0...

cabal-testsuite/PackageTests/Backpack/Includes3/cabal-repo.out

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# cabal v2-update
2-
Configuration is affected by the following files:
3-
- cabal.repo.project
2+
Configuration is affected by ' cabal.repo.project '
43
Downloading the latest package list from test-local-repo
54
# cabal v2-build
6-
Configuration is affected by the following files:
7-
- cabal.repo.project
5+
Configuration is affected by ' cabal.repo.project '
86
Resolving dependencies...
97
Build profile: -w ghc-<GHCVER> -O1
108
In order, the following will be built:
@@ -22,7 +20,8 @@ Preprocessing library for indef-0.1.0.0...
2220
Building library instantiated with Data.Map = <Data.Map>
2321
for indef-0.1.0.0...
2422
Installing library in <PATH>
25-
Configuring library instantiated with Data.Map = containers-<VERSION>:Data.Map
23+
Configuring library instantiated with
24+
Data.Map = containers-<VERSION>:Data.Map
2625
for indef-0.1.0.0...
2726
Preprocessing library for indef-0.1.0.0...
2827
Building library instantiated with Data.Map = containers-<VERSION>:Data.Map

cabal-testsuite/PackageTests/Backpack/Reexport2/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Error:
64
Problem with module re-exports:

cabal-testsuite/PackageTests/Backpack/T6385/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# cabal v2-update
22
Downloading the latest package list from test-local-repo
33
# cabal v2-build
4-
Configuration is affected by the following files:
5-
- cabal.project
64
Resolving dependencies...
75
Build profile: -w ghc-<GHCVER> -O1
86
In order, the following will be built:

cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/BuildAutogenPackageGuard/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/BuildDeps/DepCycle/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Error:
64
Dependency cycle between the following components:

cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/BuildTargets/UseLocalPackage/use-local-version-of-package.out

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# cabal v2-update
22
Downloading the latest package list from test-local-repo
33
# cabal v2-build
4-
Configuration is affected by the following files:
5-
- cabal.project
64
Resolving dependencies...
75
Build profile: -w ghc-<GHCVER> -O1
86
In order, the following will be built:
@@ -13,8 +11,6 @@ Building executable 'my-exe' for pkg-1.0...
1311
# pkg my-exe
1412
local pkg-1.0
1513
# cabal v2-build
16-
Configuration is affected by the following files:
17-
- cabal.project
1814
Resolving dependencies...
1915
Error: [Cabal-7107]
2016
Could not resolve dependencies:

cabal-testsuite/PackageTests/BuildTargets/UseLocalPackageForSetup/use-local-package-as-setup-dep.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# cabal v2-update
22
Downloading the latest package list from test-local-repo
33
# cabal v2-build
4-
Configuration is affected by the following files:
5-
- cabal.project
64
Resolving dependencies...
75
Error: [Cabal-7107]
86
Could not resolve dependencies:

cabal-testsuite/PackageTests/BuildToolDepends/setup.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/BuildToolDependsExternal/setup.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/BuildTools/External/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/CmmSources/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-run
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-run
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/CmmSourcesExe/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-run
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/ConfigFile/T8487/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O2
64
In order, the following will be built:

cabal-testsuite/PackageTests/CopyHie/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# cabal v2-update
22
Downloading the latest package list from test-local-repo
33
# cabal v2-build
4-
Configuration is affected by the following files:
5-
- cabal.project
64
Resolving dependencies...
75
Build profile: -w ghc-<GHCVER> -O1
86
In order, the following will be built:

cabal-testsuite/PackageTests/CustomSegfault/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal test
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:
@@ -13,7 +11,7 @@ Building test suite 'test' for plain-0.1.0.0...
1311
Running 1 test suites...
1412
Test suite test: RUNNING...
1513
Test suite test: PASS
16-
Test suite logged to: <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/test/plain-0.1.0.0-test.log
17-
Package coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html
14+
Test suite logged to: cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/test/plain-0.1.0.0-test.log
15+
Package coverage report written to cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html
1816
1 of 1 test suites (1 of 1 test cases) passed.
19-
Package coverage report written to <ROOT>/cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html
17+
Package coverage report written to cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/plain-0.1.0.0/hpc/vanilla/html/hpc_index.html

cabal-testsuite/PackageTests/CustomWithoutCabal/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/Exec/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/ExecModern/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/ExternalCommand/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/ExternalCommandEnv/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/ExternalCommandHelp/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# cabal v2-build
2-
Configuration is affected by the following files:
3-
- cabal.project
42
Resolving dependencies...
53
Build profile: -w ghc-<GHCVER> -O1
64
In order, the following will be built:

cabal-testsuite/PackageTests/ExtraPackages/cabal.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# cabal v2-update
22
Downloading the latest package list from test-local-repo
33
# cabal v2-run
4-
Configuration is affected by the following files:
5-
- cabal.project
64
Resolving dependencies...
75
Build profile: -w ghc-<GHCVER> -O1
86
In order, the following will be built:

0 commit comments

Comments
 (0)