Skip to content

Commit 79a6ef0

Browse files
authored
Merge pull request #5740 from mpilgrem/msys2Docs
Update MSYS2-related documentation
2 parents f9a4515 + 54195d7 commit 79a6ef0

File tree

6 files changed

+82
-28
lines changed

6 files changed

+82
-28
lines changed

doc/GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ note on [issue #4252](https://github.com/commercialhaskell/stack/issues/4252).
1515
## Stack's functions
1616

1717
stack handles the management of your toolchain (including GHC — the Glasgow
18-
Haskell Compiler — and, for Windows users, MSYS), building and registering
18+
Haskell Compiler — and, for Windows users, MSYS2), building and registering
1919
libraries, building build tool dependencies, and more. While it can use existing
2020
tools on your system, stack has the capacity to be your one-stop shop for all
2121
Haskell tooling you need. This guide will follow that stack-centric approach.
@@ -1402,7 +1402,7 @@ is that it's the catch-all project whenever you're running stack somewhere else.
14021402
`stack path --stack-root` will tell you the location of the 'stack root'. This
14031403
is where stack stores snapshot packages, among other things. On operating
14041404
systems other than Windows, it is also where stack stores tools such as ghc and
1405-
msys by default, in a `programs` folder. (On Windows, the default location for
1405+
MSYS2 by default, in a `programs` folder. (On Windows, the default location for
14061406
such tools is `%LOCALAPPDATA%\Programs\stack`.)
14071407
14081408
The location of the stack root can be configured by setting the `STACK_ROOT`

doc/developing_on_windows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Developing on windows #
44

55
On Windows, Stack comes with an installation of
6-
[msys2](https://www.msys2.org/). Msys2 will be used by Stack to
6+
[MSYS2](https://www.msys2.org/). MSYS2 will be used by Stack to
77
provide a unix-like shell for Stack. This may be necessary for installing some Haskell packages, such as those which use `configure` scripts.
88
No
99
matter which terminal you choose (cmd.exe, powershell, git bash or any
@@ -38,7 +38,7 @@ additional entries via a pull request.
3838
Cmake has trouble finding other tools even if they are available on
3939
the `PATH`. Likely this is not a cmake problem but one of the
4040
environment not fully integrating. For example GHC comes with a copy
41-
of GCC which is not installed by msys itself. If you want to use this
41+
of GCC which is not installed by MSYS2 itself. If you want to use this
4242
GCC you can provide a full path to it, or find it first with
4343
`System.Directory.findExecutable` if you want to launch GCC from a
4444
Haskell file such as `Setup.hs`.

doc/maintainers/msys.md

Lines changed: 70 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,82 @@
11
<div class="hidden-warning"><a href="https://docs.haskellstack.org/"><img src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack/doc/img/hidden-warning.svg"></a></div>
22

3-
# Upgrading msys
3+
# Upgrading MSYS2
44

55
When installing GHC on Windows, Stack will also install
6-
[msys2](http://www.msys2.org/) to provide a Unix shell and environment,
7-
necessary for such things as running configure scripts. This section explains
8-
the steps required to upgrade the msys2 version used by Stack.
6+
[MSYS2](http://www.msys2.org/). MSYS2 provides a Unix shell and environment, and
7+
is necessary for such things as running configure scripts. This section explains
8+
the steps required to upgrade the MSYS2 version used by Stack.
99

10-
1. Download latest installers from msys2's website. These installers are
11-
executables, versioned by date (YYYYMMDD), and are separate for `x86_64`
12-
and `i686`. You'll usually be upgrading both at the same time, which we'll
13-
assume here.
10+
1. Download latest installer(s) from MSYS2's website. Historically, there were
11+
separate installers for 32 bit (`i686`) and 64 bit (`x86_64`). On
12+
17 May 2020, the MSYS2 project announced it did not plan to release any
13+
further `i686` installers. An installer is an executable, versioned by a
14+
date in the format YYYYMMDD - for example, `msys2-x86_64-20220503.exe`.
1415

15-
2. Run the installer and install to the default location (`c:\msys64` and
16-
`c:\msys32`, respectively).
16+
2. Run the installer and install to the default location (`C:\msys64` for the
17+
64 bit version; the location for the 32 bit version was `C:\msys32`). Do not
18+
use the installed version; it will create a `.bash_history` file if you do.
1719

18-
3. Create tarballs for each directory:
20+
3. Create a tarball for each relevant directory (eg `C:\msys64`). That requires
21+
a version of [`tar`](https://www.gnu.org/software/tar/tar.html) that
22+
supports the compression option `--xz`. The version of `tar` that is
23+
supplied with Windows (`C:\Windows\System32\tar.exe`) does not support that
24+
option, but MSYS2 can supply a [version](https://packages.msys2.org/package/tar)
25+
that does (using its `pacman` tool). Using the existing Stack-supplied
26+
MSYS2, in PowerShell and located in a folder with write permissions (so the `.tar.xz` file can be created):
1927

2028
```
21-
$ cd /c/
22-
$ tar cJf msys2-YYYYMMDD-x86_64.tar.xz msys64
23-
$ tar cJf msys2-YYYYMMDD-i686.tar.xz msys32
29+
> stack exec -- pacman -S tar
30+
> stack exec -- tar cJf msys2-YYYYMMDD-x86_64.tar.xz C:\msys64
2431
```
2532
26-
4. Create a new release named `msys2-YYYYMMDD` on the
27-
[fpco/stackage-content](https://github.com/fpco/stackage-content)
28-
repo, and upload these two files.
33+
4. Create a new release tagged and named `msys2-YYYYMMDD` in the `master`
34+
branch of the [commercialhaskell/stackage-content](https://github.com/commericalhaskell/stackage-content)
35+
GitHub repository, uploading the tarball file(s) into that release.
2936
30-
5. Create a PR for the [stack-setup-2.yaml file](https://github.com/fpco/stackage-content/blob/master/stack/stack-setup-2.yaml)
31-
to switch over to using the newly uploaded files. You should test this file locally first.
37+
5. Changes need to be made to the [stackage-content/stack/stack-setup-2.yaml](https://github.com/commercialhaskell/stackage-content/blob/master/stack/stack-setup-2.yaml)
38+
file, to switch over to using the newly uploaded files. For example
39+
(extract):
40+
41+
~~~yaml
42+
# For upgrade instructions, see: https://github.com/commercialhaskell/stack/blob/stable/doc/maintainers/msys.md
43+
msys2:
44+
windows32:
45+
version: "20200517"
46+
url: "https://github.com/fpco/stackage-content/releases/download/20200517/msys2-20200517-i686.tar.xz"
47+
content-length: 79049224
48+
sha256: 9152ddf50c6bacfae33c1436338235f8db4b10d73aaea63adefd96731fb0bceb
49+
windows64:
50+
version: "20220503"
51+
url: "https://github.com/commercialhaskell/stackage-content/releases/download/msys2-20220503/msys2-20220503-x86_64.tar.xz"
52+
content-length: 93835868
53+
sha256: c918f66e984f70add313ee3a5c5b101132cd93d5a3f8e3555e129e2d3dcb3718
54+
~~~
55+
56+
The `content-length:` key's value is the size of the file in bytes. It can
57+
be obtained from the `Length` field of the `dir` command. The `sha256:`
58+
key's value can be obtained from the command (in PowerShell):
59+
60+
~~~
61+
❯ (Get-FileHash msys2-YYYYMMDD-x86_64.tar.xz -Algorithm SHA256).Hash.ToLower()
62+
~~~
63+
64+
The `sha256:` key only accepts lowercase hash results as values.
65+
66+
6. The changed `stack-setup-2.yaml` file should be tested locally. This can be
67+
done by:
68+
69+
* temporarily disabling the existing local copy of MSYS2 by changing the
70+
name of the `msys2-YYYYMMDD.installed` file in the `stack path --programs` directory; and
71+
72+
* executing the command:
73+
74+
~~~
75+
> stack setup --setup-info-yaml <path to local copy of stack-setup-2.yaml>
76+
~~~
77+
78+
If all is well, the command should proceed to download the updated version
79+
of MSYS2 that has been specified.
80+
81+
7. Raise a pull request on `commercialhaskell/stackage-contents` for the
82+
changes to the locally-tested `stack-setup-2.yaml` file.

doc/maintainers/releases.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ Now continue to the **General Windows setup** subsection below.
339339
340340
15. Run `C:\p\env.bat` (do this every time you open a new command prompt)
341341
342-
16. `stack exec -- gpg --import`, and paste in the your GPG secret key (must be done using `stack exec` because that uses the right keyring for the embedded msys GPG; you can get the key from another machine with `gpg --export-secret-keys --armor <KEY ID>`)
342+
16. `stack exec -- gpg --import`, and paste in the your GPG secret key (must be
343+
done using `stack exec` because that uses the right keyring for the embedded
344+
MSYS2 GPG; you can get the key from another machine with
345+
`gpg --export-secret-keys --armor <KEY ID>`)
343346
344347
17. Run in command prompt (adjust the `user.email` and `user.name` settings):
345348

doc/yaml_configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ ghc:
718718

719719
(Since 0.1.5)
720720

721-
Allows augmenting from where tools like GHC and msys2 (on Windows) are
721+
Allows augmenting from where tools like GHC and MSYS2 (on Windows) are
722722
downloaded. Most useful for specifying locations of custom GHC binary
723723
distributions (for use with the [ghc-variant](#ghc-variant) option).
724724

@@ -1013,7 +1013,7 @@ Since 0.1.10.0
10131013

10141014
### skip-msys
10151015

1016-
Skips checking for and installing msys2 when stack is setting up the
1016+
Skips checking for and installing MSYS2 when stack is setting up the
10171017
environment. This is only useful on Windows machines, and usually doesn't make
10181018
sense in project configurations, just in `config.yaml`. Defaults to `false`, so
10191019
if this is used, it only really makes sense to use it like this:
@@ -1061,7 +1061,7 @@ Since 0.1.4.0
10611061
### local-programs-path
10621062

10631063
This overrides the location of the programs directory, where tools like ghc and
1064-
msys get installed.
1064+
MSYS2 get installed.
10651065

10661066
On most systems, this defaults to a folder called `programs`
10671067
within the stack root directory. On Windows, if the `LOCALAPPDATA` environment

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pages:
4444
- Maintainer team process: maintainers/team_process.md
4545
- Add GHC version: maintainers/ghc.md
4646
- Docker images: maintainers/docker.md
47-
- Upgrading msys: maintainers/msys.md
47+
- Upgrading MSYS2: maintainers/msys.md
4848
- Signing key: SIGNING_KEY.md
4949

5050
markdown_extensions:

0 commit comments

Comments
 (0)