diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 3c9a2729ecb..ee75b6fd097 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -52,6 +52,7 @@ import enum import io import itertools +import json import os import pathlib import platform @@ -2145,7 +2146,9 @@ def spec_hash(self, hash): if hash.override is not None: return hash.override(self) node_dict = self.to_node_dict(hash=hash) - json_text = sjson.dump(node_dict) + json_text = json.dumps( + node_dict, ensure_ascii=True, indent=None, separators=(",", ":"), sort_keys=False + ) # This implements "frankenhashes", preserving the last 7 characters of the # original hash when splicing so that we can avoid relocation issues out = spack.util.hash.b32_hash(json_text)