Skip to content

Commit

Permalink
Do not print "up to date" unless running build (#8569)
Browse files Browse the repository at this point in the history
* do not print "up to date" unless running build

* Update cabal-tests

* Add changelog

* Remove accidentally added test generated files

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
cbclemmer and mergify[bot] authored Nov 10, 2022
1 parent 09c90de commit c07f999
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 17 deletions.
14 changes: 6 additions & 8 deletions cabal-install/src/Distribution/Client/ProjectOrchestration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -863,24 +863,22 @@ printPlan verbosity
PackageConfig {packageConfigOptimization = globalOptimization},
projectConfigLocalPackages =
PackageConfig {packageConfigOptimization = localOptimization}
}
},
currentCommand
}
ProjectBuildContext {
elaboratedPlanToExecute = elaboratedPlan,
elaboratedShared,
pkgsBuildStatus
}

| null pkgs
= notice verbosity "Up to date"

| otherwise
= noticeNoWrap verbosity $ unlines $
| null pkgs && currentCommand == BuildCommand
= notice verbosity "Up to date"
| not (null pkgs) = noticeNoWrap verbosity $ unlines $
(showBuildProfile ++ "In order, the following "
++ wouldWill ++ " be built"
++ ifNormal " (use -v for more details)" ++ ":")
: map showPkgAndReason pkgs

| otherwise = return ()
where
pkgs = InstallPlan.executionOrder elaboratedPlan

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ In order, the following will be built:
- fake-package-0 (exe:cabal-script-script.hs) (first run)
Configuring executable 'cabal-script-script.hs' for fake-package-0..
Building executable 'cabal-script-script.hs' for fake-package-0..
# cabal v2-run
Up to date
# cabal v2-run
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Configuring executable 'bar' for MultipleExes-1.0..
Preprocessing executable 'bar' for MultipleExes-1.0..
Building executable 'bar' for MultipleExes-1.0..
# cabal v2-run
Up to date

# cabal v2-run
Error: cabal: The run command is for running a single executable at once. The target '' refers to the package MultipleExes-1.0 which includes
- executables: bar and foo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Configuring executable 'bar-exe' for bar-1.0..
Preprocessing executable 'bar-exe' for bar-1.0..
Building executable 'bar-exe' for bar-1.0..
# cabal v2-run
Up to date
# cabal v2-run
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
Expand Up @@ -6,4 +6,3 @@ In order, the following will be built:
Configuring executable 'cabal-script-script.hs' for fake-package-0..
Building executable 'cabal-script-script.hs' for fake-package-0..
# cabal v2-run
Up to date
4 changes: 0 additions & 4 deletions cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/cabal.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ Configuring executable 'foo' for Single-1.0..
Preprocessing executable 'foo' for Single-1.0..
Building executable 'foo' for Single-1.0..
# cabal v2-run
Up to date
# cabal v2-run
Up to date
# cabal v2-run
Up to date
# cabal v2-run
Up to date
# cabal v2-run
Error: cabal: Cannot run the package bar, it is not in this project (either directly or indirectly). If you want to add it to the project then edit the cabal.project file.
4 changes: 4 additions & 0 deletions changelog.d/issue-4994
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
synopsis: Do not print "up to date" for commands unless running "cabal build"
packages: Cabal
issues: #4994
prs: #8569

0 comments on commit c07f999

Please sign in to comment.