Skip to content

Commit ef5c98b

Browse files
authored
Merge of #9050
2 parents 9b011a4 + f247c0b commit ef5c98b

File tree

4 files changed

+25
-32
lines changed

4 files changed

+25
-32
lines changed

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

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -568,27 +568,27 @@ baseSavedConfig = do
568568
--
569569
initialSavedConfig :: IO SavedConfig
570570
initialSavedConfig = do
571-
cacheDir <- defaultCacheDir
572-
logsDir <- defaultLogsDir
573-
extraPath <- defaultExtraPath
571+
cacheDir <- defaultCacheDir
572+
logsDir <- defaultLogsDir
574573
installPath <- defaultInstallPath
575-
return mempty {
576-
savedGlobalFlags = mempty {
577-
globalCacheDir = toFlag cacheDir,
578-
globalRemoteRepos = toNubList [defaultRemoteRepo]
579-
},
580-
savedConfigureFlags = mempty {
581-
configProgramPathExtra = toNubList extraPath
582-
},
583-
savedInstallFlags = mempty {
584-
installSummaryFile = toNubList [toPathTemplate (logsDir </> "build.log")],
585-
installBuildReports= toFlag NoReports,
586-
installNumJobs = toFlag Nothing
587-
},
588-
savedClientInstallFlags = mempty {
589-
cinstInstalldir = toFlag installPath
590-
}
591-
}
574+
return
575+
mempty
576+
{ savedGlobalFlags =
577+
mempty
578+
{ globalCacheDir = toFlag cacheDir
579+
, globalRemoteRepos = toNubList [defaultRemoteRepo]
580+
}
581+
, savedInstallFlags =
582+
mempty
583+
{ installSummaryFile = toNubList [toPathTemplate (logsDir </> "build.log")]
584+
, installBuildReports = toFlag NoReports
585+
, installNumJobs = toFlag Nothing
586+
}
587+
, savedClientInstallFlags =
588+
mempty
589+
{ cinstInstalldir = toFlag installPath
590+
}
591+
}
592592

593593
-- | Issue a warning if both @$XDG_CONFIG_HOME/cabal/config@ and
594594
-- @~/.cabal@ exists.
@@ -674,16 +674,6 @@ defaultReportsDir :: IO FilePath
674674
defaultReportsDir =
675675
getDefaultDir XdgCache "reports"
676676

677-
defaultExtraPath :: IO [FilePath]
678-
defaultExtraPath = do
679-
mDir <- maybeGetCabalDir
680-
case mDir of
681-
Just dir ->
682-
return [dir </> "bin"]
683-
Nothing -> do
684-
dir <- getHomeDirectory
685-
return [dir </> ".local" </> "bin"]
686-
687677
defaultInstallPath :: IO FilePath
688678
defaultInstallPath = do
689679
mDir <- maybeGetCabalDir

cabal-install/tests/IntegrationTests2.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,7 @@ testConfigOptionComments = do
20312031
"-- extra-lib-dirs" @=? findLineWith True "extra-lib-dirs" defaultConfigFile
20322032
"-- extra-lib-dirs-static" @=? findLineWith True "extra-lib-dirs-static" defaultConfigFile
20332033
"-- extra-framework-dirs" @=? findLineWith True "extra-framework-dirs" defaultConfigFile
2034-
"extra-prog-path" @=? findLineWith False "extra-prog-path" defaultConfigFile
2034+
"-- extra-prog-path" @=? findLineWith False "extra-prog-path" defaultConfigFile
20352035
"-- instantiate-with" @=? findLineWith True "instantiate-with" defaultConfigFile
20362036
"-- tests" @=? findLineWith True "tests" defaultConfigFile
20372037
"-- coverage" @=? findLineWith True "coverage" defaultConfigFile

cabal-install/tests/IntegrationTests2/config/default-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ remote-repo-cache: /home/colton/.cabal/packages
6363
-- extra-lib-dirs:
6464
-- extra-lib-dirs-static:
6565
-- extra-framework-dirs:
66-
extra-prog-path: /home/colton/.cabal/bin
66+
-- extra-prog-path:
6767
-- instantiate-with:
6868
-- tests: False
6969
-- coverage: False

changelog.d/issue-8951

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
synopsis: Don't add `extra-prog-path: ~/.local/bin` when initially creating `~/.config/cabal/config`
2+
packages: cabal-install
3+
issues: #8951

0 commit comments

Comments
 (0)