Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection
@ 2014-10-12 10:52 Luca Ceresoli
  2014-10-12 10:52 ` [Buildroot] [PATCH 2/2] scripts/graph-build-time: properly warn about missing modules Luca Ceresoli
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Luca Ceresoli @ 2014-10-12 10:52 UTC (permalink / raw)
  To: buildroot

This instruction in the middle of 'import' lines looks very strange.

Also, it was not obvious to me what the 'Agg' backend is.

Both things are actually correct, but it took a while to find out why.
So clarify with a comment to save someone else's time.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Sascha Arthur <sascha.arthur@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 support/scripts/graph-build-time | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
index 4bb90c2..b2817bd 100755
--- a/support/scripts/graph-build-time
+++ b/support/scripts/graph-build-time
@@ -52,7 +52,12 @@
 import matplotlib as mpl
 import numpy
 
+# Use the Agg backend (which produces a PNG output, see
+# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
+# otherwise an incorrect backend is used on soe host machines).
+# Note: matplotlib.use() must be called *before* matplotlib.pyplot.
 mpl.use('Agg')
+
 import matplotlib.pyplot as plt
 import matplotlib.font_manager as fm
 import csv
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] scripts/graph-build-time: properly warn about missing modules
  2014-10-12 10:52 [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Luca Ceresoli
@ 2014-10-12 10:52 ` Luca Ceresoli
  2014-10-12 15:23   ` Peter Korsgaard
  2014-10-12 10:57 ` [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Yann E. MORIN
  2014-10-12 15:22 ` Peter Korsgaard
  2 siblings, 1 reply; 6+ messages in thread
From: Luca Ceresoli @ 2014-10-12 10:52 UTC (permalink / raw)
  To: buildroot

Currently the graph-build-time script prints a python exception if a
needed module cannot be imported. Catch the exception and tell the user
which packages are missing, as we do for other missing dependencies.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 support/scripts/graph-build-time | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
index b2817bd..fbb3d52 100755
--- a/support/scripts/graph-build-time
+++ b/support/scripts/graph-build-time
@@ -49,8 +49,14 @@
 #   * argparse (by default in Python 2.7, requires python-argparse if
 #     Python 2.6 is used)
 
-import matplotlib as mpl
-import numpy
+import sys
+
+try:
+    import matplotlib as mpl
+    import numpy
+except ImportError:
+    sys.stderr.write("You need python-matplotlib and python-numpy to generate build graphs\n")
+    exit(1)
 
 # Use the Agg backend (which produces a PNG output, see
 # http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
@@ -62,7 +68,6 @@ import matplotlib.pyplot as plt
 import matplotlib.font_manager as fm
 import csv
 import argparse
-import sys
 
 steps = [ 'extract', 'patch', 'configure', 'build',
           'install-target', 'install-staging', 'install-images',
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection
  2014-10-12 10:52 [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Luca Ceresoli
  2014-10-12 10:52 ` [Buildroot] [PATCH 2/2] scripts/graph-build-time: properly warn about missing modules Luca Ceresoli
@ 2014-10-12 10:57 ` Yann E. MORIN
  2014-10-12 11:58   ` Thomas De Schampheleire
  2014-10-12 15:22 ` Peter Korsgaard
  2 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2014-10-12 10:57 UTC (permalink / raw)
  To: buildroot

Luca, All,

On 2014-10-12 12:52 +0200, Luca Ceresoli spake thusly:
> This instruction in the middle of 'import' lines looks very strange.
> 
> Also, it was not obvious to me what the 'Agg' backend is.
> 
> Both things are actually correct, but it took a while to find out why.
> So clarify with a comment to save someone else's time.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> Cc: Sascha Arthur <sascha.arthur@gmail.com>
> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Except for a little typo:

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

> ---
>  support/scripts/graph-build-time | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
> index 4bb90c2..b2817bd 100755
> --- a/support/scripts/graph-build-time
> +++ b/support/scripts/graph-build-time
> @@ -52,7 +52,12 @@
>  import matplotlib as mpl
>  import numpy
>  
> +# Use the Agg backend (which produces a PNG output, see
> +# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
> +# otherwise an incorrect backend is used on soe host machines).

s/soe/smoe/

Regards,
Yann E. MORIN.

> +# Note: matplotlib.use() must be called *before* matplotlib.pyplot.
>  mpl.use('Agg')
> +
>  import matplotlib.pyplot as plt
>  import matplotlib.font_manager as fm
>  import csv
> -- 
> 1.9.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection
  2014-10-12 10:57 ` [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Yann E. MORIN
@ 2014-10-12 11:58   ` Thomas De Schampheleire
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas De Schampheleire @ 2014-10-12 11:58 UTC (permalink / raw)
  To: buildroot

"Yann E. MORIN" <yann.morin.1998@free.fr> schreef:
>Luca, All,
>
>On 2014-10-12 12:52 +0200, Luca Ceresoli spake thusly:
>> This instruction in the middle of 'import' lines looks very strange.
>> 
>> Also, it was not obvious to me what the 'Agg' backend is.
>> 
>> Both things are actually correct, but it took a while to find out why.
>> So clarify with a comment to save someone else's time.
>> 
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>> Cc: Sascha Arthur <sascha.arthur@gmail.com>
>> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>
>Except for a little typo:
>
>Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
>> ---
>>  support/scripts/graph-build-time | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
>> index 4bb90c2..b2817bd 100755
>> --- a/support/scripts/graph-build-time
>> +++ b/support/scripts/graph-build-time
>> @@ -52,7 +52,12 @@
>>  import matplotlib as mpl
>>  import numpy
>>  
>> +# Use the Agg backend (which produces a PNG output, see
>> +# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
>> +# otherwise an incorrect backend is used on soe host machines).
>
>s/soe/smoe/

Are you sure? ;-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection
  2014-10-12 10:52 [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Luca Ceresoli
  2014-10-12 10:52 ` [Buildroot] [PATCH 2/2] scripts/graph-build-time: properly warn about missing modules Luca Ceresoli
  2014-10-12 10:57 ` [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Yann E. MORIN
@ 2014-10-12 15:22 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-10-12 15:22 UTC (permalink / raw)
  To: buildroot

>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:

 > This instruction in the middle of 'import' lines looks very strange.
 > Also, it was not obvious to me what the 'Agg' backend is.

 > Both things are actually correct, but it took a while to find out why.
 > So clarify with a comment to save someone else's time.

 > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
 > Cc: Sascha Arthur <sascha.arthur@gmail.com>
 > Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Committed with the typo fixed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] scripts/graph-build-time: properly warn about missing modules
  2014-10-12 10:52 ` [Buildroot] [PATCH 2/2] scripts/graph-build-time: properly warn about missing modules Luca Ceresoli
@ 2014-10-12 15:23   ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-10-12 15:23 UTC (permalink / raw)
  To: buildroot

>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:

 > Currently the graph-build-time script prints a python exception if a
 > needed module cannot be imported. Catch the exception and tell the user
 > which packages are missing, as we do for other missing dependencies.

 > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-12 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-12 10:52 [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Luca Ceresoli
2014-10-12 10:52 ` [Buildroot] [PATCH 2/2] scripts/graph-build-time: properly warn about missing modules Luca Ceresoli
2014-10-12 15:23   ` Peter Korsgaard
2014-10-12 10:57 ` [Buildroot] [PATCH 1/2] scripts/graph-build-time: clarify backend selection Yann E. MORIN
2014-10-12 11:58   ` Thomas De Schampheleire
2014-10-12 15:22 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox