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

Hack fix for Sorbet hidden definitions update failing on Ruby 3 #16281

Merged
merged 3 commits into from
Dec 3, 2023
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
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 @@
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" },

Check warning on line 66 in Library/Homebrew/dev-cmd/typecheck.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/typecheck.rb#L66

Added line #L66 was not covered by tests
"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