diff --git a/cabal-install/src/Distribution/Client/CmdInstall.hs b/cabal-install/src/Distribution/Client/CmdInstall.hs index cd1254b5fe1..c974e9511a3 100644 --- a/cabal-install/src/Distribution/Client/CmdInstall.hs +++ b/cabal-install/src/Distribution/Client/CmdInstall.hs @@ -430,10 +430,12 @@ installAction flags@NixStyleFlags { extraFlags = clientInstallFlags', .. } targe configFlags' = disableTestsBenchsByDefault configFlags verbosity = fromFlagOrDefault normal (configVerbosity configFlags') ignoreProject = flagIgnoreProject projectFlags - cliConfig = commandLineFlagsToProjectConfig + baseCliConfig = commandLineFlagsToProjectConfig globalFlags flags { configFlags = configFlags' } clientInstallFlags' + -- Ignore the local/remote distinction for the install command: #8637 + cliConfig = baseCliConfig { projectConfigAllPackages = projectConfigLocalPackages baseCliConfig } globalConfigFlag = projectConfigConfigFile (projectConfigShared cliConfig) -- | Verify that invalid config options were not passed to the install command. diff --git a/changelog.d/issue-8637 b/changelog.d/issue-8637 new file mode 100644 index 00000000000..fa176d2b0ae --- /dev/null +++ b/changelog.d/issue-8637 @@ -0,0 +1,13 @@ +synopsis: Apply command line flags to install packages +packages: cabal-install +prs: # +issues: #8637 + +description: { + +- Command line flags usually only apply to "local" packages (packages specified + in the cabal.project). This change causes the v2-install command to ignore + that distinction to better match the expected behavior for packages specified + directly in the command. + +}