Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Homebrew Portable Ruby messaging #7476

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions Library/Homebrew/cmd/vendor-install.sh
Expand Up @@ -144,7 +144,7 @@ EOS
EOSCRIPT
)"
else
odie "Cannot verify the checksum ('shasum' or 'sha256sum' not found)!"
odie "Cannot verify checksum ('shasum' or 'sha256sum' not found)!"
fi

if [[ "$sha" != "$VENDOR_SHA" ]]
Expand Down Expand Up @@ -197,7 +197,7 @@ install() {
then
mv "$VENDOR_VERSION.reinstall" "$VENDOR_VERSION"
fi
odie "Failed to vendor $VENDOR_NAME $VENDOR_VERSION."
odie "Failed to install $VENDOR_NAME $VENDOR_VERSION!"
fi

trap - SIGINT
Expand All @@ -222,13 +222,13 @@ homebrew-vendor-install() {
[[ "$option" = *d* ]] && HOMEBREW_DEBUG=1
;;
*)
[[ -n "$VENDOR_NAME" ]] && odie "This command does not take multiple vendor targets"
[[ -n "$VENDOR_NAME" ]] && odie "This command does not take multiple vendor targets!"
VENDOR_NAME="$option"
;;
esac
done

[[ -z "$VENDOR_NAME" ]] && odie "This command requires one vendor target."
[[ -z "$VENDOR_NAME" ]] && odie "This command requires a vendor target!"
[[ -n "$HOMEBREW_DEBUG" ]] && set -x

url_var="${VENDOR_NAME}_URL"
Expand All @@ -237,16 +237,13 @@ homebrew-vendor-install() {
VENDOR_URL="${!url_var}"
VENDOR_URL2="${!url2_var}"
VENDOR_SHA="${!sha_var}"
VENDOR_VERSION="$(<"$VENDOR_DIR/portable-$VENDOR_NAME-version")"

if [[ -z "$VENDOR_URL" || -z "$VENDOR_SHA" ]]
then
odie <<-EOS
Cannot find a vendored version of $VENDOR_NAME for your $HOMEBREW_PROCESSOR
processor on $HOMEBREW_PRODUCT!
EOS
odie "No Homebrew $VENDOR_NAME $VENDOR_VERSION available for $HOMEBREW_PROCESSOR processors!"
fi

VENDOR_VERSION="$(<"$VENDOR_DIR/portable-$VENDOR_NAME-version")"
CACHED_LOCATION="$HOMEBREW_CACHE/$(basename "$VENDOR_URL")"

lock "vendor-install-$VENDOR_NAME"
Expand Down
26 changes: 24 additions & 2 deletions Library/Homebrew/utils/ruby.sh
Expand Up @@ -26,7 +26,18 @@ setup-ruby-path() {
then
if ! brew vendor-install ruby
then
onoe "Failed to upgrade vendor Ruby."
if [[ -n "$HOMEBREW_MACOS" ]]
then
odie "Failed to upgrade Homebrew Portable Ruby!"
else
odie <<-EOS
Failed to upgrade Homebrew Portable Ruby!
If there's no Homebrew Portable Ruby available for your processor:
- install Ruby $required_ruby_version with your system package manager (or rbenv/ruby-build)
- make it first in your PATH
- try again
EOS
fi
fi
fi
else
Expand All @@ -50,7 +61,18 @@ setup-ruby-path() {
brew vendor-install ruby
if [[ ! -x "$vendor_ruby_path" ]]
then
odie "Failed to install vendor Ruby."
if [[ -n "$HOMEBREW_MACOS" ]]
then
odie "Failed to install Homebrew Portable Ruby (and your system version is too old)!"
else
odie <<-EOS
Failed to install Homebrew Portable Ruby and cannot find another Ruby $required_ruby_version!
If there's no Homebrew Portable Ruby available for your processor:
- install $required_ruby_version with your system package manager (or rbenv/ruby-build)
- make it first in your PATH
- try again
EOS
fi
fi
HOMEBREW_RUBY_PATH="$vendor_ruby_path"
fi
Expand Down
2 changes: 2 additions & 0 deletions docs/Homebrew-on-Linux.md
Expand Up @@ -68,6 +68,8 @@ sudo yum install libxcrypt-compat # needed by Fedora 30 and up

Homebrew can run on 32-bit ARM (Raspberry Pi and others) and 64-bit ARM (AArch64), but no binary packages (bottles) are available. Support for ARM is on a best-effort basis. Pull requests are welcome to improve the experience on ARM platforms.

You may need to install your own Ruby using your system package manager, a PPA, or `rbenv/ruby-build` as in the future we will no longer distribute a Homebrew Portable Ruby for ARM.

### 32-bit x86

Homebrew does not currently support 32-bit x86 platforms. It would be possible for Homebrew to work on 32-bit x86 platforms with some effort. An interested and dedicated person could maintain a fork of Homebrew to develop support for 32-bit x86.
Expand Down