Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not print "up to date" unless running build #8569

Merged
merged 5 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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