Commit Graph

31 Commits

Author SHA1 Message Date
Arnout Vandecappelle
cfb6bf5ee9 graph-depends: remove unnecessary redirect of stderr
It hides any error messages reported by make.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Samuel Martin <s.martin49@gmail.com>
Tested-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-29 10:44:00 +02:00
Arnout Vandecappelle
b82f66cf40 graph-depends: support calling from recursive make
The graph-depends script calls make. If the outer make was called
recursively, or if it was called with '-C <somedir>', then the
environment will contain "MAKEFLAGS=w --". Therefore, the recursive
make prints 'Entering' and 'Leaving' messages, which clobbers the
output for dot.

To avoid this, add "--no-print-directory" to the recursive make
arguments. Since we require GNU make 3.81, we can be sure that this
option is available.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-29 10:43:37 +02:00
Arnout Vandecappelle
63454b1c07 graph-depends.py: support python3
This patch is the result of 2to3.

In addition, universal_newlines=True is added to the Popen calls. In
python3, this makes sure that the output is decoded so that we get a
string instead of a buffer object.

Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-22 19:05:18 +02:00
Yann E. MORIN
4cce4ac990 graphs/depends: do not draw transitive dependencies by default
The transitive dependencies make the graphs barely readable for large
configs, with a large number of packages.

So, just switch to not drawing the transitive dependencies by default.

By popular demand... ;-)

[Peter: reword]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc; Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-13 14:39:48 +02:00
Yann E. MORIN
47aeebd956 graph-depends: rename the mode constants
This is ugly, since Python does not have enum constructs, so by moving
the 'type' of the constant ('MODE' here) to the beginning, we get an
artificial 'namespace' for the constants.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-08 16:43:27 +02:00
Yann E. MORIN
4a2db6d193 graph-depends: document the 'transitive' variable
Although unnecessary (we already have initialisation via the parser),
initialise the 'transitive' option, and document it at the same time.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-08 16:43:22 +02:00
Yann E. MORIN
61dbf4d306 graph-depends: add option to set the colours
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Francois Perrad <fperrad@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-08 16:43:17 +02:00
Yann E. MORIN
e347bee02c graph-depends: handle the depth argument in a more pythonic way
Add some comment as well, enhance help text.

[thanks to Samuel for the hints to make it even more pythonic]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-08 16:43:13 +02:00
Yann E. MORIN
95ab905ba7 graphs-depends: merge redundant-dependencies elimination
Merge the redundant-dependencies elimination into the newly introduced
transitive-dependencies elimination.

This makes the code cleaner and much shorter, because:

  - the ('all',pkg) redundant dependency is in fact a transitive
    dependency, and we now have code to deal with that

  - the (pkg,'toolchain') dependency is easy enough to deal with that
    having a separate function for that is overkill

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-08 16:43:08 +02:00
Yann E. MORIN
67957967a5 graphs: add option to remove transitive dependencies in dependency graph
Currently, all the dependencies of a package are drawn on the dependency
graph, including transitive dependencies (e.g. A->B->C and A->C).

For very big graphs, with lots of packages with lots of dependencies, the
dependency graph can be very dense, and transitive dependencies are
cluttering the graph.

In some cases, only getting the "build-order" dependencies is enough (e.g.
to see what impact a package rebuild would have).

Add a new environment variable to disable drawing transitive dependencies.

Basically, it would turn this graph:

    pkg1 ---> pkg2 ---> pkg3 -------------------.
         |\__________/                 \         \
         |\____________________         \         \
         |                     \         \         \
          `-> pkg4 ---> pkg5 ---> pkg6 ---> pkg7 ---> pkg8
                    \__________/

into that graph:

    pkg1 ---> pkg2 ---> pkg3 -----------.
         |                               \
          `-> pkg4 ---> pkg5 ---> pkg6 ---> pkg7 ---> pkg8

[Thanks to Samuel for the parser hints]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-08 16:43:04 +02:00
Francois Perrad
b689264d38 graph-depends: refactor with more colors
Do not use the same colors for toolchain, host and target packages.

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
[yann.morin.1998@free.fr rephrase commit log]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-08 16:42:58 +02:00
Yann E. MORIN
a89f14e0f1 support/graphs: fix comparisons agains None
As Samuel said:
    In Python, None is a singleton, and it is recommended to use "is" or
    "is not" for testing them [1].

    [1] http://legacy.python.org/dev/peps/pep-0008/#programming-recommendations

Reported-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 22:50:24 +02:00
Yann E. MORIN
ede3e5fec3 support/graph-depends: don't show toolchain dependency for all packages
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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 21:00:38 +02:00
Yann E. MORIN
12c5e68ea8 support/graph-depends: add option to limit the depth of the graph
Currently, the complete dependency chain of a package is used to
generate the dependency graph. When this dependency chain is long,
the generated graph becomes almost unreadable.

However, it is often sufficient to get the first few levels of
dependency of a package.

Add a new variable BR2_GRAPH_DEPTH, that the user can set to limit
the depth of the dependency list.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 20:56:20 +02:00
Yann E. MORIN
3d37950ec1 support/graph-depends: use argparse to parse argv[]
Currently, we are using a crude, ad-hoc parsing of argv[].
This is a limiting factor to adding new options.

Use argparse instead, and introduce a single argument for now:
  --package, -p PACKAGE

In the (near) future, we'll be able to add more option arguments,
such as depth-limiting for big graphs.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-14 20:56:18 +02:00
Peter Korsgaard
1ba51d2fbd Merge branch 'next' 2013-06-02 16:33:05 +02:00
Tzu-Jung Lee
d67b3a54af skeleton: add default login port to /etc/securetty
We ran into a "Login incorrect" problem when running the same rootfs
image across platforms with different loging ports ttyS0/1/2/3.

