Skip to content

Commit b8bfe50

Browse files
authored
Merge pull request #2909 from alexeyzab/2898-get-stack-apt-get-update
Mention apt-get update for Ubuntu
2 parents c7864f6 + 86cea37 commit b8bfe50

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

ChangeLog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@ Other enhancements:
2424
with new `--no-strip`, `--no-library-stripping`, and `--no-executable-shipping` flags,
2525
closing [#877](https://github.com/commercialhaskell/stack/issues/877).
2626
Also turned error message for missing targets more readable ([#2384](https://github.com/commercialhaskell/stack/issues/2384))
27-
* `stack haddock` now shows index.html paths when documentation is alread up to
27+
* `stack haddock` now shows index.html paths when documentation is already up to
2828
date. Resolved [#781](https://github.com/commercialhaskell/stack/issues/781)
2929
* Respects the `custom-setup` field introduced in Cabal 1.24. This
3030
supercedes any `explicit-setup-deps` settings in your `stack.yaml`
3131
and trusts the package's `.cabal` file to explicitly state all its
3232
dependencies.
33+
* If system package installation fails, `get-stack.sh` will fail as well. Also
34+
shows warning suggesting to run `apt-get update` or similar, depending on the
35+
OS.
36+
([#2898](https://github.com/commercialhaskell/stack/issues/2898))
3337

3438
Bug fixes:
3539

etc/scripts/get-stack.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ apt_install_dependencies() {
128128
do_ubuntu_install() {
129129

130130
install_dependencies() {
131-
apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg
131+
if ! apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg; then
132+
die "Dependencies could not be installed. Please run 'apt-get update' and try again."
133+
fi
132134
}
133135

134136
if is_arm ; then
@@ -154,7 +156,9 @@ do_ubuntu_install() {
154156
do_debian_install() {
155157

156158
install_dependencies() {
157-
apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev
159+
if ! apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev; then
160+
die "Dependencies could not be installed. Please run 'apt-get update' and try again."
161+
fi
158162
}
159163

160164
if is_arm ; then
@@ -178,7 +182,9 @@ do_debian_install() {
178182
# and install the necessary dependencies explicitly.
179183
do_fedora_install() {
180184
install_dependencies() {
181-
dnf_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar
185+
if ! dnf_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar; then
186+
die "Dependencies could not be installed. Please run 'dnf check-update' and try again."
187+
fi
182188
}
183189

184190
if is_64_bit ; then
@@ -198,7 +204,9 @@ do_fedora_install() {
198204
# and install the necessary dependencies explicitly.
199205
do_centos_install() {
200206
install_dependencies() {
201-
yum_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar
207+
if ! yum_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar; then
208+
die "Dependencies could not be installed. Please run 'yum check-update' and try again."
209+
fi
202210
}
203211

204212
if is_64_bit ; then
@@ -236,7 +244,9 @@ do_osx_install() {
236244
# 'pkg install' and then downloads bindist.
237245
do_freebsd_install() {
238246
install_dependencies() {
239-
sudocmd pkg install -y devel/gmake perl5 lang/gcc misc/compat8x misc/compat9x converters/libiconv ca_root_nss
247+
if ! sudocmd pkg install -y devel/gmake perl5 lang/gcc misc/compat8x misc/compat9x converters/libiconv ca_root_nss; then
248+
die "Dependencies could not be installed. Please run 'pkg update' and try again."
249+
fi
240250
}
241251
if is_64_bit ; then
242252
install_dependencies
@@ -249,7 +259,9 @@ do_freebsd_install() {
249259
# Alpine distro install
250260
do_alpine_install() {
251261
install_dependencies() {
252-
apk_install_pkgs gmp libgcc xz make
262+
if ! apk_install_pkgs gmp libgcc xz make; then
263+
die "Dependencies could not be installed. Please run 'apk update' and try again."
264+
fi
253265
}
254266
install_dependencies
255267
if is_64_bit ; then

0 commit comments

Comments
 (0)