Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6484 stack path avoids EnvConfig where possible #6486

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Behavior changes:
* Stack uses the version of the Cabal package that comes with the specified
version of GHC. Stack no longer supports such Cabal versions before 2.2, which
came with versions of GHC before 8.4.
* `stack path --global-config`, `--programs`, and `--local-bin` no longer set
up Stack's environment.

Other enhancements:

Expand Down
6 changes: 3 additions & 3 deletions doc/path_command.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# The `stack path` command

~~~text
stack path [--stack-root] [--global-config] [--project-root] [--config-location]
[--bin-path] [--programs] [--compiler-exe] [--compiler-bin]
[--compiler-tools-bin] [--local-bin] [--extra-include-dirs]
stack path [--stack-root] [--global-config] [--programs] [--local-bin]
[--project-root] [--config-location] [--bin-path] [--compiler-exe]
[--compiler-bin] [--compiler-tools-bin] [--extra-include-dirs]
[--extra-library-dirs] [--snapshot-pkg-db] [--local-pkg-db]
[--global-pkg-db] [--ghc-package-path] [--snapshot-install-root]
[--local-install-root] [--snapshot-doc-root] [--local-doc-root]
Expand Down
11 changes: 9 additions & 2 deletions src/Stack/Options/PathParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ module Stack.Options.PathParser

import qualified Data.Text as T
import Options.Applicative ( Parser, flag, help, long )
import Stack.Path ( paths )
import Stack.Path
( pathsFromConfig, pathsFromEnvConfig, pathsFromRunner )
import Stack.Prelude

-- | Parse command line arguments for Stack's @path@ command.
pathParser :: Parser [Text]
pathParser = mapMaybeA
( \(desc, name, _) -> flag Nothing (Just name)
( \(desc, name) -> flag Nothing (Just name)
( long (T.unpack name)
<> help desc
)
)
paths
where
toDescName (desc, name, _) = (desc, name)
paths =
pathsFromRunner
: map toDescName pathsFromConfig
<> map toDescName pathsFromEnvConfig
Loading