Skip to content

Fix #6773 Add -w as synonym for --stack-yaml #6790

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Other enhancements:
* From GHC 9.12.1, `base` is not a GHC wired-in package. In configuration files,
the `notify-if-base-not-boot` key is introduced, to allow the exisitng
notification to be muted if unwanted when using such GHC versions.
* Add option `-w` as synonym for `--stack-yaml`.

Bug fixes:

Expand Down
8 changes: 4 additions & 4 deletions doc/build_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Given these inputs, Stack attempts the following process when performing a build

## Find the `stack.yaml` file

* Check for a `--stack-yaml` CLI arg, and use that
* Check for a `STACK_YAML` env var
* Check for a `--stack-yaml` or `-w` command line argument, and use that
* Check for a `STACK_YAML` environment variable
* Look for a `stack.yaml` in this directory or ancestor directories
* Fall back to the default global project

Expand Down Expand Up @@ -199,7 +199,7 @@ they get prepended otherwise they get used as is.
Use some deterministic binary serialization and SHA256 thereof to get
a hash of the following information:

* Actual compiler (GHC version, path, *FIXME* probably some other unique info
* Actual compiler (GHC version, path, *FIXME* probably some other unique info
from GHC, I have heard that `ghc --info` gives you something)
* Global database map
* Immutable dependency map
Expand Down Expand Up @@ -233,7 +233,7 @@ installed in this database will never need to be rebuilt.
all enabled components (using the fun backwards compat logic for
`build-tools`)
* Apply the logic recursively to come up with a full build plan
* If a task depends exclusively on immutable packages, mark it as immutable.
* If a task depends exclusively on immutable packages, mark it as immutable.
Otherwise, it is mutable. The former go into the snapshot database, the latter
into the local database.

Expand Down
2 changes: 1 addition & 1 deletion doc/configure/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Related command: all commands that make use of Stack's
[project-level configuration](yaml/index.md).

Overridden by: Stack's global
[`--stack-yaml`](global_flags.md#-stack-yaml-option) option.
[`--stack-yaml`](global_flags.md#-stack-yaml-or-w-option) option.

The environment variable `STACK_YAML` can be used to specify Stack's
project-level configuration file.
2 changes: 1 addition & 1 deletion doc/configure/global_flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Pass the option `--stack-root <absolute_path_to_the_Stack_root>` to specify the
path to the [Stack root](../topics/stack_root.md) directory. The path must be an
absolute one.

## `--stack-yaml` option
## `--stack-yaml` or `-w` option

Default: `stack.yaml`

Expand Down
2 changes: 1 addition & 1 deletion doc/configure/yaml/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Stack's configuration files are each of one of two types:
Stack obtains project-level configuration from one of the following (in order of
preference):

1. A file specified by the `--stack-yaml` command line option.
1. A file specified by the `--stack-yaml` or `-w` command line option.
2. A file specified by the `STACK_YAML` environment variable.
3. A file named `stack.yaml` in the current directory or an ancestor directory.
4. A file name `stack.yaml` in the `global-project` directory in the
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/stack_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Whenever you run something with Stack, it needs a project-level configuration
file. The algorithm Stack uses to find such a file is:

1. Check for a `--stack-yaml` option on the command line
1. Check for a `--stack-yaml` or `-w` option on the command line
2. Check for a `STACK_YAML` environment variable
3. Check the current directory and all ancestor directories for a `stack.yaml`
file
Expand All @@ -30,7 +30,7 @@ for you with the latest LTS snapshot. This allows you to do things like:
Keep in mind that there is nothing magical about this implicit global
configuration. It has no effect on projects at all. Every package you install
with it is put into isolated databases just like everywhere else. The only magic
is that it is the catch-all project whenever you are running Stack somewhere
is that it is the catch-all project whenever you are running Stack somewhere
else.

## Package description vs project-level configuration
Expand Down
3 changes: 2 additions & 1 deletion src/Stack/Options/GlobalParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Stack.Options.GlobalParser

import Options.Applicative
( Mod, Parser, ReadM, auto, completer, help, hidden, internal
, long, metavar, option, strOption, value
, long, metavar, option, short, strOption, value
)
import Options.Applicative.Builder.Extra
( fileExtCompleter, firstBoolFlagsFalse
Expand Down Expand Up @@ -102,6 +102,7 @@ globalOptsParser currentDir kind = GlobalOptsMonoid
))
<*> optionalFirst (strOption
( long "stack-yaml"
<> short 'w'
<> metavar "STACK-YAML"
<> completer (fileExtCompleter [".yaml"])
<> help "Override project stack.yaml file (overrides any STACK_YAML \
Expand Down
Loading