Skip to content

Commit

Permalink
Merge pull request #16281 from Bo98/ruby3-hidden-defs-fix
Browse files Browse the repository at this point in the history
Hack fix for Sorbet hidden definitions update failing on Ruby 3
  • Loading branch information
apainintheneck authored Dec 3, 2023
2 parents a609182 + c776379 commit 0f39516
Show file tree
Hide file tree
Showing 5 changed files with 4,673 additions and 1,628 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/sorbet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,20 @@ jobs:
id: update
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
run: |
git fetch origin
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]
then
git fetch origin
BRANCH="sorbet-files-update"
echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
BRANCH="sorbet-files-update"
echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
if git ls-remote --exit-code --heads origin "${BRANCH}"
then
git checkout "${BRANCH}"
git checkout "Library/Homebrew/sorbet"
else
git checkout --no-track -B "${BRANCH}" origin/master
if git ls-remote --exit-code --heads origin "${BRANCH}"
then
git checkout "${BRANCH}"
git checkout "Library/Homebrew/sorbet"
else
git checkout --no-track -B "${BRANCH}" origin/master
fi
fi
brew typecheck --update --suggest-typed
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/dev-cmd/typecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def self.typecheck
ohai "Updating Tapioca RBI files..."
safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args
safe_system "bundle", "exec", "parlour"
safe_system "bundle", "exec", "srb", "rbi", "hidden-definitions"
safe_system({ "RUBYLIB" => "#{HOMEBREW_LIBRARY_PATH}/sorbet/hidden_definitions_hacks" },
"bundle", "exec", "srb", "rbi", "hidden-definitions")
safe_system "bundle", "exec", "tapioca", "todo"

if args.suggest_typed?
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/sorbet/hidden_definitions_hacks/webrick.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict
# frozen_string_literal: true

# This file intentionally left blank
Loading

0 comments on commit 0f39516

Please sign in to comment.