Skip to content

Commit

Permalink
Print out which project file we're using by default (fix #8519)
Browse files Browse the repository at this point in the history
Before it's only printed under `-v`.
  • Loading branch information
ulysses4ever committed Nov 3, 2024
1 parent 0fbb0db commit 321aa6e
Show file tree
Hide file tree
Showing 180 changed files with 781 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ rebuildProjectConfig

sequence_
[ do
info verbosity . render . vcat $
text "this build was affected by the following (project) config files:"
notice verbosity . render . vcat $
text "Configuration is affected by the following files:"
: [text "-" <+> docProjectConfigPath path]
| Explicit path <- Set.toList $ projectConfigProvenance projectConfig
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.external.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.external.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.internal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.internal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Includes2/cov.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal test
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.external.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.internal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand All @@ -18,8 +20,7 @@ Configuring library 'indef' instantiated with
Data.Map = containers-<VERSION>:Data.Map
for I-0.1.0.0...
Preprocessing library 'indef' for I-0.1.0.0...
Building library 'indef' instantiated with
Data.Map = containers-<VERSION>:Data.Map
Building library 'indef' instantiated with Data.Map = containers-<VERSION>:Data.Map
for I-0.1.0.0...
Configuring executable 'exe' for I-0.1.0.0...
Preprocessing executable 'exe' for I-0.1.0.0...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# cabal v2-update
Configuration is affected by the following files:
- cabal.repo.project
Downloading the latest package list from test-local-repo
# cabal v2-build
Configuration is affected by the following files:
- cabal.repo.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Reexport2/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Error:
Problem with module re-exports:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/T6385/cabal.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/bkpcabal01/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/BuildDeps/DepCycle/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Error:
Dependency cycle between the following components:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand All @@ -11,6 +13,8 @@ Building executable 'my-exe' for pkg-1.0...
# pkg my-exe
local pkg-1.0
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/BuildToolDepends/setup.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/BuildTools/External/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/CmmSources/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-run
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/CmmSourcesDyn/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-run
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/CmmSourcesExe/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal v2-run
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down
153 changes: 153 additions & 0 deletions cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# cabal v2-update
Downloading the latest package list from test-local-repo
# cabal v2-run
Configuration is affected by the following files:
- cabal.project
Configuration is affected by the following files:
- extra.project
imported by: cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand Down Expand Up @@ -62,6 +67,15 @@ cyclical import of cyclical-2-out-out-self-b.config;
imported by: cyclical-2-out-out-self.project
# checking that cyclical check doesn't false-positive on same file names in different folders; hoping within a folder and then into a subfolder
# cabal v2-build
Configuration is affected by the following files:
- noncyclical-same-filename-a.config
imported by: noncyclical-same-filename-a.project
Configuration is affected by the following files:
- noncyclical-same-filename-a.project
Configuration is affected by the following files:
- same-filename/noncyclical-same-filename-a.config
imported by: noncyclical-same-filename-a.config
imported by: noncyclical-same-filename-a.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
Expand All @@ -71,6 +85,15 @@ Preprocessing library for my-0.1...
Building library for my-0.1...
# checking that cyclical check doesn't false-positive on same file names in different folders; hoping into a subfolder and then back out again
# cabal v2-build
Configuration is affected by the following files:
- noncyclical-same-filename-b.config
imported by: same-filename/noncyclical-same-filename-b.config
imported by: noncyclical-same-filename-b.project
Configuration is affected by the following files:
- noncyclical-same-filename-b.project
Configuration is affected by the following files:
- same-filename/noncyclical-same-filename-b.config
imported by: noncyclical-same-filename-b.project
Up to date
# checking that cyclical check catches a same file name that imports itself
# cabal v2-build
Expand Down Expand Up @@ -101,9 +124,139 @@ cyclical import of cyclical-same-filename-out-out-back.config;
imported by: cyclical-same-filename-out-out-back.project
# checking that imports work skipping into a subfolder and then back out again and again
# cabal v2-build
Configuration is affected by the following files:
- hops-0.project
Configuration is affected by the following files:
- hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops-4.config
imported by: hops/hops-3.config
imported by: hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops-6.config
imported by: hops/hops-5.config
imported by: hops-4.config
imported by: hops/hops-3.config
imported by: hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops-8.config
imported by: hops/hops-7.config
imported by: hops-6.config
imported by: hops/hops-5.config
imported by: hops-4.config
imported by: hops/hops-3.config
imported by: hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops/hops-3.config
imported by: hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops/hops-5.config
imported by: hops-4.config
imported by: hops/hops-3.config
imported by: hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops/hops-7.config
imported by: hops-6.config
imported by: hops/hops-5.config
imported by: hops-4.config
imported by: hops/hops-3.config
imported by: hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Configuration is affected by the following files:
- hops/hops-9.config
imported by: hops-8.config
imported by: hops/hops-7.config
imported by: hops-6.config
imported by: hops/hops-5.config
imported by: hops-4.config
imported by: hops/hops-3.config
imported by: hops-2.config
imported by: hops/hops-1.config
imported by: hops-0.project
Up to date
# checking conflicting constraints skipping into a subfolder and then back out again and again
# cabal v2-build
Configuration is affected by the following files:
- oops-0.project
Configuration is affected by the following files:
- oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops-4.config
imported by: oops/oops-3.config
imported by: oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops-6.config
imported by: oops/oops-5.config
imported by: oops-4.config
imported by: oops/oops-3.config
imported by: oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops-8.config
imported by: oops/oops-7.config
imported by: oops-6.config
imported by: oops/oops-5.config
imported by: oops-4.config
imported by: oops/oops-3.config
imported by: oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops/oops-3.config
imported by: oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops/oops-5.config
imported by: oops-4.config
imported by: oops/oops-3.config
imported by: oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops/oops-7.config
imported by: oops-6.config
imported by: oops/oops-5.config
imported by: oops-4.config
imported by: oops/oops-3.config
imported by: oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Configuration is affected by the following files:
- oops/oops-9.config
imported by: oops-8.config
imported by: oops/oops-7.config
imported by: oops-6.config
imported by: oops/oops-5.config
imported by: oops-4.config
imported by: oops/oops-3.config
imported by: oops-2.config
imported by: oops/oops-1.config
imported by: oops-0.project
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
-- +-- hops/hops-9.config (no further imports so not cyclical)
log "checking that imports work skipping into a subfolder and then back out again and again"
hopping <- cabal' "v2-build" [ "--project-file=hops-0.project" ]
assertOutputContains "this build was affected by the following (project) config files:" hopping
assertOutputContains "Configuration is affected by the following files" hopping
assertOutputContains "- hops-0.project" hopping

assertOutputContains
Expand Down
2 changes: 2 additions & 0 deletions cabal-testsuite/PackageTests/ConfigFile/T8487/cabal.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cabal build
Configuration is affected by the following files:
- cabal.project
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O2
In order, the following will be built:
Expand Down
Loading

0 comments on commit 321aa6e

Please sign in to comment.