Simply assignning "console" to BR2_TARGET_GENERIC_GETTY_PORT, which in
turn modifies the /etc/inittab, is not enough because the "console" device
was missing in the /etc/securetty.

While current securetty has enumerated a lot of ttys, this patch should save
some efforts to enumerate more.

[Peter: guard with single quotes]
Signed-off-by: Tzu-Jung Lee <tjlee@ambarella.com>
Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-26 23:00:30 +02:00
Danomi Manchego
bfca77e7f7 graph-depends: ignore the 'target-purgelocales' target
Otherwise, graph-depends tries to call 'make target-purgelocales-show-depends',
which does not exist, as 'target-purgelocales' is not an actual package.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-16 13:05:04 +02:00
Luca Ceresoli
13c367f827 graph-depends: fix program path in comment
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-15 16:04:48 +02:00
Luca Ceresoli
b193c1264a graph-depends: ignore the 'target-generic-dont-remount-rw' target
The graph-depends script tries to call 'make target-generic-dont-remount-rw',
which doesn't exist since 'target-generic-dont-remount-rw' is not a package.

See also the comments for commit 72bd61e5b8c2094378.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-15 16:04:35 +02:00
Thomas Petazzoni
a9ba807c58 graph-depends: ignore the 'target-post-image' target
Since the introduction of the post-image mechanism, the graph-depends
script is broken: it tries to call 'make
target-post-image-show-depends', which doesn't exist since
'target-post-image' is not a package.

So we should simply ignore this 'target-post-image'.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-03-06 21:10:24 +01:00
Yann E. MORIN
d946a1af93 graph-depends: add to exclusion list
Add the root-password internal target to the exclusion list.

Fixes failures like:
    Getting dependencies for [... 'target-root-passwd' ...]
    Error getting dependencies [... 'target-root-passwd' ...]

Which is easily singled out with:
    $ make target-root-passwd-show-depends
    make[1]: *** No rule to make target `target-root-passwd-show-depends'.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-02 22:00:00 +01:00
Thomas Petazzoni
1063539c53 graph-depends: remove support for "unknown" packages
The "unknown" packages mechanism was used to render packages that did
not implement the make <pkg>-show-depends target, i.e the packages
that were not yet converted to one of the package infrastructures.

Since now all packages have been converted, we can remove this
"unknown" packages feature.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-02 19:00:04 +01:00
Thomas Petazzoni
58cd46aa04 graph-depends: update copyright
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-02 18:59:43 +01:00
Thomas Petazzoni
393d2a7858 graph-depends: fix comment
Since 9bc7b1d4ae, all X.org .mk files
are parsed unconditionally, even if BR2_PACKAGE_XORG7 is disabled.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-02 18:59:31 +01:00
Thomas Petazzoni
4359685e14 graph-depends: optimize execution speed
Until now, graph-depends was calling "make <pkg>-show-depends"
individually for eack package, which was very slow. Now, it calls
"make <pkg1>-show-depends <pkg2>-show-depends ... <pkgN>-show-depends"
for all packages it knows, and then does that recursively. It reduces
the number of make invocations to the deepest dependency chain in the
current configuration, instead of having a number of make invocations
equal to the number of enabled packages.

For a configuration with xvkbd enabled (which brings a significant
number of X.org dependencies) and a tar root filesystem, the time to
execute graph-depends was:

real	5m14.944s
user	4m53.590s
sys	0m14.069s

After our optimizations, it is now:

real	0m33.096s
user	0m30.878s
sys	0m1.472s

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-02 18:58:24 +01:00
Thomas Petazzoni
41af66ef39 graph-depends: use a separate TARGET_EXCEPTIONS variable
In preparation for more graph-depends improvements, use a
TARGET_EXCEPTIONS list to list all the targets that should be ignored
while building the dependency graph.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-02 18:57:51 +01:00
Thomas Petazzoni
2404c0db7f graph-depends: remove redundant dependencies
When doing a full graph of the dependencies, graph-depends starts by
doing a "make show-targets", which lists all the packages registered
in the $(TARGETS) variable. This variable contains all packages that
are enabled according to the .config file. Then, for each of those
packages, we used to create a "all" -> "package" dependency, even if
in fact most of some packages are already dependencies of other
packages. This creates a needlessly complex dependency graph.

This patch modifies graph-depends so that it filters out the unneeded
"all" -> "package" dependencies when "package" is already the
dependency of another package.

For example, if you have a configuration with libpng (which selects
zlib), "make show-targets" displays "libpng zlib", so graph-depends
used to create the following dependencies: (all -> libpng, all ->
zlib, libpng -> zlib). However, the (all -> zlib) dependency is not
really needed, as zlib is already the dependency of libpng. Those
dependencies are now filtered out.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-02 18:57:45 +01:00
Yann E. MORIN
a293d4ab33 support/graph-depends: fix out-of-tree usage
graph-depends calls make to get the list of packages, and the
dependencies of each package.

When called out-of-tree, the Makefile is a wrapper that calls
the real Makefile, so make will spit out a line like:
  make -C /path/to/buildroot O=/path/to/build-dir show-targets

which graph-depends wrongly believes is part of the target list.

Be silent when calling make, as we really only want the target
and dependency lists.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-08-14 15:09:21 +02:00
Thomas Petazzoni
8278ed43ef graph-depends: ignore a few more uninteresting targets
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-17 19:44:26 +02:00
Thomas Petazzoni
f082c7c5cf support: move scripts/ to a new support/ directory
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-09-17 08:14:11 +02:00