Skip to content

Commit fc2ffeb

Browse files
committed
Tidy-up documentation of script to customise GHC installation
1 parent 54f45b5 commit fc2ffeb

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

ChangeLog.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Changelog
22

3-
43
## Unreleased changes
54

65
Release notes:
@@ -32,6 +31,8 @@ Other enhancements:
3231
* Fuller help is provided at the command line if a subcommand is missing (for
3332
example, `stack ls` now yields the equivalent of `stack ls --help`). See
3433
[#809](https://github.com/commercialhaskell/stack/issues/809)
34+
* Add the possibility of a `sh` script to customise fully GHC installation. See
35+
[#5585](https://github.com/commercialhaskell/stack/pull/5585)
3536

3637
Bug fixes:
3738

@@ -59,8 +60,6 @@ Other enhancements:
5960
* `stack upload` supports authentication with a Hackage API key (via
6061
`HACKAGE_KEY` environment variable).
6162

62-
* Add GHC installation hooks wrt [#5585](https://github.com/commercialhaskell/stack/pull/5585)
63-
6463
Bug fixes:
6564

6665
* Ensure that `extra-path` works for case-insensitive `PATH`s on Windows.

doc/yaml_configuration.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,27 +1197,29 @@ has the following effect:
11971197

11981198
This field is convenient in setups that restrict access to GitHub, for instance closed corporate setups. In this setting, it is common for the development environment to have general access to the internet, but not for testing/building environments. To avoid the firewall, one can run a local snapshots mirror and then use a custom `snapshot-location-base` in the closed environments only.
11991199

1200-
12011200
Since 2.5.0
12021201

1203-
## Hooks
1202+
## Customisation
12041203

1205-
### GHC installation hooks (experimental)
1204+
### GHC installation customisation (experimental)
12061205

1207-
Stack's installation procedure can be fully customized by placing a shell script at
1208-
`~/.stack/hooks/ghc-install.sh` and making it executable.
1206+
On Unix-like operating systems and Windows, Stack's installation procedure can
1207+
be fully customised by placing a `sh` shell script (a 'hook') in the Stack root
1208+
directory at `hooks/ghc-install.sh`. On Unix-like operating systems, the script
1209+
file must be made executable. The script is run by the `sh` application (which
1210+
is provided by MSYS2 on Windows).
12091211

1210-
The script **must** return an exit code of `0` and the standard output **must** be the
1211-
absolute path to the ghc binary that was installed. Otherwise stack will ignore
1212-
the hook and possibly fall back to its own installation procedure.
1212+
The script **must** return an exit code of `0` and the standard output **must**
1213+
be the absolute path to the GHC binary that was installed. Otherwise Stack will
1214+
ignore the script and possibly fall back to its own installation procedure.
12131215

1214-
Hooks are not run when `system-ghc: true`.
1216+
The script is not run when `system-ghc: true`.
12151217

1216-
When `install-ghc: false`, hooks are still run,
1217-
which allows you to ensure that only your hook will install GHC and stack won't default
1218-
to its own installation logic, even when the hook fails.
1218+
When `install-ghc: false`, the script is still run, which allows you to ensure
1219+
that only your script will install GHC and Stack won't default to its own
1220+
installation logic, even when the script fails.
12191221

1220-
An example hook is:
1222+
An example script is:
12211223

12221224
```sh
12231225
#!/bin/sh
@@ -1242,7 +1244,7 @@ esac
12421244
echo "location/to/ghc/executable"
12431245
```
12441246

1245-
The following environment variables are always passed to the hook:
1247+
The following environment variables are always available to the script:
12461248

12471249
* `HOOK_GHC_TYPE = "bindist" | "git" | "ghcjs"`
12481250

@@ -1260,4 +1262,4 @@ For "ghcjs", additional variables are:
12601262
* `HOOK_GHC_VERSION = <ver>`
12611263
* `HOOK_GHCJS_VERSION = <ver>`
12621264

1263-
Since 2.8.X
1265+
Since 2.7.X

0 commit comments

Comments
 (0)