There are 3 string templates including OS X in diagnostics:
"You are using OS X #{MacOS.version}."
"OS X: #{MacOS.full_version}-#{kernel}"
"To restore it, you must reinstall OS X or restore the binary from"
As Apple Inc. has renamed the desktop operating system from OS X to macOS, these diagnostic information will confuse people as time goes on, especially for the new-generation developers who learn developing from macOS 10.12.
OS X when MacOS.version < :sierra otherwise macOS. OS X string.Add a utility function to determine os name from os version. Basically it returns OS X when MacOS.version < :sierra otherwise macOS.
Use this function to replace fixed OS X string.
Agreed with this solution. Could you try and open a pull request? This document should help and I'm happy to walk you through anything else.
Thanks!
I'd rather see https://github.com/Homebrew/brew/pull/359 revived.
@zmwangx It sounds like this is proposing essentially the same as the result from the review process on that PR.
Ah right. We're supposed to wait for https://support.apple.com/os-x, no?
@zmwangx Thank you so much for referencing that pull request. I should have searched among closed pull request. I think this issue can be closed as #359 is a more complete solution. Any thoughts on when to reopen #359?
I should have searched among closed pull request.
No problem.
Any thoughts on when to reopen #359?
Pinged Dom. https://github.com/Homebrew/brew/pull/359#issuecomment-247033193
Or you can move forward with a new PR if you have time to work on this; #359 was probably an overcomplicated approach.
@zmwangx There are so many "OS X" there in the codebase (they also present on comments) so from the beginning I am just thinking about working on diagnostic module.
We shall achieve some consensus before working on rebranding. For example like how to deal with context-aware os_name and version requirement, or whether we shall backport macOS as the official os name and simply replace all OS X by macOS.
For example like how to deal with context-aware os_name and version requirement, or whether we shall backport macOS as the official os name and simply replace all OS X by macOS.
I'm mainly waiting to see what Apple call older versions on https://support.apple.com/os-x but I think it's very likely that they will call the newest version macOS and the older ones still OS X.
whether we shall backport macOS as the official os name and simply replace all OS X by macOS.
I'm 👍 on that (on Sierra and above). We need to do that with static docs anyway.
I'm happy to reopen & work on https://github.com/Homebrew/brew/pull/359 as desired, but if @JLHwung wants to work on their own PR & can get it done before the 20th (ideally) I'm always happy to see new contributors to the brew side of things.
Agree it looks increasingly like OS X is going to remain the name for everything < 10.12 and macOS for >= 10.12, and we should try to mimic that.
Agree it looks increasingly like OS X is going to remain the name for everything < 10.12 and macOS for >= 10.12
Well, of course they can't rebrand on their support site, or customers will be confused. We savvy folks know what macOS is. But if my mom tries to get help with her Windows and lands on pcOS support, I'm pretty sure she won't be able to recognize it.
@DomT4
I can spare time working on that based on your approach on #359. As I go through #359, there are several open questions:
OS X by macOS appearing in the comments? Or even do it contingently?#{MacOS.os_with_version} or leave it with #{MacOS.os_name} #{MacOS.version}@zmwangx 😄 for the pcOS example.
Whether to replace all OS X by macOS appearing in the comments?
Code comments? Yes. Just use macOS for that, there's no point using OS X/macOS everywhere in code comments, we'll just be needlessly bulking things up.
Whether to use a #{MacOS.os_with_version} or leave it with #{MacOS.os_name} #{MacOS.version}
Had to go dig up my local branch from a backup to find out what I'd done here 😄. I eventually settled on this locally, which seemed to fit the issue Martin had whilst still allowing vanilla os_name calls. I used Version.new at the time but we've moved to Version.create since so tweaked that here:
def os_name(version = @version)
if Version.create(version) < Version.create("10.12")
"OS X"
else
"macOS"
end
end
Note that I didn't test that change much at all after we made the decision to hold off until Sierra was closer though, so use at your own peril 🙈.
@DomT4 As for the comments, there are examples like #load commands added after OS X 10.1 need to be bitwise ORed so if replaced with macOS there will be macOS 10.1 or something. I am good with backporting new branding on ancient comments, but it might seem weird for maintainers.
Also could you restore your branch on #359 so that I can start working on that. It won't be late to 20th.
You could make a case for code comments with specific references to versions below 10.12 keeping OS X but I'm unconvinced it's worth the effort personally, and suspect contributors will find a consistent codebase a bit easier to navigate. Within two years there will be no OS X version Homebrew formally supports, so 😉.
Also could you restore your branch on #359 so that I can start working on that.
I can but the branch no longer applies cleanly, so it might not be much use to you. I'd probably just rip out the bits you want manually & stick them in the appropriate places.
Note that I didn't test that change much at all after we made the decision to hold off until Sierra was closer though, so use at your own peril
Did some testing locally with irb. Seems to solve the issue Martin raised at least:
@version = MacOS::Version.from_symbol(:yosemite)
puts "#{MacOS.os_name} #{@version.pretty_name} or newer is required."
=> macOS Yosemite or newer is required.
puts "#{MacOS.os_name(@version)} #{@version.pretty_name} or newer is required."
=> OS X Yosemite or newer is required.
Not super pretty but does what it says on the tin.
I'd probably just rip out the bits you want manually & stick them in the appropriate places.
Thank you. I just want to assure every commit's author is the real author since the commit does not have tutor field.
Whether to use a #{MacOS.os_with_version} or leave it with #{MacOS.os_name} #{MacOS.version}
Personally I prefer the latter one as they are different data, and I agree with your approach.
Thank you. I just want to assure every commit's author is the real author since the commit does not have tutor field.
I've got over 3000 commits to Homebrew in my name heh; I won't miss a handful of loose ideas I threw together in the past being attributed to you, fret not 😃.
@DomT4 #964 is ready for review.
I'm increasingly of the opinion that we should take the simplest route, avoid code complexity, and replace all instances of “Mac OS X” and “OS X” with a static “macOS” (and be done). I cannot imagine there will be much confusion and people (at least our target audience) will figure it out quickly. The following examples are probably not the most convincing ones, but my impression is that Apple already made the switch in their minds:
The API reference at https://developer.apple.com/reference/ only ever speaks of “macOS” when talking about when an API was introduced, even if it's “macOS 10.0+”.
This is by far the strongest argument for me so I'm 👍 with just using macOS all over.
@MikeMcQuaid Glad that Apple does replacement to make our life easier. Hope that google will soon learn the macOS-replaced brew error messages so that people won't get irrelevant search results.
The API reference at https://developer.apple.com/reference/ only ever speaks of “macOS” when talking about when an API was introduced
There are still plenty of references to "OS X" in there. Looks like Apple's not being consistent.
There are still plenty of references to "OS X" in there. Looks like Apple's not being consistent.
It's true they haven't eradicated every occurrence yet (and maybe never will). It pops up in descriptions here and there, but my impression was that you have to search for it to find it. What I was referring to was mostly the “SDKs” block that appears on almost every page there.
Most helpful comment
I'm increasingly of the opinion that we should take the simplest route, avoid code complexity, and replace all instances of “Mac OS X” and “OS X” with a static “macOS” (and be done). I cannot imagine there will be much confusion and people (at least our target audience) will figure it out quickly. The following examples are probably not the most convincing ones, but my impression is that Apple already made the switch in their minds: