Commit b8d85c8b authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Sandbox config: ignore the value of 'symlink-bindir' from '~/.cabal/config'.

Fixes #1514.
parent 5e4bd78c
...@@ -326,7 +326,8 @@ tryLoadSandboxPackageEnvironmentFile verbosity pkgEnvFile configFileFlag = do ...@@ -326,7 +326,8 @@ tryLoadSandboxPackageEnvironmentFile verbosity pkgEnvFile configFileFlag = do
inherited <- inheritedPackageEnvironment verbosity user inherited <- inheritedPackageEnvironment verbosity user
-- Layer the package environment settings over settings from ~/.cabal/config. -- Layer the package environment settings over settings from ~/.cabal/config.
cabalConfig <- loadConfig verbosity configFileFlag NoFlag cabalConfig <- fmap unsetSymlinkBinDir $
loadConfig verbosity configFileFlag NoFlag
return (sandboxDir, return (sandboxDir,
updateInstallDirs $ updateInstallDirs $
(base `mappend` (toPkgEnv cabalConfig) `mappend` (base `mappend` (toPkgEnv cabalConfig) `mappend`
...@@ -336,8 +337,8 @@ tryLoadSandboxPackageEnvironmentFile verbosity pkgEnvFile configFileFlag = do ...@@ -336,8 +337,8 @@ tryLoadSandboxPackageEnvironmentFile verbosity pkgEnvFile configFileFlag = do
toPkgEnv config = mempty { pkgEnvSavedConfig = config } toPkgEnv config = mempty { pkgEnvSavedConfig = config }
updateInstallDirs pkgEnv = updateInstallDirs pkgEnv =
let config = pkgEnvSavedConfig pkgEnv let config = pkgEnvSavedConfig pkgEnv
configureFlags = savedConfigureFlags config configureFlags = savedConfigureFlags config
installDirs = savedUserInstallDirs config installDirs = savedUserInstallDirs config
in pkgEnv { in pkgEnv {
pkgEnvSavedConfig = config { pkgEnvSavedConfig = config {
...@@ -347,6 +348,16 @@ tryLoadSandboxPackageEnvironmentFile verbosity pkgEnvFile configFileFlag = do ...@@ -347,6 +348,16 @@ tryLoadSandboxPackageEnvironmentFile verbosity pkgEnvFile configFileFlag = do
} }
} }
-- We don't want to inherit the value of 'symlink-bindir' from
-- '~/.cabal/config'. See #1514.
unsetSymlinkBinDir config =
let installFlags = savedInstallFlags config
in config {
savedInstallFlags = installFlags {
installSymlinkBinDir = NoFlag
}
}
-- | Should the generated package environment file include comments? -- | Should the generated package environment file include comments?
data IncludeComments = IncludeComments | NoComments data IncludeComments = IncludeComments | NoComments
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment