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

Regression in brew ruby -e 'puts "formula_name".f.path #9362

Closed
3 tasks done
scpeters opened this issue Dec 1, 2020 · 1 comment · Fixed by #9363
Closed
3 tasks done

Regression in brew ruby -e 'puts "formula_name".f.path #9362

scpeters opened this issue Dec 1, 2020 · 1 comment · Fixed by #9363
Labels
outdated PR was locked due to age

Comments

@scpeters
Copy link
Member

scpeters commented Dec 1, 2020

Bug report

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

I have a script that uses brew ruby -e to print the path to a homebrew formula. I can evaluate the expression successfully with brew irb, but it fails with brew ruby. For example, to print the path to the qt formula on linuxbrew:

$ brew irb
...
irb(main):001:0> puts "qt".f.path
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/qt.rb
...

What happened (include command output)

Though this expression can be evaluated with brew irb, it fails with brew ruby complaining that f is an uninitialized constant String::Formulary.

Command output

$ brew ruby -e 'puts "qt".f.path'
Traceback (most recent call last):
1: from -e:1:in <main>' /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/irb.rb:14:in f': uninitialized constant String::Formulary (NameError)

What you expected to happen

I expect brew ruby to work the same as brew irb.

Step-by-step reproduction instructions (by running brew commands)

  1. Run brew ruby -e 'puts "qt".f.path'

I used git bisect to trace the last "good" commit to 6750448 and the regression to 1b9002c. I've added a test in scpeters@b532e79 on top of the "good" commit that can be included in a pull request that fixes this.

Output of brew config and brew doctor commands

$ brew config
HOMEBREW_VERSION: 2.5.12-369-gc003070
ORIGIN: https://github.com/Homebrew/brew
HEAD: c00307024ffe7b6de9f87305830f0c867e1e8a19
Last commit: 2 hours ago
Core tap ORIGIN: https://github.com/Homebrew/linuxbrew-core
Core tap HEAD: 4fb3f5d8c44f897eaa6da6be59a420cec13f13f3
Core tap last commit: 4 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :1
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: octa-core 64-bit ivybridge
Clang: 6.0 build 600
Git: 2.17.1 => /usr/bin/git
Curl: 7.58.0 => /usr/bin/curl
Kernel: Linux 5.4.0-53-generic x86_64 GNU/Linux
OS: Ubuntu 18.04.5 LTS (bionic)
Host glibc: 2.27
/usr/bin/gcc: 8.4.0
/usr/bin/ruby: 2.5.1
glibc: N/A
gcc: N/A
xorg: N/A

$ brew doctor
Your system is ready to brew.
@scpeters scpeters mentioned this issue Dec 1, 2020
7 tasks
scpeters added a commit to scpeters/brew that referenced this issue Dec 2, 2020
This test aims to prevent regressions of Homebrew#9362.
@scpeters
Copy link
Member Author

scpeters commented Dec 2, 2020

regression test proposed in #9370

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 2, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 2, 2021
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 a pull request may close this issue.

2 participants