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

Merge HeadVersion and NullVersion into Version. #15336

Merged
merged 5 commits into from
May 9, 2023

Conversation

reitermarkus
Copy link
Member

@reitermarkus reitermarkus commented Apr 29, 2023

  • 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 typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

I mentioned this in #15152 (comment).

Maybe also fixes the error in #15326, but SimulateSystem should still handle MacOS.full_version correctly regardless.

@reitermarkus reitermarkus force-pushed the version-head-null branch 3 times, most recently from f97315b to f8a4a63 Compare April 30, 2023 00:01
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.

Thanks @reitermarkus, great work so far!

@@ -1,6 +1,7 @@
# typed: true
# frozen_string_literal: true

require "os/mac/version"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should avoid os/mac includes in this file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Then where do we get OS::Mac::Version from?

Copy link
Member

Choose a reason for hiding this comment

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

@reitermarkus How has it been working before now? Ideally we wouldn't even define module Mac below at all but I feel pretty strongly about not introducing more cross-OS coupling like this.

Copy link
Member

Choose a reason for hiding this comment

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

Wrote up #15343

Copy link
Member Author

Choose a reason for hiding this comment

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

Before it was using just Version::NULL instead of OS::Mac::Version::NULL and some macOS-specific methods were implemented on NullVersion.

Copy link
Member Author

Choose a reason for hiding this comment

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

that issue is not going to get closed so long as I remain project leader of Homebrew

By closed I mean either closed or implemented. If it's implemented, OS::Mac::Version won't be needed anyways on Linux.

Given that this is currently already required on Linux and this doesn't add an additional require, I don't think this needs to be blocked by #15343 though.

Copy link
Member

@MikeMcQuaid MikeMcQuaid May 8, 2023

Choose a reason for hiding this comment

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

I am sorry: again, I am not willing to ✅ this PR with this require in place. It's up to you to decide what to do with/about that but I'm not sure continued discussion here is going to achieve anything here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just don't get your reasoning here. What is so special about require "os/mac/version"? Is it only the path that is bothering you?

The implementation of OS::Mac::Version does not actually depend on macOS. Are you fine with renaming it to MacOSVersion and moving it to macos_version.rb and then doing require "macos_version"?

Copy link
Member

Choose a reason for hiding this comment

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

I just don't get your reasoning here. What is so special about require "os/mac/version"? Is it only the path that is bothering you?

I don't want to have any more requires in os/linux to stuff in os/mac.

Are you fine with renaming it to MacOSVersion and moving it to macos_version.rb and then doing require "macos_version"?

Please just leave this methods on Version like they were before.

If you're unwilling to do that: I'd rather not have a MacOSVersion but it's definitely preferable to doing a require from os/mac, yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please just leave this methods on Version like they were before.

They weren't in Version before, but in NullVersion. In this PR, those methods are merged into Version and OS::Mac::Version, respectively. By moving the macOS-specific methods into Version, we would duplicate them again, defeating the main point of this PR.

I will go ahead and move it out of os/mac.

@reitermarkus reitermarkus force-pushed the version-head-null branch 15 times, most recently from 5a50005 to d90bbed Compare May 9, 2023 02:51
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.

Thanks @reitermarkus. I'm fine with this being merged as-is.

@reitermarkus reitermarkus merged commit f7168bf into Homebrew:master May 9, 2023
@reitermarkus reitermarkus deleted the version-head-null branch May 9, 2023 23:01
@github-actions github-actions bot added the outdated PR was locked due to age label Jun 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2023
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.

3 participants