103 Commits

Author SHA1 Message Date
Bo Anderson
57ed94c421
cmd/vendor-install: fix exit code handling for curl 2025-06-09 19:59:41 +01:00
Eric Knibbe
51be1d9652
revert setting --insecure to download ca-certificates 2024-11-24 14:57:32 -05:00
Bo Anderson
99ce3094e9
Invalidate Bootsnap cache on Gemfile.lock changes 2024-09-04 04:05:10 +01:00
Mike McQuaid
e3a1a9dccf
Improve locking UX
My experience recently playing around with our locking behaviour is
that, while mostly seamless and not seen by users, it's leaks
implementation details a bit too heavily.

As a result, the following improvements are in this commit:
- Ensure that, whenever possible, we tell the user the actual command
  that is holding a given lock instead of the lock name (an internal
  implementation detail)
- Make the locking error output a little more consistent and user
  friendly
- Add a `DownloadLock` class to simplify locking downloads
- Add a `HOMEBREW_LOCK_CONTEXT` variable to allow adding additional
  context for logging error messages
- Lock paths and leave deciding how this translates to lock names up
  to the locking code itself
- Lock the Cellar/Caskroom paths explicitly rather than implicitly

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-07-30 17:51:02 +01:00
Mike McQuaid
5987c5c1d0
Add stub Ruby commands for all Bash commands.
This gets us pretty similar (but easier to manage) manpage output but
much nicer completions etc. for all these commands.
2024-07-14 23:12:53 -04:00
Mike McQuaid
6abdbd1fe0
vendor-install: cleanup bootsnap. 2024-07-13 11:57:37 -04:00
Mike McQuaid
1124ab315c
cmd/vendor-install: add extra read check.
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-06-25 08:53:46 +01:00
Caleb Xu
c214952e2b
cmd/vendor-install: extract portable-ruby download info 2024-06-24 13:15:54 -04:00
Mike McQuaid
b38e14bce7
Further Portable Ruby cleanup
- Use the `HOMEBREW_PORTABLE_RUBY_VERSION` environment variable to
  determine the version of the Portable Ruby to use in
  `vendor-install.sh` and `ruby.sh`.
- Replace the `docs/.ruby-version` file with a symlink to
 `Library/Homebrew/.ruby-version`.
- Fix an incorrect `HOMEBREW_LIBRARY` comment.
- Use a simpler `HOMEBREW_USING_PORTABLE_RUBY` definition.
2024-06-14 12:22:02 +01:00
Mike McQuaid
4bfdbe20b9
vendor-install: fix incorrect portable Ruby version reference. 2024-06-14 12:05:01 +01:00
Bo Anderson
fa91edadfd
Portable Ruby 3.3.3 2024-06-14 03:32:38 +01:00
Mike McQuaid
2c1bf79c67
cmd/vendor-install: handle broken shasum.
If `shasum` is broken and doesn't produce a valid checksum: we were
just doing the checksum comparison with an empty checksum.

Instead, let's treat an empty checksum as a failure condition, rather
than just the executable bit being present for the relevant binary, and
iterate through the available tools to try and get a non-empty checksum.

If they all produce an empty checksum: provide a different error to make
it a bit more obvious what's happening here.
2024-06-04 13:49:32 +01:00
Mike McQuaid
b70b501b17
Portable Ruby 3.3.2
Update to the latest Ruby.
2024-05-31 15:38:04 +01:00
Mike McQuaid
bde9afa70e
Portable Ruby 3.3.1
Use the latest version of Portable Ruby.
2024-05-17 00:23:36 +01:00
Mike McQuaid
a37864da0f
Add HOMEBREW_ARTIFACT_DOMAIN_NO_FALLBACK
This fits the use-case I've heard multiple times where people want to
rely exclusively on their artifact provider.

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-05-14 21:45:37 +09:00
Kevin
5a297a7dd5
Merge pull request #16499 from p-linnane/vendor-install-wording
cmd/vendor-install: adjust wording
2024-01-18 21:49:49 -08:00
Patrick Linnane
532fdc0f73
cmd/vendor-install: adjust wording
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-01-18 09:41:19 -08:00
Mike McQuaid
fd9775d512
cmd/vendor-install: fix some elses.
The logic in #16495 wasn't quite right.
2024-01-18 17:35:47 +00:00
Mike McQuaid
ebfa93c949
cmd/vendor-install: undocumented option to allow setting processor.
This can be useful when testing fetch on a different processor than the
one the user is running on.

