diff --git a/cabal-install/src/Distribution/Client/Config.hs b/cabal-install/src/Distribution/Client/Config.hs index 3787fc89c96..a352054aeec 100644 --- a/cabal-install/src/Distribution/Client/Config.hs +++ b/cabal-install/src/Distribution/Client/Config.hs @@ -568,27 +568,27 @@ baseSavedConfig = do -- initialSavedConfig :: IO SavedConfig initialSavedConfig = do - cacheDir <- defaultCacheDir - logsDir <- defaultLogsDir - extraPath <- defaultExtraPath + cacheDir <- defaultCacheDir + logsDir <- defaultLogsDir installPath <- defaultInstallPath - return mempty { - savedGlobalFlags = mempty { - globalCacheDir = toFlag cacheDir, - globalRemoteRepos = toNubList [defaultRemoteRepo] - }, - savedConfigureFlags = mempty { - configProgramPathExtra = toNubList extraPath - }, - savedInstallFlags = mempty { - installSummaryFile = toNubList [toPathTemplate (logsDir "build.log")], - installBuildReports= toFlag NoReports, - installNumJobs = toFlag Nothing - }, - savedClientInstallFlags = mempty { - cinstInstalldir = toFlag installPath - } - } + return + mempty + { savedGlobalFlags = + mempty + { globalCacheDir = toFlag cacheDir + , globalRemoteRepos = toNubList [defaultRemoteRepo] + } + , savedInstallFlags = + mempty + { installSummaryFile = toNubList [toPathTemplate (logsDir "build.log")] + , installBuildReports = toFlag NoReports + , installNumJobs = toFlag Nothing + } + , savedClientInstallFlags = + mempty + { cinstInstalldir = toFlag installPath + } + } -- | Issue a warning if both @$XDG_CONFIG_HOME/cabal/config@ and -- @~/.cabal@ exists. @@ -674,16 +674,6 @@ defaultReportsDir :: IO FilePath defaultReportsDir = getDefaultDir XdgCache "reports" -defaultExtraPath :: IO [FilePath] -defaultExtraPath = do - mDir <- maybeGetCabalDir - case mDir of - Just dir -> - return [dir "bin"] - Nothing -> do - dir <- getHomeDirectory - return [dir ".local" "bin"] - defaultInstallPath :: IO FilePath defaultInstallPath = do mDir <- maybeGetCabalDir diff --git a/cabal-install/tests/IntegrationTests2.hs b/cabal-install/tests/IntegrationTests2.hs index f2fdf2ea3df..3e3907035e1 100644 --- a/cabal-install/tests/IntegrationTests2.hs +++ b/cabal-install/tests/IntegrationTests2.hs @@ -2031,7 +2031,7 @@ testConfigOptionComments = do "-- extra-lib-dirs" @=? findLineWith True "extra-lib-dirs" defaultConfigFile "-- extra-lib-dirs-static" @=? findLineWith True "extra-lib-dirs-static" defaultConfigFile "-- extra-framework-dirs" @=? findLineWith True "extra-framework-dirs" defaultConfigFile - "extra-prog-path" @=? findLineWith False "extra-prog-path" defaultConfigFile + "-- extra-prog-path" @=? findLineWith False "extra-prog-path" defaultConfigFile "-- instantiate-with" @=? findLineWith True "instantiate-with" defaultConfigFile "-- tests" @=? findLineWith True "tests" defaultConfigFile "-- coverage" @=? findLineWith True "coverage" defaultConfigFile diff --git a/cabal-install/tests/IntegrationTests2/config/default-config b/cabal-install/tests/IntegrationTests2/config/default-config index 8e3aa02742c..fab39496295 100644 --- a/cabal-install/tests/IntegrationTests2/config/default-config +++ b/cabal-install/tests/IntegrationTests2/config/default-config @@ -63,7 +63,7 @@ remote-repo-cache: /home/colton/.cabal/packages -- extra-lib-dirs: -- extra-lib-dirs-static: -- extra-framework-dirs: -extra-prog-path: /home/colton/.cabal/bin +-- extra-prog-path: -- instantiate-with: -- tests: False -- coverage: False diff --git a/changelog.d/issue-8951 b/changelog.d/issue-8951 new file mode 100644 index 00000000000..38bc8c7503b --- /dev/null +++ b/changelog.d/issue-8951 @@ -0,0 +1,3 @@ +synopsis: Don't add `extra-prog-path: ~/.local/bin` when initially creating `~/.config/cabal/config` +packages: cabal-install +issues: #8951