by ajdude · 1y ago · 0 comments
While Unix compliancy isn't what's keeping me on macOS, the Unix tools it has under the hood still is. I've opted to use it over Linux because I still get everything that I need from a "Unix like" standpoint while having some serious enterprise level support and compatibility with work software that's often only available for windows or Mac.
If Apple stopped caring about being Unix compliant, I wouldn't be surprised to see the tools and infrastructure that make it Unix (and useful to me) slowly be removed. Then I'd stop using it.
In some ways, Apple's adherence to UNIX specifications probably makes macOS less useful for you. For example, I wish that grep on macOS was closer to GNU grep. When I look up commands online, I often find answers based on the GNU implementations. Those often work on macOS, but sometimes don't (or have subtly different behavior) because macOS is adhering to the UNIX specification rather than to what those utilities do on the vast majority of systems out there.
I don't think Apple would be removing UNIX-like tools from macOS even without certification. They know how valuable it is that most developers use their systems. Even Microsoft went so far as to implement the Windows Subsystem for Linux for developers. At this point, I think that UNIX certification makes macOS less compatible with the tools and help out there which generally targets Linux. Usually the differences are small, but they certainly can be meaningful.
I hope you're right but I'm not as confident. Corporations - Apple included - have been guilty of some surprising ignorance when it comes to things like this. I'm thankful for this certification circus to continue so that we don't need to test your theory.
UNIX certification is not the reason why macOS utilities are missing options compared to GNU - UNIX standards say you have to have certain options which work a certain way, they don’t prohibit adding additional options as vendor extensions. The reason is that Apple’s investment in improving these tools is minimal because it is a low priority for them, and because people who get annoyed by this often just end up installing the GNU tools anyway (using Homebrew or MacPorts)
In fact, GNU/Linux systems have been certified as UNIX in the past, by a couple of different Chinese vendors (Inspur K-UX, Huawei EulerOS)-which shows use of the GNU tools is no inherent obstacle to certification. The reason these vendors stopped, I suspect, is the money it was making them was smaller than the certification costs and UNIX trademark license fee
Outside of coreutils, let's consider bash and ksh88.
The two have differing behavior in several areas (coprocesses, alias handling, final pipeline fork, etc.), but this divergence in behavior happened before POSIX.2 and the standardization of the POSIX shell, which is largely a subset of ksh88.
The gist is that activating a mode for POSIX compliance will generally remove functionality, because the standardization happened a decade after development began, and the standards themselves were excessively conservative in adherence to System V.
I've seen that useful GNU extensions are generally adopted by BSD, but much more slowly by POSIX.
That does not serve UNIX well. Someone should challenge the Austin Group for effective control of UNIX standardization.
To get UNIX certification, you can just patch it to make POSIXLY_CORRECT=1 the default.
Or even don’t patch the utilities, and just patch /etc/profile to set POSIXLY_CORRECT=1 globally.
UNIX certification requires that the system have a mode of operation available which passes the test suite; the existence of config settings which if changed from their defaults produce standards violations is not in itself a standards violation.
macOS still has a bunch of GNU tools, but they appear to be incompatible with GNU tools used everywhere else, because they're so outdated.
The problem with the old tools is that I don't have admin rights at work so it's not easy to install coreutils. Or even homebrew.
I can understand why they did it though. Too many tools these days advocate just piping some curl into a root shell which is pretty insane. Homebrew does this too.
Right, but I think GP's point is that if Apple didn't feel pressured to get macOS UNIX-certified, then they wouldn't even bother to be UNIX-like. That is, all sorts of UNIX-required command-line tools would start to disappear from the default install, and things like POSIX conformance would take a back-burner, etc.
Not sure if I agree with that, but that's what GP seems to be suggesting.
> For example, I wish that grep on macOS was closer to GNU grep.
This has nothing to do with UNIX conformance; this just comes from macOS's BSD background, which does not use the GNU core utils. If the Linux folks wanted to go through UNIX conformance testing, they wouldn't have to switch away from GNU tools. And macOS could swap out the BSD-sourced tools for GNU tools and still get their UNIX certification.
It's not just about going through a song-and-dance. It's about making an OS that has different behavior - often very tiny differences, but differences that would make the distro worse for most users.
Isn’t it rather that Darwin was based on BSD 4.4? I’d imagine GPL 3.0 is a bigger impediment to them ever migrating to GNU tools than any desire to be UNIX certified.
It derives from 4.4 BSD but it's more than that.
macOS includes a woefully outdated bash 3.2 due to GPL 3.0; they switched to zsh long ago.
Even if macOS wasn’t UNIX-certified, Apple would still be unwilling/unable to include the GNU software due to the license. I can’t see the Apple of today implementing a full suite of non-GNU software but with GNU-style options either.
So, POSIX compliant or not, there’s probably no world where `grep -P` works out of the box on a Mac.
> I have to learn the replacement from ifconfig
MacOs switched to networksetup and ipconfig a long time ago. Ifconfig is not recommended so the situation is exactly the same than on Linux here.
> launchd IMHO is way better than init.d and systemd
Systemd is basically a more complete and better designed launchd. Having used both I have trouble thinking of anything launchd does better.
> the command line diskutil and other additions still feel like its more Unix like
Diskutil is a MacOS only tool. I’m a bit lost about what your argument is here.
Linux still use fdisk and dedicated tools to create file systems exactly like on FreeBSD or any other Unix. It’s MacOs doing its own thing here.
All that being said, I've spent some time on Arch, and I really like pacman and the AUR setup. And all that documentation is just amazing. I really didn't understand systemd before I read the archwiki article on it.
SystemD I think was a bit inspired by Launchd.
For example, Apple federated accounts are a great idea. But, in your global directory the UPN and email must be the same. For us it's not, with good reason. We're not going to change our entire setup globally to suit Mac users that make up 0.5% of our systems. And there's never going to be more unless they become more accommodating. We even looked at JAMF but it's too much work to implement a whole separate management system. And the options in apple's configuration profiles are way too limited.
Another issue, every account that has already been created as a private Apple id on the corporate email must be manually resolved. Impossible with many tens of thousands of users.
AD binding while rudimentarily supported, causes so many issues. If someone's password expires there's no way to log in unless they're physically on the company network. The problem is that our security team demand we bind to AD. Not Azure AD. That's just reality in enterprise.
Having a managed local admin account is also a really big problem and there isn't really any tooling for that.
Maybe if you go all in on Apple like IBM did, then yeah you could adapt your environment to all their quirks. But it's a big blocker for small deployments. And really besides IBM nobody in enterprise did this. Apple meanwhile doesn't really care anyway. They only care about the customer market.
POSIX conformance is a cherry on top, and it helps get them certain sales that require a conforming Unix. But that's not the real value to the platform.
The thing I hated the most was spending time building installation scripts or running images for the prod environment, and then go fight macos to replicate the same setup locally. Especially having parralel installs for the system and my user account was a PITA.
One would argue I could just dev on the docker image as well, but then being on a somewhat unixy OS doesn't matter much anymore.
WSL let's the Windows side live it's life (shell level tools can still be injected for convenience), and the linux side be genuinely Linux, not some ersatz, and duplicable to one's heart content. It's still less pain and better perfs than straight docker, and just extremely well integrated in general.
The Unix don’t really share much between each other apart from a small core.
One is better using the Windows alternatives.
Speed bumps regarding what?
I’m mostly using Linux nowadays but when I have to use Windows, the experience is fairly ok. The tooling when you want to manage it is imho superior to what Apple provides. I’m not used to develop on it but I have seen people do and it didn’t seem particularly worse than Linux-like environment.
Not that I really have anything against MacOS. I think it’s neglected by Apple and not as enjoyable as it used to be. I dislike Apple and the policies it’s pushing for. Nevertheless, it’s ok to use. Everything pretty much is nowadays.
macOS, Linux, and BSD treat CMD and GUI applications the same while Windows separates applications. Window's two type of application approach brakes the ability to use STDIN and STDOUT for logging and other useful means. Simple debugging of `./app > app.log` does not work on Windows with `app.exe > app.log` with GUI applications. The Windows variant needs a specialized logging system and more boilerplate code.
Windows also has one of the worst automation system when it comes to solution deployment. One needs to create custom mouse and keyboard emulation scripts to automate the installation of 3rd party applications when their installer does not support silent mode. AutoIT helps me with this greatly.
Speed bumps regarding compilation of tooling written with UNIX semantics in mind, without taking into consideration Windows development culture and OS semantics.
Everything except a package manager!
I'm convinced the devs inside Apple know what I'm saying as well, and are giving as much help as possible to Homebrew to keep it independent. There is some small proof, Homebrew was considered very highly during the DTK rollout for Apple Silicon.
Those that have one, it is not standard.