Target_os: it's called OS X not Mac OS


#1

I’ve noticed that in cfg(target_os) Rust calls OS X “macos”.

In the Apple world “Mac OS” often means the classic Mac OS (up to OS 9). The current system is called OS X by Apple (used to be “Mac OS X” until recently), e.g. notice the URL:

https://www.apple.com/osx/ (and /macos/ redirects to /osx/)

While using name the macos is not entirely wrong, it sounds suspicious. It’s as if Windows used target name win9x — you’d wonder whether it’s just a poor name or whether it’s meant literally and you should use winnt or win32 instead.

I think on OS X/Mac OS X the target_os should be osx (or os_x) or darwin.


#2

Well classic Mac OS is not supported, so it is not like it can be confused.


#3

Anecdotally, I rarely see osx used as an abbreviation in build systems - it’s usually darwin, though of course that applies to iOS too. I think macos is fine considering the year…


#4

Say they make an OS 11? Or merge it with iOS? For these reasons darwin is probably the best, but I’d give macos a close second place.


#5

Yes, I think darwin would work too (if it’s true on iOS as well), and strictly speaking it’s a closer analogy to linux.

Say they make an OS 11? Or merge it with iOS?

I think it’s unlikely that they’ll drop “X” anytime soon, but nobody can know for sure.

What we know for sure Apple has dropped “Mac” from the name already, so “macos” only has “os” left in common with the official name of the OS :slight_smile:


#6

If we’re going for naming based on the kernel, then should windows be named to nt?


#7

Darwin is not the name of the OS X kernel; that’s XNU. Darwin is theoretically the operating system consisting of the core open source components of OS X, although since these days half of it has been closed-sourced or has an open source version that doesn’t compile, it’s no longer much of an “operating system”.

But talking about this is pretty silly.


#8

I come from the future to say: Hey, it is called macOS now! Thanks Apple!


#9

Operating system identifiers, in general, should only ever be changed if they are actually misidentifying something. There’s extensive experience with this in the context of Autoconf’s config.guess identifiers; they get used in all sorts of places that you wouldn’t expect (e.g. system adminstration automation) and therefore it’s impossible to tell what might break if you go along with a marketing rename.

For instance, if cfg(target_os == "macos") code was getting built on FreeBSD, that could and should be fixed, but the behavior of cfg(target_os == "solaris") must not be changed just because SunOracle’s marketing department decided not to call their operating system Solaris anymore.

Similarly, it might have been better for Rust to call OSX “osx” from day one (but then we would be obliged not to follow Apple’s rename) but now we are stuck with “macos” and anyone who wants to do a port to the classic operating system is going to have to call it “macos_classic” or something like that.


#10

Yup. Rust got lucky with that one. Congratulations on predicting the future correctly!