From 0eb09f9ee521108ff5a8659334c0fd27016f0e04 Mon Sep 17 00:00:00 2001 From: Adrian Pop Date: Tue, 11 Aug 2026 20:03:27 +0200 Subject: [PATCH] Make the configuration hash the same on every machine Two machines testing the same library, with the same compiler and the same library version, claimed it both and tested it both. The claim in #295 is keyed by (branch, libname, libversion, omcversion, confighash), and their confighashes differed, so as far as the database was concerned they were testing different things. The hash is taken over the configuration of the library, and the configuration by then holds the reference files as an absolute path: destinationReal = os.path.realpath(destination) c["referenceFiles"] = destinationReal so two machines whose workspaces sit in different places, or whose paths pass through different symbolic links, hash the same configuration differently. That never mattered while each machine had its own sqlite3 file and the hash only had to be stable on the machine that made it. Sharing one database made it matter, and it defeats both the claim and the check for results we already have. The path says nothing that the hash needs: the contents of the reference files are hashed right after it, and the same files in another directory are the same test. It is replaced by a constant. Checked with the same configuration under two different reference directories: the hashes were 3181697168 and 2732211752 before, are equal after, and still differ when a reference file itself changes. Every confighash changes value once, so the first run after this treats every library as untested and tests it. From then on the machines agree. --- Generated by Claude Code. --- test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test.py b/test.py index b6ca625..c4d88bf 100755 --- a/test.py +++ b/test.py @@ -605,6 +605,11 @@ def hashReferenceFiles(s): del(c["configFromFile"]) if "referenceFiles" in c: del(c["referenceFilesURL"]) + # Where the reference files happen to live on this machine must not go into + # the hash: their contents are hashed just below, and two machines sharing + # a database have to agree on what a configuration is. Each machine only + # ever had its own sqlite3 file before, so an absolute path was harmless. + c["referenceFiles"] = "referenceFiles" confighash = strToHashInt(str(c)+hashReferenceFiles(conf["referenceFiles"])) else: confighash = strToHashInt(str(c)+hashReferenceFiles(""))