Skip to content

Commit

Permalink
Enable Ruby 3 for HOMEBREW_DEVELOPER
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Nov 20, 2023
1 parent 6d65c4c commit 6d8584b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ jobs:
- name: tests (macOS 13)
test-flags: --coverage
runs-on: macos-13
- name: tests (Ubuntu 22.04; Ruby 3.1)
- name: tests (Ubuntu 22.04; Ruby 2.6)
runs-on: ubuntu-22.04
ruby: '3.1'
- name: tests (macOS 13; Ruby 3.1)
ruby: '2.6'
- name: tests (macOS 13; Ruby 2.6)
runs-on: macos-13
ruby: '3.1'
ruby: '2.6'
steps:
- name: Set up Homebrew
id: set-up-homebrew
Expand All @@ -321,6 +321,7 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: none

- name: Setup Ruby environment
if: matrix.ruby
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ RUN apt-get update \

USER linuxbrew
COPY --chown=linuxbrew:linuxbrew . /home/linuxbrew/.linuxbrew/Homebrew
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}" \
HOMEBREW_RUBY3=1
WORKDIR /home/linuxbrew

RUN mkdir -p \
Expand Down
5 changes: 5 additions & 0 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,11 @@ then
export HOMEBREW_SORBET_RUNTIME="1"
fi

if [[ -n "${HOMEBREW_DEVELOPER}" ]]
then
export HOMEBREW_RUBY3="1"
fi

if [[ -f "${HOMEBREW_LIBRARY}/Homebrew/cmd/${HOMEBREW_COMMAND}.sh" ]]
then
HOMEBREW_BASH_COMMAND="${HOMEBREW_LIBRARY}/Homebrew/cmd/${HOMEBREW_COMMAND}.sh"
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/standalone/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

# Install gems for Rubies we don't vendor for.
if unsupported_ruby && !ENV["HOMEBREW_SKIP_INITIAL_GEM_INSTALL"]
p "TESTTESTTEST"
p "#{ENV.fetch("HOMEBREW_REQUIRED_RUBY_VERSION", "")} -- #{RUBY_VERSION}"
Homebrew.install_bundler_gems!(setup_path: false)
ENV["HOMEBREW_SKIP_INITIAL_GEM_INSTALL"] = "1"
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_ruby() {
return 1
fi

if [[ -n "${HOMEBREW_RUBY3}" ]]
if [[ -n "${HOMEBREW_RUBY3}" && -z "${HOMEBREW_USE_RUBY_FROM_PATH}" ]]
then
required_ruby_version="3.1.0"
else
Expand Down

0 comments on commit 6d8584b

Please sign in to comment.