projects: Make the build order and package list deterministic #119
2 changed files with 6 additions and 4 deletions
|
|
@ -162,15 +162,16 @@ class CmdBuild(Cmd): # export
|
||||||
log(DEBUG, f'--- Adding dependency tree of module "{m}"')
|
log(DEBUG, f'--- Adding dependency tree of module "{m}"')
|
||||||
add_dep_tree(m, dep_flavours, dep_tree, all_deps)
|
add_dep_tree(m, dep_flavours, dep_tree, all_deps)
|
||||||
while len(all_deps):
|
while len(all_deps):
|
||||||
# Find any leaf
|
# Find any leaf, deterministically: sorted, so that the
|
||||||
for d in all_deps:
|
# order is reproducible across runs
|
||||||
|
for d in sorted(all_deps):
|
||||||
# Dependency d doesn't have dependencies itself
|
# Dependency d doesn't have dependencies itself
|
||||||
if not len(dep_tree[d]):
|
if not len(dep_tree[d]):
|
||||||
break # found
|
break # found
|
||||||
else: # no Leaf found
|
else: # no Leaf found
|
||||||
raise Exception(
|
raise Exception(
|
||||||
'Fatal: Dependencies between these modules are unresolvable: '
|
'Fatal: Dependencies between these modules are unresolvable: '
|
||||||
', '.join(all_deps)
|
', '.join(sorted(all_deps))
|
||||||
)
|
)
|
||||||
order.append(d) # do it
|
order.append(d) # do it
|
||||||
# bookkeep it
|
# bookkeep it
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ class CmdRequiredOsPkg(Cmd): # export
|
||||||
vals = self.app.get_values(deps, ['pkg.requires.' + sec], [flavour])
|
vals = self.app.get_values(deps, ['pkg.requires.' + sec], [flavour])
|
||||||
if vals:
|
if vals:
|
||||||
requires |= set(vals)
|
requires |= set(vals)
|
||||||
out = [f'"{dep}"' for dep in requires] if args.quote else requires
|
out = sorted(requires)
|
||||||
|
out = [f'"{dep}"' for dep in out] if args.quote else out
|
||||||
# TODO: add all not in build tree as -devel
|
# TODO: add all not in build tree as -devel
|
||||||
print(' '.join(out))
|
print(' '.join(out))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue