Better ordering for bootstrapping.

This commit is contained in:
Mat Booth 2019-05-31 12:20:57 +01:00
commit 268f94ecd8
4 changed files with 99 additions and 39 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/*.png
/rpms/

13
clone_rpms.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
mkdir -p rpms
pushd rpms 2>&1 >/dev/null
for pkg in $(grep -B1 --no-group-separator buildorder ../tycho.yaml | grep -v buildorder | sed -e 's/:$//') ; do
if [ ! -d "$pkg" ] ; then
fedpkg clone $pkg
(cd $pkg && fedpkg switch-branch f30 && fedpkg switch-branch master && fedpkg switch-branch tycho)
fi
done
popd 2>&1 >/dev/null

54
gen_build_order_graph.py Executable file
View file

@ -0,0 +1,54 @@
#!/usr/bin/python3
import yaml
from pygraphviz import AGraph
from subprocess import call
with open("tycho.yaml", 'r') as stream:
yaml = yaml.safe_load(stream)
rpms = yaml['data']['components']['rpms']
g = AGraph(directed=True, name="G", strict=False, label="Build Order Graph")
ranks = []
for key, value in rpms.items():
rank = value['buildorder']
if rank not in ranks:
ranks.append(rank)
subg = g.get_subgraph(f"{rank}")
if subg is None:
subg = g.add_subgraph(name=f"{rank}", label=f"Build Order {rank}", rank="same")
subg.add_node(f"{rank}")
subg.add_node(key)
rs = value['rationale'].replace('\n', ' ').split('.')
reqs = []
breqs = []
for r in rs:
r = r.strip()
if not r or r == 'Module API':
continue
if r.startswith('Runtime dependency of'):
r = r[len('Runtime dependency of'):]
reqs = [x.strip() for x in r.split(',')]
if r.startswith('Build dependency of'):
r = r[len('Build dependency of'):]
breqs = [x.strip() for x in r.split(',')]
for req in reqs:
# For Rs, check if also a BR
if req not in breqs:
g.add_edge(key, req, color='blue')
else:
g.add_edge(key, req, color='purple')
for breq in breqs:
# For BRs, check if also a R
if breq not in reqs:
g.add_edge(key, breq, color='red')
ranks.sort()
for idx, rank in enumerate(ranks):
if idx+1 < len(ranks):
g.add_edge(rank, ranks[idx+1], weight=1000)
print(g.string())
g.draw("build_order_graph.png", prog="dot")
call('eog build_order_graph.png &', shell=True)

View file

@ -42,9 +42,9 @@ data:
api:
rpms:
- cbi-plugins
- takari-tycho-support
- tycho
- tycho-extras
- takari-tycho-support
buildopts:
rpms:
macros: |
@ -72,8 +72,8 @@ data:
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse.
Build dependency of eclipse.
Runtime dependency of eclipse, tycho.
Build dependency of eclipse, tycho.
cbi-plugins:
buildorder: 50
ref: tycho
@ -96,23 +96,21 @@ data:
Runtime dependency of takari-lifecycle, tycho.
Build dependency of glassfish-jsp, tycho.
eclipse:
buildorder: 120
buildorder: 80
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse-emf, takari-lifecycle,
tycho.
Build dependency of eclipse, eclipse-ecf, eclipse-emf,
jetty, takari-lifecycle, tycho.
Runtime dependency of takari-lifecycle.
Build dependency of takari-lifecycle.
eclipse-ecf:
buildorder: 110
buildorder: 70
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse.
Build dependency of eclipse.
eclipse-emf:
buildorder: 100
buildorder: 60
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
@ -175,29 +173,29 @@ data:
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse.
Build dependency of eclipse.
Runtime dependency of eclipse, tycho.
Build dependency of eclipse, tycho.
glassfish-jsp:
buildorder: 20
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse.
Build dependency of eclipse.
Runtime dependency of eclipse, tycho.
Build dependency of eclipse, tycho.
google-gson:
buildorder: 10
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of takari-lifecycle.
Build dependency of takari-lifecycle.
Runtime dependency of eclipse, takari-lifecycle.
Build dependency of eclipse, takari-lifecycle.
icu4j:
buildorder: 10
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse.
Build dependency of eclipse.
Runtime dependency of eclipse, tycho.
Build dependency of eclipse, tycho.
jackson-annotations:
buildorder: 30
ref: tycho
@ -279,15 +277,15 @@ data:
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse.
Build dependency of eclipse.
Runtime dependency of eclipse, tycho.
Build dependency of eclipse, tycho.
sat4j:
buildorder: 10
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of eclipse.
Build dependency of eclipse.
Runtime dependency of eclipse, tycho.
Build dependency of eclipse, tycho.
takari-archiver:
buildorder: 10
ref: tycho
@ -303,34 +301,27 @@ data:
Runtime dependency of takari-lifecycle.
Build dependency of takari-lifecycle.
takari-lifecycle:
buildorder: 70
buildorder: 90
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of takari-pom.
Build dependency of eclipse-m2e-workspace,
takari-archiver, takari-incrementalbuild,
takari-lifecycle, takari-plugin-testing, takari-pom,
tesla-polyglot.
Build dependency of takari-pom.
takari-plugin-testing:
buildorder: 20
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Build dependency of takari-incrementalbuild,
takari-lifecycle.
Build dependency of takari-lifecycle.
takari-pom:
buildorder: 80
buildorder: 100
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of takari-tycho-support.
Build dependency of takari-archiver,
takari-incrementalbuild, takari-lifecycle,
takari-plugin-testing, takari-tycho-support,
tesla-polyglot.
Build dependency of takari-tycho-support.
takari-tycho-support:
buildorder: 90
buildorder: 110
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
@ -352,9 +343,9 @@ data:
takari-tycho-support, tycho-extras.
Build dependency of cbi-plugins, eclipse, eclipse-ecf,
eclipse-emf, eclipse-license, takari-tycho-support,
tycho, tycho-extras.
tycho-extras.
tycho-extras:
buildorder: 90
buildorder: 50
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
@ -371,8 +362,8 @@ data:
ref: tycho
arches: [x86_64, ppc64le, aarch64, s390x]
rationale: >
Runtime dependency of batik, eclipse.
Build dependency of batik, eclipse.
Runtime dependency of batik.
Build dependency of batik.
xpp3:
buildorder: 10
ref: tycho