Browse Source

fix: ensure fuse order is read in a stable way (#29599)

Samuel Attard 3 years ago
parent
commit
73266f8f3d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      build/fuses/build.py

+ 2 - 1
build/fuses/build.py

@@ -1,5 +1,6 @@
 #!/usr/bin/env python3
 
+from collections import OrderedDict
 import json
 import os
 import sys
@@ -50,7 +51,7 @@ const volatile char kFuseWire[] = { /* sentinel */ {sentinel}, /* fuse_version *
 """
 
 with open(os.path.join(dir_path, "fuses.json5"), 'r') as f:
-  fuse_defaults = json.loads(''.join(line for line in f.readlines() if not line.strip()[0] == "/"))
+  fuse_defaults = json.loads(''.join(line for line in f.readlines() if not line.strip()[0] == "/"), object_pairs_hook=OrderedDict)
 
 fuse_version = fuse_defaults['_version']
 del fuse_defaults['_version']