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

gcc: Fix version_suffix #58558

Closed
wants to merge 1 commit into from
Closed

Conversation

gromgit
Copy link
Contributor

@gromgit gromgit commented Jul 24, 2020

The original implementation broke when called from other formulae in HEAD builds, as documented in https://discourse.brew.sh/t/calling-one-formulas-methods-in-another/8382. I've renamed the original method to buildver_suffix for internal use only, and defined a new version_suffix that does the right thing for external callers.

Tested with normal and HEAD builds of my own formula (gromgit/dev/umka).

The version_suffix comment is meant to imply a "public API", while also documenting its interface for posterity a.k.a. "don't break this".

  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with 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 brew install <formula>)?

The original implementation was fundamentally broken when called from other formulae in HEAD builds.

Per the discussion in https://discourse.brew.sh/t/calling-one-formulas-methods-in-another/8382, I've renamed the original method to `buildver_suffix` for internal use only, and defined a new `version_suffix` that does the right thing.

The `version_suffix` comment is an implied acknowledgement that this method is for "public use".
@gromgit gromgit force-pushed the gcc_version_suffix branch from 59831bd to 519a08e Compare July 25, 2020 01:07
@SeekingMeaning SeekingMeaning added the maintainer feedback Additional maintainers' opinions may be needed label Jul 29, 2020
@SMillerDev SMillerDev requested a review from a team July 30, 2020 07:58
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

buildver_suffix for internal use only, and defined a new version_suffix that does the right thing for external callers.

Can you try to have a method in Homebrew/brew for external callers instead?

@fxcoudert
Copy link
Member

Agree with @MikeMcQuaid, do not see why we should have two methods doing pretty much the same thing in the GCC formula

@gromgit
Copy link
Contributor Author

gromgit commented Jul 30, 2020

Can you try to have a method in Homebrew/brew for external callers instead?

Yeah, I guess formalizing something like Formula.installed_version might work better. Will sleep on it.

@gromgit gromgit closed this Jul 30, 2020
gromgit added a commit to gromgit/homebrew-core that referenced this pull request Aug 1, 2020
Addresses Homebrew#58558 by replacing private `version_suffix` with public `linked_version`.
dawidd6 pushed a commit that referenced this pull request Aug 2, 2020
Addresses #58558 by replacing private `version_suffix` with public `linked_version`.
@gromgit gromgit deleted the gcc_version_suffix branch August 12, 2020 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer feedback Additional maintainers' opinions may be needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants