Skip to content

Commit c1bbd1d

Browse files
feat(binstall): error on missing glibc
1 parent 72fcc33 commit c1bbd1d

File tree

5 files changed

+30
-160
lines changed

5 files changed

+30
-160
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7979
[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
8080
[pull/472]: https://github.com/apollographql/rover/pull/472
8181

82+
- **Curl installer returns error message on Linux if glibc is missing - [EverlastingBugstopper], [issue/393] [pull/494]**
83+
84+
Rover is currently built for the `unknown-linux-gnu` rustc target, which requires `glibc` >= 2.7 to be installed.
85+
Previously, if you attempted to install Rover on a machine without `glibc`, you would get quite cryptic linker
86+
errors. Now, users attempting to install Rover without the proper `glibc` install will get an error message
87+
informing them.
88+
89+
[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
90+
[pull/494]: https://github.com/apollographql/rover/pull/494
91+
[issue/393]: https://github.com/apollographql/rover/issues/393
92+
8293
## 🐛 Fixes
8394

8495
- **Adds a newline to all output to stdout - [EverlastingBugstopper], [issue/458] [pull/462]**

installers/binstall/scripts/nix/install.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ download_binary_and_run_installer() {
5151
*windows*)
5252
_ext=".exe"
5353
;;
54+
*linux*)
55+
need_glibc
56+
;;
5457
esac
5558

5659
local _tardir="rover-$DOWNLOAD_VERSION-${_arch}"
@@ -104,7 +107,7 @@ get_architecture() {
104107

105108
if [ "$_ostype" = Darwin -a "$_cputype" = arm64 ]; then
106109
# Darwin `uname -s` doesn't seem to lie on Big Sur
107-
# but we want to serve x86_64 binaries anyway that they can
110+
# but we want to serve x86_64 binaries anyway so that they can
108111
# then run in x86_64 emulation mode on their arm64 devices
109112
local _cputype=x86_64
110113
fi
@@ -154,6 +157,12 @@ err() {
154157
exit 1
155158
}
156159

160+
need_glibc() {
161+
if ! check_cmd "/lib/x86_64-linux-gnu/libc.so.6"
162+
then err "could not link against 'glibc'. Do you have glibc >= 2.7 installed?"
163+
fi
164+
}
165+
157166
need_cmd() {
158167
if ! check_cmd "$1"
159168
then err "need '$1' (command not found)"

installers/binstall/scripts/nix/local-install.sh

-150
This file was deleted.

installers/binstall/scripts/windows/install.ps1

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Licensed under the MIT license
2+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
3+
# option. This file may not be copied, modified, or distributed
4+
# except according to those terms.
5+
6+
# This is just a little script that can be downloaded from the internet to
7+
# install rover. It just downloads the installer and runs it.
8+
19
# version found in Rover's Cargo.toml
210
# Note: this line is built automatically
311
# in build.rs. Don't touch it!
@@ -65,14 +73,8 @@ function Initialize-Environment() {
6573
break
6674
}
6775

68-
If (-Not (Get-Command 'curl')) {
69-
Write-Error "The curl command is not installed on this machine. Please install curl before installing Rover"
70-
# don't abort if invoked with iex that would close the PS session
71-
If ($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
72-
}
73-
7476
If (-Not (Get-Command 'tar')) {
75-
Write-Error "The tar command is not installed on this machine. Please install curl before installing Rover"
77+
Write-Error "The tar command is not installed on this machine. Please install tar before installing Rover"
7678
# don't abort if invoked with iex that would close the PS session
7779
If ($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
7880
}

installers/binstall/scripts/windows/local-install.ps1

-2
This file was deleted.

0 commit comments

Comments
 (0)