mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
lib.systems.equals: Ignore all function attributes reflectively
Co-authored-by: Artturi <Artturin@artturin.com>
This commit is contained in:
parent
18c7f6237f
commit
144018541b
@ -24,8 +24,8 @@ rec {
|
||||
both arguments have been `elaborate`-d.
|
||||
*/
|
||||
equals =
|
||||
let uncomparable = { canExecute = null; emulator = null; emulatorAvailable = null; isCompatible = null; };
|
||||
in a: b: a // uncomparable == b // uncomparable;
|
||||
let removeFunctions = a: lib.filterAttrs (_: v: !builtins.isFunction v) a;
|
||||
in a: b: removeFunctions a == removeFunctions b;
|
||||
|
||||
/*
|
||||
Try to convert an elaborated system back to a simple string. If not possible,
|
||||
|
@ -69,7 +69,7 @@ lib.runTests (
|
||||
let modified =
|
||||
assert origValue != arbitraryValue;
|
||||
lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; };
|
||||
arbitraryValue = "<<modified>>";
|
||||
arbitraryValue = x: "<<modified>>";
|
||||
in {
|
||||
expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified;
|
||||
expected = {
|
||||
|
Loading…
Reference in New Issue
Block a user