Target_os: it's called OS X not Mac OS


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: (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.

1 Like


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



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…



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.



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:



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



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.



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



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.

1 Like


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

1 Like

closed #11

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.