The newcomer

This week, Microsoft has introduced its new Coreutils, UNIX-style command-line utilities, which helps developers feel right at home while working in a WINDOWS environment. Microsoft built Coreutils for WINDOWS directly on top of uutils/coreutils, an open-source, Rust-based modern rewrite of traditional UNIX utilities.

The benefits are arguable since WINDOWS developers already have MSYS2/Cygwin and others, which help make WINDOWS development analogous to Linux. The only benefit of Coreutils I clearly see is pipelining, which is becoming native, fast, and identical across WINDOWS and Linux.

cat server.log | grep "ERROR" | head -n 5 | awk '{print $1, $4}'

You can test it natively on Windows 11 right now:

winget install Microsoft.Coreutils

But why was Microsoft Coreutils not built on GNU tools?

POSIX

When reading the news, I was thinking, why didn’t Microsoft base its tools on GNU Coreutils? Is it really only the acclaimed security benefits of Rust language?

It turned out that GNU Coreutils are deeply dependent on — and often hardcoded for— POSIX interfaces. If WINDOWS would adopt GNU Coreutils, it would have to emulate the POSIX layer again. This would not be their first try. In the ’90s, Microsoft tried to emulate POSIX to win some government projects, and it was a failure.

In theory, software built for a UNIX-like system can work and build for another due to POSIX portability. In this regard, uutils/coreutils is already cross-platform, which means it is works for WSL too. This reduces the unique advantage of strict POSIX compliance.

The reality

However, the latter seems not the real reason. Microsoft and other major tech companies have a strict ban on using software under the GNU General Public License v3 (GPLv3).

For Microsoft, using GPLv3-licensed GNU tools poses a strict risk of ‘viral’ code contamination. This is due to the “Copyleft Clause,” which mandates that any software using parts of GPLv3 must be licensed under GPLv3 too. If a Microsoft engineer copies even a tiny snippet of GPLv3 code into the WINDOWS Terminal codebase, the entire project is legally classified as a ‘modified version’ or a ‘derivative work’ of that GNU tool.

uutils/coreutils,on the other hand, is licensed under the highly permissive MIT license.

Sources

  1. https://www.gnu.org/software/coreutils/
  2. https://www.gnu.org/licenses/gpl-3.0.en.html#:~:text=c%29-,You,it,-%2E
  3. License diagram via EPAM SolutionsHub