Skip to content

Commit

Permalink
Merge pull request #9050 from haskell/mergify/bp/3.10/pr-8952
Browse files Browse the repository at this point in the history
Don't add `extra-prog-path` to `~/.config/cabal/config` (#8951) (backport #8952)
  • Loading branch information
mergify[bot] authored Jul 13, 2023
2 parents 9b011a4 + f247c0b commit 5d86771
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 32 deletions.
50 changes: 20 additions & 30 deletions cabal-install/src/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/tests/IntegrationTests2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions changelog.d/issue-8951
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
synopsis: Don't add `extra-prog-path: ~/.local/bin` when initially creating `~/.config/cabal/config`
packages: cabal-install
issues: #8951

0 comments on commit 5d86771

Please sign in to comment.