54 Commits

Author SHA1 Message Date
Bo Anderson
376440cf3e
Dynamically find gem groups 2023-04-10 16:54:48 +01:00
Bo Anderson
b84bed7385
Revert "Revert "Split prof gems into their own group""
This reverts commit 7b336ed8cd3eb20461fdc45ce67e5318e53920c4.
2023-04-10 16:54:48 +01:00
Mike McQuaid
7b336ed8cd
Revert "Split prof gems into their own group" 2023-04-04 08:49:27 +01:00
Bo Anderson
8bafbcd65a
Split prof gems into their own group 2023-03-31 13:32:38 +01:00
Bo Anderson
81f262ece3
utils/gems: use env shebang when installing gems 2022-11-19 00:58:05 +00:00
Bo Anderson
e21c926f9b
Update Bundler to 2.3.26 2022-11-17 16:35:08 +00:00
Bo Anderson
796bad98ff
Allow gem installation on Rubies other than 2.6 2022-11-05 15:23:19 +00:00
Bo Anderson
8cb056c657
Remove sitedir from LOAD_PATH 2022-10-24 19:42:49 +01:00
Bo Anderson
200cdc69df
utils/gems: set SDKROOT for macOS system Ruby 2022-10-19 18:39:52 +01:00
Bo Anderson
c150657005
Restore ARM Linux support when installing gems 2022-10-17 13:59:40 +01:00
Bo Anderson
a0e784f0ea
Update to Bundler 2 2022-10-14 01:30:38 +01:00
Bo Anderson
a776d5f02b
Workaround macOS system Ruby issue picking incorrect native gem archs 2022-10-14 01:30:38 +01:00
Bo Anderson
5e31f41a52
utils/gems: prevent lockfile modification during installation 2022-10-14 01:30:37 +01:00
Bo Anderson
c87c97e4d7
utils/gems: install Bundler into vendor directory 2022-10-14 01:30:34 +01:00
Bo Anderson
9b99594753
Preliminary compatibility fixes for Ruby 3 2022-10-11 02:53:27 +01:00
Bo Anderson
40bbdc659e
Fix some Style/FetchEnvVar offences 2022-06-17 19:47:57 +01:00
Bo Anderson
a06d136d2c
Move Sorbet gems into an optional group 2021-06-11 08:10:30 +01:00
Mike McQuaid
c4d69dd2e9
Revert "fix(vendor-gems): redirect bundler stdout to stderr" 2021-06-07 14:51:07 +01:00
Gibson Fahnestock
07d571bebc
fix(vendor-gems): redirect bundler stdout to stderr
When running brew commands and interpreting the output, e.g. running
`brew livecheck --json`, it's necessary to stop other programs Homebrew
happens to execute from writing logging output to stdout. Most programs
don't do this, but `bundle install` does seem to.

To reproduce the issue you can run:

```shell
git -C "$(brew --prefix)" clean -ffdx Library/Homebrew/vendor
stdout=$(HOMEBREW_FORCE_VENDOR_RUBY=1 brew livecheck --newer-only --json --cask $(brew --repo homebrew/cask)/Casks/grid.rb)
echo "^^^ was stderr, >>> is stdout: $stdout"
```

If you run it without this change it will print a bunch of output like
this to the stdout before printing out the livecheck JSON output:

```text
Using bundler 1.17.3
Fetching byebug 11.1.3
Fetching coderay 1.1.3
Installing byebug 11.1.3 with native extensions
Installing coderay 1.1.3
Fetching colorize 0.8.1
Installing colorize 0.8.1

[
  # Contents of the JSON block.
]
```

