From f2a26bcef332bc6c30cb2232e280cfd4da97094c Mon Sep 17 00:00:00 2001 From: Mathieu Boespflug Date: Mon, 30 Dec 2019 17:53:47 +0100 Subject: [PATCH] os: add NixOS to the constraint values NixOS uses the Linux kernel, but that's where commonality with the myriad Linux distributions out there stops. Like the different BSD's, NixOS is sufficiently different that it warrants a constraint value. In particular, no non-static binary has any chance of running on NixOS unless it was specifically built for it, because the dynamic linker is in a non-standard location. This means that toolchains downloaded as part of host autoconfiguration that detect Linux (like `go_register_toolchains()`) always fail on NixOS. NixOS is a popular operating system used by thousands, one of the most active projects on all of GitHub, and with more unique packages than even Debian, Fedora or Gentoo according to https://repology.org/. --- os/BUILD | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/os/BUILD b/os/BUILD index 16df5d3..16525d3 100644 --- a/os/BUILD +++ b/os/BUILD @@ -76,3 +76,11 @@ constraint_value( name = "qnx", constraint_setting = ":os", ) + +# NixOS uses the Linux kernel, but is not ABI-compatible with any +# other Linux distribution. This is because the dynamic linker is in +# a non-standard (and undefined) location on the filesystem. +constraint_value( + name = "nixos", + constraint_setting = ":os", +)