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

utils/ruby.sh: test_ruby(): keep temporary variables local #8325

Merged

Conversation

maxim-belkin
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

A couple of variables were not made local in 87931e1.

@Bo98, what's the logic behind

[[ -z "$HOMEBREW_MACOS" ]] && TERMINFO_DIRS="$vendor_ruby_terminfo"

lines? I couldn't find a PR/Issue associated with 87931e1, so not sure where to ask other than here. Don't we need TERMINFO_DIRS on Linux as well?

@maxim-belkin maxim-belkin self-assigned this Aug 12, 2020
@maxim-belkin maxim-belkin requested a review from Bo98 August 12, 2020 22:13
@Bo98
Copy link
Member

Bo98 commented Aug 12, 2020

Don't we need TERMINFO_DIRS on Linux as well?

[[ -z "$HOMEBREW_MACOS" ]] means not macOS, so that line is running on Linux.

@maxim-belkin
Copy link
Member Author

Right, my bad. So, why doesn't macOS need that. Can we set it in one place only? For example, right before export?

@Bo98
Copy link
Member

Bo98 commented Aug 12, 2020

So, why doesn't macOS need that.

Because on macOS we use system ncurses for portable Ruby, so we let system ncurses handle terminfo itself.

The Linux build has its own ncurses build and so has its own bundled terminfo.

Can we set it in one place only? For example, right before export?

As long as we make sure it only applies when portable Ruby is going to be used - not when it happens to find some system Ruby.

@MikeMcQuaid MikeMcQuaid merged commit 34972ab into Homebrew:master Aug 13, 2020
@MikeMcQuaid
Copy link
Member

Thanks @maxim-belkin!

@maxim-belkin maxim-belkin deleted the utils-ruby-local-variables branch August 17, 2020 18:47
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 17, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants