Skip to content

Commit 9f5fac2

Browse files
committed
Merge branch 'stable'
2 parents 8471afd + 4d41854 commit 9f5fac2

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

doc/config_command.md

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ Available commands:
6161
The `stack config set` commands allow the values of keys in YAML configuration
6262
files to be set. See `stack config set` for the available keys.
6363

64+
!!! note
65+
66+
The `config set` commands support an existing key only in the form
67+
`key: value` on a single line.
68+
6469
## The `stack config set install-ghc` command
6570

6671
~~~text

doc/faq.md

+29
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,35 @@ Yes, Stack supports using Docker with images that contain preinstalled Stackage
338338
packages and the tools. See [Docker integration](docker_integration.md) for
339339
details.
340340

341+
## How do I build a statically-linked executable on Linux?
342+
343+
The way that Stack itself builds statically-linked Stack executables for Linux
344+
is as follows:
345+
346+
* In the Cabal file, the following
347+
[`ld-options`](https://cabal.readthedocs.io/en/stable/cabal-package.html#pkg-field-ld-options)
348+
are set: `-static` and `-pthread`.
349+
350+
* The Stack command is run in a Docker container based on Alpine Linux. The
351+
relevant Docker image repository is set out in Stack's `stack.yaml` file. See
352+
also Olivier Benz's [GHC musl project](https://gitlab.com/benz0li/ghc-musl).
353+
354+
* Stack's configuration includes:
355+
356+
~~~yaml
357+
extra-include-dirs:
358+
- /usr/include
359+
extra-lib-dirs:
360+
- /lib
361+
- /usr/lib
362+
~~~
363+
364+
* The build command is `stack build --docker --system-ghc --no-install-ghc` (on
365+
x86_64) or
366+
`stack build --docker --docker-stack-exe=image --system-ghc --no-install-ghc`
367+
(on AArch64; the host Stack and the image Stack must have the same version
368+
number).
369+
341370
## How do I use this with Travis CI?
342371

343372
See the [Travis CI instructions](travis_ci.md)

0 commit comments

Comments
 (0)