With this change the stdout from `bundle install` will be redirected to
brew's stderr, meaning only the JSON goes to stdout, and the rest goes
to stderr.
2021-06-03 11:18:23 +01:00
Mike McQuaid
c3ea073a07
utils/gems: add dependencies to LOAD_PATH. 2021-03-29 14:26:34 +01:00
Bo Anderson
e51597b4eb
utils/gems: don't leak BUNDLE_GEMFILE 2021-03-27 02:15:56 +00:00
Bo Anderson
769a6cd1f5
Don't touch PATH, GEM_HOME and GEM_PATH when testing formula 2021-03-10 17:08:57 +00:00
Bo Anderson
30ce9b92e8
utils/gems: add installed gems to $LOAD_PATH 2021-02-28 01:28:51 +00:00
Bo Anderson
a5b12a33c2
utils/gems: use Gem API rather than ENV to set paths 2021-02-27 16:23:28 +00:00
Bo Anderson
1fba9b9b53
Prevent loading all non-Bundler gems 2021-02-26 18:23:48 +00:00
Mike McQuaid
60876eed88
Improve Bootsnap behaviour
- further refactor nested conditional to make it clearer
- allow running on Linux while still excluding Apple Silicon
- only warn on `bundle install` failures
2021-02-25 15:59:17 +00:00
Mike McQuaid
9b4a7856ac
Revert "RbConfig: fix broken MacOS SDK paths"
This reverts commit 11445e0f3edf29ee64081c5a05b5257d9b5ccdd9.
2020-12-08 17:14:00 +00:00
Misty De Meo
11445e0f3e RbConfig: fix broken MacOS SDK paths 2020-12-07 10:33:56 -08:00
Markus Reiter
f438fa98be Avoid reinstalling bundler in integration tests. 2020-11-30 20:52:27 +01:00
Markus Reiter
0716d0bf28 Don't output “Installing 'bundler' gem” to $stdout. 2020-11-30 20:52:27 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
8a40afcc8a Update vendored Gems. 2020-09-20 03:19:39 +02:00
Mike McQuaid
6a98b23575
bundler: use 1.17.2 again.
This was what is included with macOS system Ruby 2.6.3.
2020-08-10 08:22:03 +01:00
rmnull
da4eb39925
bump BUNDLER_VERSION to 1.17.3(keep in sync with Gemfile.lock) 2020-08-07 23:58:24 +05:30
rmnull
a7405601f3
Use Gem to install gems instead of invoking system 2020-06-04 11:36:58 +05:30
Mike McQuaid
b615de1bc3
utils/gems: always ensure default Gems are in GEM_PATH.
Fixes #7608.
2020-06-03 10:02:46 +01:00
Mike McQuaid
73df5891ef
Merge pull request #7283 from claui/fix-make-tmpfile
Ensure TMPDIR is set for Xcode’s `make`
2020-04-11 13:11:30 +01:00
Claudia
29538c89cd
Set TMPDIR for Xcode’s make
This fixes an issue where at least in Xcode 11.0, `make` uses
`/var/tmp` as a fallback for temporary files unless `TMPDIR` is set:

```
$ strings "$(xcrun -f make)" | grep -B 3 fopen
TMPDIR
/var/tmp/
GmXXXXXX
fopen (temporary file)
```

Given that Homebrew filtered `TMPDIR`, and the `/var/tmp` directory may
not be writable for non-root users, this would cause Homebrew’s
build environment to error out:

```
$ brew ruby -e 'puts ENV["TMPDIR"]; puts `: | make -f -`'
```

```
Ignoring bigdecimal-2.0.0 because its extensions are not built. Try: gem pristine bigdecimal --version 2.0.0
[…]
Ignoring zlib-1.1.0 because its extensions are not built. Try: gem pristine zlib --version 1.1.0
make: *** fopen (temporary file): Permission denied.  Stop.
```

In practice, this would break `brew audit`, `brew style`, and other
commands, which would run `make` to build native gem extensions.

This commit sets `TMPDIR` to `${HOMEBREW_TEMP}` in the gem environment, which
mirrors the behaviour we already have in other places.
We choose `HOMEBREW_TEMP` because that’s user-controlled but also falls
back to `/tmp` in case `TMPDIR` is not set in the user’s environment.

Thanks to Bo Anderson for helping find the bug.

CC: Bo Anderson <mail@boanderson.me>
2020-04-11 08:01:05 +02:00
Bo Anderson
846166c62f utils/gems: prioritise Homebrew's chosen Ruby 2020-04-05 15:38:10 +01:00
Mike McQuaid
682ac2a3b8
utils/gems: hardcode bundler version.
This should avoid issues like those described in:
https://discourse.brew.sh/t/bump-pr-formula-bundler-version/6520/3
2020-01-01 15:47:06 +00:00
Mike McQuaid
3609101728
utils/gems: fix finding bundler.
Need to specify the executable name not variable here.
2019-11-01 17:04:27 +00:00
Mike McQuaid
77531166d6
Use bundler from Ruby 2.6
Now Ruby comes with its own bundler let's favour using it when we can
over requiring a system one be installed.

This avoids needing to have anything in `~/.gem` again.

I am somewhat optimistic this may help with #6579 but it's useful
by itself.
2019-10-30 13:49:17 +00:00
Markus Reiter
a49282c318 Simplify return value logic. 2019-10-04 23:39:26 +02:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
ef2e297d3b
Disable RubyGems by default.
This speeds up all Ruby invocations where we don't need RubyGems by
around 10%. Where we do need RubyGems: include it manually.
2019-04-18 17:45:03 +09:00
EricFromCanada
89f0fcedbe whitespace fixes 2019-04-13 21:32:04 -04:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Mike McQuaid
128300a754
utils/gems: install Bundler 2.
Our Gemfile requires it and it will result in a more consistent configuration.
2019-02-28 12:29:52 +00:00