diff mbox

[5/6] support/graph-depends: don't show toolchain dependency for all packages

Message ID e626cb1d54ac1756750c7ce473dde8d7d5b784b9.1397421554.git.yann.morin.1998@free.fr
State Accepted
Headers show

Commit Message

Yann E. MORIN April 13, 2014, 8:42 p.m. UTC
From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Al packages depend on 'toolchain'. Currently, 'graph-depends' graphs this
dependency. The resulting graph is thus cluttered with less-than-useful
information.

Instead, do not graph the 'toolchain' dependency for any package, save
for the fake 'all' package. The graph is now a bit more readable.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 support/scripts/graph-depends | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Thomas Petazzoni April 14, 2014, 7 p.m. UTC | #1
Dear Yann E. MORIN,

On Sun, 13 Apr 2014 22:42:41 +0200, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> Al packages depend on 'toolchain'. Currently, 'graph-depends' graphs this
> dependency. The resulting graph is thus cluttered with less-than-useful
> information.
> 
> Instead, do not graph the 'toolchain' dependency for any package, save
> for the fake 'all' package. The graph is now a bit more readable.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  support/scripts/graph-depends | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Are you sure this works? I applied your patch series, and I still see
all packages having a dependency on the toolchain. The PDF result is
http://free-electrons.com/~thomas/pub/bug-toolchain-graph-depends.pdf.

My defconfig is:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2014.02-rc1.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_13=y
BR2_TOOLCHAIN_EXTERNAL_LARGEFILE=y
BR2_TOOLCHAIN_EXTERNAL_INET_IPV6=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_XSERVER_XORG_SERVER=y
BR2_PACKAGE_JQUERY_UI=y
# BR2_TARGET_ROOTFS_TAR is not set

Thomas
Thomas Petazzoni April 14, 2014, 7:03 p.m. UTC | #2
Yann,

On Mon, 14 Apr 2014 21:00:03 +0200, Thomas Petazzoni wrote:

> Are you sure this works? I applied your patch series, and I still see
> all packages having a dependency on the toolchain. The PDF result is
> http://free-electrons.com/~thomas/pub/bug-toolchain-graph-depends.pdf.

Forget it: I screwed up when applying your patches, and only the first
four patches were applied, while it's the fifth patch that was
implementing this feature.

With all your patches applied, it just works.

Thanks!

Thomas
Samuel Martin April 14, 2014, 7:42 p.m. UTC | #3
Hi Yann,

On Sun, Apr 13, 2014 at 10:42 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> Al packages depend on 'toolchain'. Currently, 'graph-depends' graphs this
s/Al/All/

> dependency. The resulting graph is thus cluttered with less-than-useful
> information.
>
> Instead, do not graph the 'toolchain' dependency for any package, save
> for the fake 'all' package. The graph is now a bit more readable.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  support/scripts/graph-depends | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
> index ebf511b..4f532ba 100755
> --- a/support/scripts/graph-depends
> +++ b/support/scripts/graph-depends
> @@ -162,13 +162,16 @@ def has_redundant_deps(deps, pkg):
>  def remove_redundant_deps(deps):
>      newdeps = []
>      for dep in deps:
> -        if dep[0] != "all":
> +        if dep[0] == "all" and dep[1] == "toolchain":
> +            newdeps.append(dep)
> +            continue
> +        if dep[0] != "all" and dep[1] != "toolchain":
>              newdeps.append(dep)
>              continue
>          if not has_redundant_deps(deps, dep[1]):
>              newdeps.append(dep)
>              continue
> -        sys.stderr.write("Removing redundant dep all -> %s\n" % dep[1])
> +        sys.stderr.write("Removing redundant dep %s -> %s\n" % (dep[0],dep[1]))
>      return newdeps
>
>  TARGET_EXCEPTIONS = [
> --
> 1.8.3.2
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

In this cset, I don't see anything wrong.
However, I'm not sure to well understand this function and the
subtleties of these if conditions. I'll need to spend more time on
this ;)

Regards,
diff mbox

Patch

diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
index ebf511b..4f532ba 100755
--- a/support/scripts/graph-depends
+++ b/support/scripts/graph-depends
@@ -162,13 +162,16 @@  def has_redundant_deps(deps, pkg):
 def remove_redundant_deps(deps):
     newdeps = []
     for dep in deps:
-        if dep[0] != "all":
+        if dep[0] == "all" and dep[1] == "toolchain":
+            newdeps.append(dep)
+            continue
+        if dep[0] != "all" and dep[1] != "toolchain":
             newdeps.append(dep)
             continue
         if not has_redundant_deps(deps, dep[1]):
             newdeps.append(dep)
             continue
-        sys.stderr.write("Removing redundant dep all -> %s\n" % dep[1])
+        sys.stderr.write("Removing redundant dep %s -> %s\n" % (dep[0],dep[1]))
     return newdeps
 
 TARGET_EXCEPTIONS = [