Skip to content

Draft: Bug 40065: Add commands to generate dependency graphs

boklm requested to merge boklm/rbm:bug_40065 into main

Closes #40065

/cc @pierov

This adds two commands, taking the same options as rbm build:

  • dot_deps_graph <project> <options>...: prints the graph in dot format
  • pdf_deps_graph <project> <options>...: generates a pdf in /tmp

For example to see dependencies of tor-expert-bundle on linux-x86_64 in alpha:

$ rbm/rbm pdf_deps_graph tor-expert-bundle --target alpha --target torbrowser-linux-x86_64
Created /tmp/fMmFzvI5jn.pdf

Some examples:

I have not tried yet on browser (it requires cloning firefox for l10n-changesets, which I have not done on this computer).

The configuration of which projects to skip, and components is done like this:

diff --git a/projects/android-toolchain/config b/projects/android-toolchain/config
index 070e58a0e..4ac033abb 100644
--- a/projects/android-toolchain/config
+++ b/projects/android-toolchain/config
@@ -4,6 +4,8 @@ filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("co
 version: '[% c("var/version_28") %]+[% c("var/version_29") %]+[% c("var/version_30") %]+[% c("var/version_31") %]+[% c("var/version_33") %]'
 container:
   use_container: 1
+deps_graph:
+  component: toolchain
 var:
   version_33: 33.0.1
   version_31: 31.0.0
diff --git a/projects/cctools/config b/projects/cctools/config
index 0a945db58..4d56f525b 100644
--- a/projects/cctools/config
+++ b/projects/cctools/config
@@ -7,6 +7,8 @@ git_hash: 30518813875aed656aa7f18b6d485feee25f8f87
 git_url: https://github.com/tpoechtrager/cctools-port
 container:
   use_container: 1
+deps_graph:
+  component: toolchain
 
 input_files:
   - project: container-image
diff --git a/projects/clang/config b/projects/clang/config
index 5e20d5db0..ba6068f36 100644
--- a/projects/clang/config
+++ b/projects/clang/config
@@ -3,6 +3,8 @@ version: '[% c("var/llvm_version") %]'
 filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
 container:
   use_container: 1
+deps_graph:
+  component: toolchain
 
 var:
   llvm_version: '[% pc("llvm-project", "version") %]'
diff --git a/projects/container-image/config b/projects/container-image/config
index cf4a4db13..dca5df4ca 100644
--- a/projects/container-image/config
+++ b/projects/container-image/config
@@ -4,6 +4,9 @@ pkg_type: build
 container:
   use_container: 1
 
+deps_graph:
+  skip: 1
+
 var:
   container:
     suite: '[% pc(c("origin_project"), "var/container/suite", { step => c("origin_step") }) %]'
diff --git a/projects/gcc/config b/projects/gcc/config
index 75a37731d..d5e7367e9 100644
--- a/projects/gcc/config
+++ b/projects/gcc/config
@@ -6,6 +6,8 @@ filename: '[% project %]-[% c("version") %]-[% IF c("var/linux-cross") %][% c("v
 version: '[% pc("gcc-source", "version") %]'
 container:
   use_container: 1
+deps_graph:
+  component: toolchain
 var:
   distdir: gcc
   deps:
diff --git a/projects/macosx-toolchain/config b/projects/macosx-toolchain/config
index 421b42d66..42dcca2e6 100644
--- a/projects/macosx-toolchain/config
+++ b/projects/macosx-toolchain/config
@@ -3,6 +3,8 @@ filename: '[% project %]-[% c("version") %]-[% c("arch") %]-[% c("var/build_id")
 version: 13.3
 container:
   use_container: 1
+deps_graph:
+  component: toolchain
 var:
   setup: |
     mkdir -p /var/tmp/dist
diff --git a/rbm.conf b/rbm.conf
index 67b49d2e6..fea76e017 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -13,6 +13,11 @@ container:
     # disable network in the build scripts
     build: 1
 
+deps_graph:
+  components:
+    toolchain:
+      color: lightskyblue1
+
 steps:
   src-tarballs:
     compress_tar: xz

Merge request reports

Loading