diff options
author | edef <edef@edef.eu> | 2024-04-04 14:05:18 +0000 |
---|---|---|
committer | edef <edef@edef.eu> | 2024-04-04 19:46:58 +0000 |
commit | 725bb4e48c6491598f53b83c2dcd1a307115c6cc (patch) | |
tree | 5e801c1cd8677cefd283e63ec3d0fc5484df98d4 /pkgs | |
parent | d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f (diff) |
lib: add xor
This gets clumsily reimplemented in various places, to no useful end.
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/compilers/llvm/13/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/14/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/15/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/16/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/17/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/18/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/git/default.nix | 7 |
7 files changed, 14 insertions, 35 deletions
diff --git a/pkgs/development/compilers/llvm/13/default.nix b/pkgs/development/compilers/llvm/13/default.nix index cd96231e62c35..429dfe5f1f3ee 100644 --- a/pkgs/development/compilers/llvm/13/default.nix +++ b/pkgs/development/compilers/llvm/13/default.nix @@ -42,12 +42,9 @@ }: -assert let - int = a: if a then 1 else 0; - xor = a: b: ((builtins.bitXor (int a) (int b)) == 1); -in +assert lib.assertMsg - (xor + (lib.xor (gitRelease != null) (officialRelease != null)) ("must specify `gitRelease` or `officialRelease`" + diff --git a/pkgs/development/compilers/llvm/14/default.nix b/pkgs/development/compilers/llvm/14/default.nix index 66f5c7385a150..6dcdcfa925840 100644 --- a/pkgs/development/compilers/llvm/14/default.nix +++ b/pkgs/development/compilers/llvm/14/default.nix @@ -41,12 +41,9 @@ , monorepoSrc ? null }: -assert let - int = a: if a then 1 else 0; - xor = a: b: ((builtins.bitXor (int a) (int b)) == 1); -in +assert lib.assertMsg - (xor + (lib.xor (gitRelease != null) (officialRelease != null)) ("must specify `gitRelease` or `officialRelease`" + diff --git a/pkgs/development/compilers/llvm/15/default.nix b/pkgs/development/compilers/llvm/15/default.nix index 0ccb9c449a8da..dcafd2970d005 100644 --- a/pkgs/development/compilers/llvm/15/default.nix +++ b/pkgs/development/compilers/llvm/15/default.nix @@ -41,12 +41,9 @@ , monorepoSrc ? null }: -assert let - int = a: if a then 1 else 0; - xor = a: b: ((builtins.bitXor (int a) (int b)) == 1); -in +assert lib.assertMsg - (xor + (lib.xor (gitRelease != null) (officialRelease != null)) ("must specify `gitRelease` or `officialRelease`" + diff --git a/pkgs/development/compilers/llvm/16/default.nix b/pkgs/development/compilers/llvm/16/default.nix index 66185071f22b7..46d17c193fc92 100644 --- a/pkgs/development/compilers/llvm/16/default.nix +++ b/pkgs/development/compilers/llvm/16/default.nix @@ -41,12 +41,9 @@ , monorepoSrc ? null }: -assert let - int = a: if a then 1 else 0; - xor = a: b: ((builtins.bitXor (int a) (int b)) == 1); -in +assert lib.assertMsg - (xor + (lib.xor (gitRelease != null) (officialRelease != null)) ("must specify `gitRelease` or `officialRelease`" + diff --git a/pkgs/development/compilers/llvm/17/default.nix b/pkgs/development/compilers/llvm/17/default.nix index c8d9569253450..fb3e967cc39b8 100644 --- a/pkgs/development/compilers/llvm/17/default.nix +++ b/pkgs/development/compilers/llvm/17/default.nix @@ -41,12 +41,9 @@ , monorepoSrc ? null }: -assert let - int = a: if a then 1 else 0; - xor = a: b: ((builtins.bitXor (int a) (int b)) == 1); -in +assert lib.assertMsg - (xor + (lib.xor (gitRelease != null) (officialRelease != null)) ("must specify `gitRelease` or `officialRelease`" + diff --git a/pkgs/development/compilers/llvm/18/default.nix b/pkgs/development/compilers/llvm/18/default.nix index dd3000c042594..ae1f4399cf2ed 100644 --- a/pkgs/development/compilers/llvm/18/default.nix +++ b/pkgs/development/compilers/llvm/18/default.nix @@ -41,12 +41,9 @@ , monorepoSrc ? null }: -assert let - int = a: if a then 1 else 0; - xor = a: b: ((builtins.bitXor (int a) (int b)) == 1); -in +assert lib.assertMsg - (xor + (lib.xor (gitRelease != null) (officialRelease != null)) ("must specify `gitRelease` or `officialRelease`" + diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix index 80cff85372d06..bd21a75b8c2fc 100644 --- a/pkgs/development/compilers/llvm/git/default.nix +++ b/pkgs/development/compilers/llvm/git/default.nix @@ -46,12 +46,9 @@ , monorepoSrc ? null }: -assert let - int = a: if a then 1 else 0; - xor = a: b: ((builtins.bitXor (int a) (int b)) == 1); -in +assert lib.assertMsg - (xor + (lib.xor (gitRelease != null) (officialRelease != null)) ("must specify `gitRelease` or `officialRelease`" + |