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

lua: fix type issues #142299

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Conversation

samford
Copy link
Member

@samford samford commented Sep 13, 2023

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

As seen in #142161, the build for lua is currently failing due to some type issues.

TypeError: Parameter 'new_value': Expected type T.any(Pathname, String), got type NilClass
Caller: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/l/lua.rb:58
Definition: /opt/homebrew/Library/Homebrew/utils/string_inreplace_extension.rb:49
TypeError: Parameter 'new_value': Expected type T.any(Pathname, String), got type NilClass
Caller: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/l/lua.rb:59
Definition: /opt/homebrew/Library/Homebrew/utils/string_inreplace_extension.rb:49

With the two above, ENV.cflags and ENV.ldflags are nil. I'm on Sonoma, so I'm not sure if this is Sonoma-specific or happens on other macOS versions as well. If this should be handled in a different way than adding a conditional, feel free to suggest changes, push a commit, etc.

TypeError: Parameter 'version': Expected type T.nilable(T.any(Integer, String)), got type Version with value #<Version:0x000000015201e34....4", @detected_from_url=false>
Caller: /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/l/lua.rb:105
Definition: /opt/homebrew/Library/Homebrew/formula.rb:1727

With this last one, we simply need to call to_s on version.major_minor there (the others are interpolated into strings).

Copy link
Member

@SMillerDev SMillerDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Team work makes the dream work, thanks @samford !

@chenrui333 chenrui333 added the CI-no-bottles Merge without publishing bottles label Sep 13, 2023
@fxcoudert
Copy link
Member

I'd say we can merge without dependencies testing, at this point.

@samford
Copy link
Member Author

samford commented Sep 13, 2023

I'd say we can merge without dependencies testing, at this point.

Oh shoot, I forgot to add the CI-skip-dependents and CI-skip-recursive-dependents labels. If we want to skip dependents, we could add those labels and start a new run (since lua builds really quickly).

@samford samford added CI-skip-recursive-dependents Pass --skip-recursive-dependents to brew test-bot. CI-skip-dependents Pass --skip-dependents to brew test-bot. labels Sep 13, 2023
@BrewTestBot BrewTestBot added this pull request to the merge queue Sep 13, 2023
Merged via the queue into Homebrew:master with commit 6e0e534 Sep 13, 2023
20 of 27 checks passed
@samford samford deleted the sonoma/lua-fix-type-issues branch September 13, 2023 17:10
@samford samford mentioned this pull request Sep 15, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-no-bottles Merge without publishing bottles CI-skip-dependents Pass --skip-dependents to brew test-bot. CI-skip-recursive-dependents Pass --skip-recursive-dependents to brew test-bot. sonoma-bottling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants