projects: Make the build order and package list deterministic #119
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20260922-deterministic-output"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The output of
projects build --build-orderand ofrequired-os-pkgis correct but not reproducible: both are built by iterating Python sets, so the order followed the hash seed of the Python process, and two runs of the same invocation could print different orders. Makes debugging harder, so make the output stable.cmds.projects.CmdBuild: Sort build order
The build order printed by
projects buildis not reproducible:calculate_order()picks the next module by iteratingall_deps, a set, so the order among modules that are ready at the same time depends on the hash seed of the Python process, and two runs of the same invocation can print different orders.Select the next module from the sorted set instead. The order stays topologically valid, and is now identical across runs and hash seeds. Sort the unresolvable-dependency error message the same way, so that it is stable, too.
cmds.projects.CmdRequiredOsPkg: Sort output
The list of OS packages printed by
required-os-pkgis not reproducible: the packages are collected in a set, and the set's iteration order depends on the hash seed of the Python process, so two runs of the same invocation can print the same packages in different orders.Print the sorted list instead. The order of a package list is meaningless to the package manager, and the output is now stable across runs and hash seeds.