lib.systems.equals: Ignore all function attributes reflectively

Co-authored-by: Artturi <Artturin@artturin.com>
This commit is contained in:
Robert Hensing 2023-06-13 10:22:06 +02:00
parent 18c7f6237f
commit 144018541b
2 changed files with 3 additions and 3 deletions

View File

@ -24,8 +24,8 @@ rec {
both arguments have been `elaborate`-d. both arguments have been `elaborate`-d.
*/ */
equals = equals =
let uncomparable = { canExecute = null; emulator = null; emulatorAvailable = null; isCompatible = null; }; let removeFunctions = a: lib.filterAttrs (_: v: !builtins.isFunction v) a;
in a: b: a // uncomparable == b // uncomparable; in a: b: removeFunctions a == removeFunctions b;
/* /*
Try to convert an elaborated system back to a simple string. If not possible, Try to convert an elaborated system back to a simple string. If not possible,

View File

@ -69,7 +69,7 @@ lib.runTests (
let modified = let modified =
assert origValue != arbitraryValue; assert origValue != arbitraryValue;
lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; }; lib.systems.elaborate "x86_64-linux" // { ${platformAttrName} = arbitraryValue; };
arbitraryValue = "<<modified>>"; arbitraryValue = x: "<<modified>>";
in { in {
expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified; expr = lib.systems.equals (lib.systems.elaborate "x86_64-linux") modified;
expected = { expected = {