Skip to content

Commit

Permalink
Merge branch 'master' into simplify-choose-solver
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka authored Sep 25, 2023
2 parents 3eac77f + b639bfa commit e1f9530
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Cabal/src/Distribution/Simple/GHC/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ componentGhcOptions verbosity implInfo lbi bi clbi odir =
, ghcOptFfiIncludes = toNubListR $ includes bi
, ghcOptObjDir = toFlag odir
, ghcOptHiDir = toFlag odir
, ghcOptHieDir = bool NoFlag (toFlag $ odir </> extraCompilationArtifacts) $ flagHie implInfo
, ghcOptHieDir = bool NoFlag (toFlag $ odir </> extraCompilationArtifacts </> "hie") $ flagHie implInfo
, ghcOptStubDir = toFlag odir
, ghcOptOutputDir = toFlag odir
, ghcOptOptimisation = toGhcOptimisation (withOptimization lbi)
Expand Down
24 changes: 13 additions & 11 deletions cabal-install/src/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -731,17 +731,19 @@ initialSavedConfig = do
warnOnTwoConfigs :: Verbosity -> IO ()
warnOnTwoConfigs verbosity = do
defaultDir <- getAppUserDataDirectory "cabal"
dotCabalExists <- doesDirectoryExist defaultDir
xdgCfg <- getXdgDirectory XdgConfig ("cabal" </> "config")
xdgCfgExists <- doesFileExist xdgCfg
when (dotCabalExists && xdgCfgExists) $
warn verbosity $
"Both "
<> defaultDir
<> " and "
<> xdgCfg
<> " exist - ignoring the former.\n"
<> "It is advisable to remove one of them. In that case, we will use the remaining one by default (unless '$CABAL_DIR' is explicitly set)."
xdgCfgDir <- getXdgDirectory XdgConfig "cabal"
when (defaultDir /= xdgCfgDir) $ do
dotCabalExists <- doesDirectoryExist defaultDir
let xdgCfg = xdgCfgDir </> "config"
xdgCfgExists <- doesFileExist xdgCfg
when (dotCabalExists && xdgCfgExists) $
warn verbosity $
"Both "
<> defaultDir
<> " and "
<> xdgCfg
<> " exist - ignoring the former.\n"
<> "It is advisable to remove one of them. In that case, we will use the remaining one by default (unless '$CABAL_DIR' is explicitly set)."

-- | If @CABAL\_DIR@ is set, return @Just@ its value. Otherwise, if
-- @~/.cabal@ exists and @$XDG_CONFIG_HOME/cabal/config@ does not
Expand Down
2 changes: 1 addition & 1 deletion cabal-testsuite/PackageTests/CopyHie/cabal.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ main = withShorterPathForNewBuildStore $ \storeDir -> cabalTest $ withRepo "repo
cabalG ["--store-dir=" ++ storeDir] "v2-build" ["hie"]
liftIO $ do
installedDependencyLibDir <- findDependencyInStore storeDir "hie-dependency"
shouldExist $ installedDependencyLibDir </> "lib" </> "extra-compilation-artifacts" </> "HieDependency.hie"
shouldExist $ installedDependencyLibDir </> "lib" </> "extra-compilation-artifacts" </> "hie" </> "HieDependency.hie"
2 changes: 1 addition & 1 deletion cabal-testsuite/PackageTests/CopyHie/setup.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ main = setupAndCabalTest $ withPackageDb $ do
skipUnlessGhcVersion ">= 8.8"
setup_install ["hie-local"]
env <- getTestEnv
shouldExist $ testLibInstallDir env </> "hie-local-0.1.0.0" </> "extra-compilation-artifacts" </> "HieLocal.hie"
shouldExist $ testLibInstallDir env </> "hie-local-0.1.0.0" </> "extra-compilation-artifacts" </> "hie" </> "HieLocal.hie"
Loading

0 comments on commit e1f9530

Please sign in to comment.