While we're here, refactor code run on `source` to need a function call
instead.
2024-01-18 14:38:56 +00:00
Bo Anderson
7ba5480dff
cmd/vendor-install: don't silence stderr 2023-12-08 00:10:56 +00:00
Bo Anderson
489879ff72
Enable Ruby 3 for all users 2023-11-29 15:30:17 +00:00
Bo Anderson
4ec450823c
Portable Ruby 3.1.4 (opt-in beta) 2023-10-27 15:58:43 +01:00
Clint Harrison
e75a72dcb5 Use HOMEBREW_CURLRC in vendor-install 2023-08-22 17:21:37 -04:00
Bo Anderson
1b0bd8a6a9
Portable Ruby 2.6.10_1
Release notes: https://github.com/Homebrew/homebrew-portable-ruby/releases/tag/2.6.10_1
2023-04-11 18:10:37 +01:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Bo Anderson
01a93edac3
Portable Ruby 2.6.8_1 2022-06-03 18:00:16 +01:00
Mike McQuaid
04938efc24
Unify GitHub Packages authorization logic in brew.sh. 2022-01-27 15:44:34 +00:00
Thomas Vaillant
ad65d47bee
fix: take $HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN into account when installing portable ruby 2022-01-27 09:37:20 +00:00
Thomas Vaillant
0266d77b0f fix: take $HOMEBREW_DOCKER_REGISTRY_TOKEN into account when installing portable Ruby 2021-12-16 18:50:58 +01:00
Carlo Cabrera
49de2b0c1a
Check arch instead of the brand string 2021-11-11 17:30:02 +08:00
Carlo Cabrera
98b33e6732
Remove another redundant conditional
This condition is always true when we've reached this branch.
2021-11-11 16:28:15 +08:00
Carlo Cabrera
fd1ca7e2b7
Remove redundant conditionals
Whenever the `sysctl` call does not match `"Apple"*`, we can be sure
that `HOMEBREW_PROCESSOR` is `Intel`, so there's no need for this
additional check.
2021-11-11 16:24:59 +08:00
Carlo Cabrera
51ab1649fb
Install Portable Ruby on native ARM installs
The previous commit only prevented the installation of an Intel Portable
Ruby into `/opt/homebrew` prefix. Let's actually install an ARM64
Portable Ruby there too.
2021-11-11 16:21:35 +08:00
Carlo Cabrera
8aeb28781c
vendor-install: handle native ARM running under Rosetta
Since `HOMEBREW_PROCESSOR` is populated using `uname -m`, this will
register as `Intel` even when a native ARM install is running under
Rosetta.

Let's work around this by checking `sysctl -n machdep.cpu.brand_string`.
On my Intel machine:

    ❯ sysctl -n machdep.cpu.brand_string
    Intel(R) Core(TM) i3-1000NG4 CPU @ 1.10GHz

On Apple Silicon:

    brew@HMBRW-A-001-M1-001 ~ % sysctl -n machdep.cpu.brand_string
    Apple M1

The case of a Rosetta installation of Homebrew is already handled below
the proposed change.

Fixes Homebrew/discussions#2434.
2021-11-11 16:06:33 +08:00
Bo Anderson
188265544b
cmd/vendor-install: add arm64 macOS portable-ruby build 2021-11-08 19:20:40 +00:00
Mike McQuaid
342f8e1e71
vendor-install: better handle /usr/local arm64 ruby.
Fixes https://github.com/Homebrew/brew/issues/12351
2021-11-05 12:35:46 +00:00
Bo Anderson
cd808983bc
Portable Ruby 2.6.8 2021-10-21 02:24:50 +01:00
XuehaiPan
43377a3e5e style: fix inconsistent code style for shell scripts by runing brew style --fix 2021-09-16 01:08:02 +08:00
XuehaiPan
3f96d963f7 style: fix inconsistent code style for shell scripts 2021-09-15 14:59:01 +08:00
XuehaiPan
b5bc6368b7 cmd/vendor-install.sh: update artifact URL 2021-09-12 23:38:33 +08:00
XuehaiPan
7da8a9ebc1 cmd/vendor-install.sh: allow download vendors from HOMEBREW_ARTIFACT_DOMAIN and HOMEBREW_BOTTLE_DOMAIN 2021-09-12 21:54:37 +08:00
Gautham Goli
e4118bc4ca Fix shellcheck style errors 2021-05-18 17:10:20 +05:30
Mike McQuaid
b914411ac8
Delete Bintray code
Remove all code related to Bintray. It no longer works so there's no
point keeping it around.

Some of this could arguably be deprecated/disabled first/instead but:
I'm not sure I see the sense in keeping stuff around that's known to be
broken.
2021-05-12 13:37:18 +01:00
hyuraku
61076c7c26 add how to set HOMEBREW_CURL 2021-04-26 21:56:27 +09:00
hyuraku
51c39c898f add SC2153 2021-04-24 00:35:03 +09:00
hyuraku
e82e4ea7c2 repair vendor-install.sh 2021-04-24 00:02:50 +09:00
hyuraku
c67c202e54 add how to set ENV 2021-04-23 22:56:08 +09:00
Gautham Goli
5183f9aeaf vendor-install.sh: Fix shellcheck style errors 2021-04-23 22:26:21 +09:00
Mike McQuaid
7af68d0f8e
Fix shellcheck failures
A new version of `shellcheck` (I think?) brought us so new warnings and
errors.

To fix:
- pass `--source-path` so we don't need to stop `shellcheck` trying to
  read sourced files every time
- disable some more warnings/errors we don't care about fixing
2021-04-22 13:18:44 +01:00
Mike McQuaid
bf199cf271
Default Homebrew on Linux to use GitHub Packages. 2021-04-09 09:17:25 +01:00