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:
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.
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…
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”.
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 Sun Oracle'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.