Skip to content

Commit f25ad38

Browse files
committed
Further refine install and upgrade documentation
1 parent b752de5 commit f25ad38

File tree

2 files changed

+132
-92
lines changed

2 files changed

+132
-92
lines changed

doc/README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Stack features:
2121
## How to install Stack
2222

2323
Stack can be installed on most Unix-like operating systems (including macOS) and
24-
on Windows.
24+
Windows.
2525

2626
=== "Unix-like"
2727

@@ -62,10 +62,15 @@ on Windows.
6262
For other operating systems and direct downloads, see the
6363
[install and upgrade guide](install_and_upgrade.md).
6464

65+
!!! info
66+
67+
Stack can also be installed using the separate
68+
[GHCup](https://www.haskell.org/ghcup/) installer for Haskell-related tools.
69+
6570
## How to upgrade Stack
6671

67-
If you already have Stack installed, you can upgrade it to the latest version
68-
by the command:
72+
If Stack is already installed, you can upgrade it to the latest version by the
73+
command:
6974

7075
~~~text
7176
stack upgrade
@@ -151,14 +156,16 @@ The Haskell source code for the executable (application) is in file `Main.hs`.
151156

152157
The executable uses a library. Its source code is in file `Lib.hs`.
153158

154-
The contents of `my-project.cabal` describes the project. That file is generated
155-
by the contents of `package.yaml`.
159+
The contents of `my-project.cabal` describes the project's package. That file is
160+
generated by the contents of `package.yaml`.
156161

157162
!!! info
158163

159164
If you want, you can delete the `package.yaml` file and update the
160165
`my-project.cabal` file directly. Stack will then use that file.
161166

167+
The contents of `stack.yaml` describe Stack's own project-level configuration.
168+
162169
You can edit the source files in the `src` directory (used for the library) or
163170
the `app` directory (used for the executable (application)).
164171

doc/install_and_upgrade.md

Lines changed: 120 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,20 @@ GitHub repository.
5353

5454
=== "x86_64"
5555

56-
* Download the latest release:
56+
* Click
57+
[:material-cloud-download-outline:](https://get.haskellstack.org/stable/linux-x86_64.tar.gz)
58+
to download an archive file with the latest release.
5759

58-
* [Linux 64-bit (static)](https://get.haskellstack.org/stable/linux-x86_64.tar.gz)
60+
* Extract the archive and place the `stack` executable somewhere on your
61+
PATH (see the [Path](#path) section below).
5962

60-
* Extract the archive and place `stack` somewhere on your PATH (see the
61-
[Path](#path) section below).
62-
63-
* Ensure you have required system dependencies installed. These include GCC, GNU
64-
Make, xz, perl, libgmp, libffi, and zlib. We also recommend Git and GPG.
63+
* Ensure you have the required system dependencies installed. These
64+
include GCC, GNU Make, xz, perl, libgmp, libffi, and zlib. We also
65+
recommend Git and GPG.
6566

6667
The installation of system dependencies will depend on the package
67-
manager for your Linux distribution.
68+
manager for your Linux distribution. Notes are provided for Arch Linux,
69+
CentOS, Debian, Fedora, Gentoo and Ubuntu.
6870

6971
=== "Arch Linux"
7072

@@ -107,10 +109,18 @@ GitHub repository.
107109
including Arch Linux, Debian, Fedora, NixOS, openSUSE/SUSE Linux Enterprise,
108110
and Ubuntu.
109111

112+
!!! info "Linux packages that lag behind Stack's current version"
113+
114+
The Stack version available as a Linix package may lag behind Stack's
115+
current version. If so, using `stack upgrade --binary-only` is
116+
recommended after installing it. For Stack versions before 1.3.0 which
117+
do not support `--binary-only`, just `stack upgrade` may work too.
118+
110119
=== "Arch Linux"
111120

112-
The Arch community respository provides an official package. You can
113-
install it with the command:
121+
The Arch community package respository provides an official
122+
[package](ttps://www.archlinux.org/packages/community/x86_64/stack/).
123+
You can install it with the command:
114124

115125
~~~text
116126
sudo pacman -S stack
@@ -120,32 +130,28 @@ GitHub repository.
120130
the day. The package is also always rebuilt and updated when one of its
121131
dependencies gets an update.
122132

123-
- [stack](https://www.archlinux.org/packages/community/x86_64/stack/) _latest stable version_
124-
- [haskell-stack-git](https://aur.archlinux.org/packages/haskell-stack-git/) _git version_
133+
The Arch User Repository (AUR) also provides a
134+
[package](https://aur.archlinux.org/packages/haskell-stack-git).
135+
However, its Stack version lags behind, so running
136+
`stack upgrade --binary-only` is recommended after installing it. For
137+
older Stack versions which do not support `--binary-only`, just
138+
`stack upgrade` may work too.
125139

126-
In order to use `stack setup` with older versions of GHC or on a 32-bit
127-
system, you may need the
140+
To use `stack setup` with versions of GHC before 7.10.3 or on a
141+
32-bit system, you may need the AUR
128142
[ncurses5-compat-libs](https://aur.archlinux.org/packages/ncurses5-compat-libs/)
129-
AUR package installed. If this package is not installed, Stack may not be
130-
able to install older (< 7.10.3) or 32-bit GHC versions.
131-
132-
If you use the
133-
[ArchHaskell repository](https://wiki.archlinux.org/index.php/ArchHaskell),
134-
you can also get the `haskell-stack-tool` package from there.
143+
package installed.
135144

136145
=== "Debian"
137146

138147
There are Debian
139148
[packages](https://packages.debian.org/search?keywords=haskell-stack&searchon=names&suite=all&section=all)
140149
for Stretch and up. However, the distribution's Stack version lags
141-
behind, so running `stack upgrade --binary-only` is recommended after
142-
installing it. For older Stack versions which do not support
143-
`--binary-only`, just `stack upgrade` may work too.
150+
behind.
144151

145152
=== "Fedora"
146153

147-
Fedora includes builds of Stack, but the version may lag behind, so we
148-
recommend running `stack upgrade` after installing it.
154+
Fedora includes Stack, but its Stack version may lag behind.
149155

150156
=== "NixOS"
151157

@@ -184,53 +190,45 @@ GitHub repository.
184190
For more information on using Stack together with Nix, please see the
185191
[NixOS manual section on Stack](http://nixos.org/nixpkgs/manual/#how-to-build-a-haskell-project-using-stack).
186192

187-
=== "openSUSE/SUSE Linux Enterprise"
188-
189-
There is also an unofficial SUSE package. This Stack version may lag
190-
behind, so we recommend running `stack upgrade` after installing it.
191-
To install it:
192-
193-
1. Add the appropriate OBS repository:
193+
=== "SUSE"
194194

195-
* openSUSE Tumbleweed
195+
There is also an unofficial package for openSUSE or SUSE Linux
196+
Enterprise. Its Stack version may lag behind. To install it:
196197

197-
all needed is in distribution
198+
=== openSUSE Tumbleweed
198199

199-
* openSUSE Leap
200-
201-
~~~text
202-
sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/haskell/openSUSE_Leap_42.1/devel:languages:haskell.repo
203-
~~~
200+
~~~text
201+
sudo zypper in stack
202+
~~~
204203

205-
* SUSE Linux Enterprise 12
204+
=== openSUSE Leap
206205

207-
~~~text
208-
sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/haskell/SLE_12/devel:languages:haskell.repo
209-
~~~
206+
~~~text
207+
sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/haskell/openSUSE_Leap_42.1/devel:languages:haskell.repo
208+
sudo zypeer in stack
209+
~~~
210210

211-
2. Install:
211+
=== SUSE Linux Enterprise 12
212212

213213
~~~text
214-
sudo zypper in stack
214+
sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/haskell/SLE_12/devel:languages:haskell.repo
215+
sude zypper in stack
215216
~~~
216217

217218
=== "Ubuntu"
218219

219220
There are Ubuntu
220221
[packages](http://packages.ubuntu.com/search?keywords=haskell-stack&searchon=names&suite=all&section=all)
221222
for Ubuntu 18.04 and up. However, the distribution's Stack version lags
222-
behind, so we recommend running `stack upgrade --binary-only` after
223-
installing it. For older Stack versions which do not support
224-
`--binary-only`, just `stack upgrade` may work too.
223+
behind.
225224

226225
It is possible to set up auto-completion of Stack commands. For further
227226
information, see the [shell auto-completion](shell_autocompletion.md)
228227
documentation.
229228

230229
=== "macOS"
231230

232-
For most Linux distributions, the easiest way to install Stack is to
233-
command:
231+
The easiest way to install Stack is to command:
234232

235233
~~~text
236234
curl -sSL https://get.haskellstack.org/ | sh
@@ -250,15 +248,18 @@ GitHub repository.
250248
to `/usr/local/bin`. If you prefer more control, follow the manual
251249
installation instructions below.
252250

253-
We generally test on the current version of macOS and do our best to keep it
254-
compatible with the three most recent major versions. Stack may also work on
255-
older versions.
251+
!!! info
256252

257-
### Manual download
253+
We generally test on the current version of macOS and do our best to
254+
keep it compatible with the three most recent major versions. Stack may
255+
also work on older versions.
258256

259-
* Download the latest release:
257+
### Manual download
260258

261-
* [macOS 64-bit](https://get.haskellstack.org/stable/osx-x86_64.tar.gz)
259+
* Click
260+
[:material-cloud-download-outline:](https://get.haskellstack.org/stable/osx-x86_64.tar.gz)
261+
to download an archive file with the latest release for x86_64
262+
architectures.
262263

263264
* Extract the archive and place `stack` somewhere on your PATH (see the
264265
[Path](#path) section below).
@@ -310,11 +311,11 @@ GitHub repository.
310311
If you are on macOS 10.12 (Sierra) and encounter GHC panic while building, see
311312
this [issue](https://github.com/commercialhaskell/stack/issues/2577)
312313

313-
On Apple silicon chip (AArch64/ARM64) architectures, the installation of Stack
314-
or some packages (e.g. `network`) requiring C source compilation might fail with
315-
`configure: error: C compiler cannot build executables`. In that case you should
316-
pass `-arch arm64` as part of the `CFLAGS` environment variable. This setting
317-
will be picked up by the C compiler of your choice.
314+
On Apple silicon chip (AArch64/ARM64) architectures, the installation of
315+
Stack or some packages (e.g. `network`) requiring C source compilation might
316+
fail with `configure: error: C compiler cannot build executables`. In that
317+
case you should pass `-arch arm64` as part of the `CFLAGS` environment
318+
variable. This setting will be picked up by the C compiler of your choice.
318319

319320
~~~bash
320321
# Assuming BASH below
@@ -361,40 +362,58 @@ GitHub repository.
361362

362363
### Manual download
363364

364-
* Download the latest release:
365-
366-
* [64-bit Windows](https://get.haskellstack.org/stable/windows-x86_64.zip)
365+
* Click
366+
[:material-cloud-download-outline:](https://get.haskellstack.org/stable/windows-x86_64.zip)
367+
to download an archive file with the latest release.
367368

368369
* Unpack the archive and place `stack.exe` somewhere on your PATH (see the
369370
[Path](#path) section below).
370371

371372
* Now you can run Stack from the command line in a terminal.
372373

374+
!!! info
375+
376+
Stack can also be installed using the separate
377+
[GHCup](https://www.haskell.org/ghcup/) installer for Haskell-related tools.
378+
Unlike Stack, other build tools do not automatically install GHC. GHCup can
379+
be used to install GHC for those other tools and Stack can be configured to
380+
use the version of GHC that GHCup has installed.
381+
373382
## Path
374383

375384
You can install Stack by copying the executable file anywhere on your PATH. A
376385
good place to install is the same directory where Stack itself will install
377-
executables. On Unix-like operating systems, that directory is:
386+
executables, which depends on the operating system:
378387

379-
~~~text
380-
$HOME/.local/bin
381-
~~~
388+
=== "Unix-like"
382389

383-
On Windows, that directory is:
390+
Stack installs executables to:
384391

385-
~~~text
386-
%APPDATA%\local\bin
387-
~~~
392+
~~~text
393+
$HOME/.local/bin
394+
~~~
395+
396+
If you don't have that directory in your PATH, you may need to update your
397+
PATH. That can be done by editing the `~/.bashrc` file.
388398

389-
For example: `C:\Users\<user-name>\AppData\Roaming\local\bin`.
399+
=== "Windows"
400+
401+
Stack installs executables to:
402+
403+
~~~text
404+
%APPDATA%\local\bin
405+
~~~
406+
407+
For example: `C:\Users\<user-name>\AppData\Roaming\local\bin`.
408+
409+
If you don't have that directory in your PATH, you may need to update your
410+
PATH. That can be done by searching for 'Edit Environment variables for your
411+
account' under Start.
390412

391413
If you don't have that directory in your PATH, you may need to update your PATH.
392414
On Unix-like operating systems, that can be done by editing the `~/.bashrc`
393415
file.
394416

395-
If you're curious about the choice of these directories, see
396-
[issue #153](https://github.com/commercialhaskell/stack/issues/153)
397-
398417
## China-based users
399418

400419
If you're attempting to install Stack from within China:
@@ -437,19 +456,33 @@ package-indices:
437456

438457
To use Stack behind a HTTP proxy with IP address *IP* and port *PORT*, first set
439458
up an environment variable `http_proxy` and then run the Stack command. For
440-
example, on Unix-like operating systems:
459+
example:
441460

442-
~~~text
443-
export http_proxy=IP:PORT
444-
stack install
445-
~~~
461+
=== "Unix-like"
462+
463+
~~~text
464+
export http_proxy=IP:PORT
465+
stack install
466+
~~~
467+
468+
On most operating systems, it is not mandatory for programs to follow the
469+
"system-wide" HTTP proxy. Some programs, such as browsers, do honor this
470+
"system-wide" HTTP proxy setting, while other programs, including Bash, do
471+
not. That means configuring "http proxy setting" in your System Preferences
472+
(macOS) would not result in Stack traffic going through the proxy.
473+
474+
=== "Windows"
475+
476+
~~~text
477+
$Env:http_proxy=IP:PORT
478+
stack install
479+
~~~
446480

447-
On most operating systems, it is not mandatory for programs to follow the
448-
"system-wide" HTTP proxy. Some programs, such as browsers, do honor this
449-
"system-wide" HTTP proxy setting, while other programs, including bash, do not.
450-
That means configuring "http proxy setting" in your Control Panel (Windows) or
451-
System Preferences (Mac) would not result in Stack traffic going through the
452-
proxy.
481+
It is not mandatory for programs to follow the "system-wide" HTTP proxy.
482+
Some programs, such as browsers, do honor this "system-wide" HTTP proxy
483+
setting, while other programs do not. That means configuring
484+
"http proxy setting" in your Control Panel would not result in Stack traffic
485+
going through the proxy.
453486

454487
## Upgrade Stack
455488

0 commit comments

Comments
 (0)