-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Conversation
f97315b
to
f8a4a63
Compare
There was a problem hiding this 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!
Library/Homebrew/os/linux.rb
Outdated
@@ -1,6 +1,7 @@ | |||
# typed: true | |||
# frozen_string_literal: true | |||
|
|||
require "os/mac/version" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote up #15343
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
3fdb253
to
e58c8cc
Compare
5a50005
to
d90bbed
Compare
87c78ce
to
8274920
Compare
There was a problem hiding this 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.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?I mentioned this in #15152 (comment).
Maybe also fixes the error in #15326, but
SimulateSystem
should still handleMacOS.full_version
correctly regardless.