Patchwork [1/1] vala.bbclass: add dependency on vala

login
register
mail settings
Submitter Slater, Joseph
Date Sept. 23, 2013, 9:42 p.m.
Message ID <007BD92917A2324FA403BCF9A464CF843C51988E@ALA-MBB.corp.ad.wrs.com>
Download mbox | patch
Permalink /patch/58623/
State New
Headers show

Comments

Slater, Joseph - Sept. 23, 2013, 9:42 p.m.
From: Joe Slater [mailto:jslater@windriver.com] 
Sent: Monday, September 23, 2013 1:53 PM
To: MacLeod, Randy; Polk, Jeffrey
Cc: lpd-eng-rr
Subject: [PATCH 1/1] vala.bbclass: add dependency on vala

This class points the inheritor to directories in
the target sysroot, so we want to be sure things
like .vapi files are there.

Signed-off-by: Joe Slater <jslater@windriver.com>
---
 meta/classes/vala.bbclass |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Richard Purdie - Sept. 24, 2013, 8:24 a.m.
On Mon, 2013-09-23 at 21:42 +0000, Slater, Joseph wrote:
> From: Joe Slater [mailto:jslater@windriver.com] 
> Sent: Monday, September 23, 2013 1:53 PM
> To: MacLeod, Randy; Polk, Jeffrey
> Cc: lpd-eng-rr
> Subject: [PATCH 1/1] vala.bbclass: add dependency on vala
> 
> This class points the inheritor to directories in
> the target sysroot, so we want to be sure things
> like .vapi files are there.
> 
> Signed-off-by: Joe Slater <jslater@windriver.com>
> ---
>  meta/classes/vala.bbclass |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/vala.bbclass b/meta/classes/vala.bbclass
> index c7db08c..0a98dab 100644
> --- a/meta/classes/vala.bbclass
> +++ b/meta/classes/vala.bbclass
> @@ -1,9 +1,9 @@
>  # Vala has problems with multiple concurrent invocations
>  PARALLEL_MAKE = ""
>  
> -# Vala needs vala-native
> -DEPENDS += "vala-native"
> -DEPENDS_virtclass-native += "vala-native"
> +# Vala needs vala-native (and we need vala)
> +DEPENDS += "vala-native vala"
> +DEPENDS_class-native += "vala-native"

In class code this is a really bad idea. Why? Imagine a recipe which
does:

DEPENDS =+ "x"
DEPENDS_class-native = "y"

The += on the class-native above will not do what you think.

I'd recommend something like:

VALADEPENDS = "vala vala-native"
VALADEPENDS_class-native = "vala-native"
DEPENDS += "${VALADEPENDS}"

Most other classes actually use _append on DEPENDS to ensure consistent
behaviour.

Cheers,

Richard

Patch

diff --git a/meta/classes/vala.bbclass b/meta/classes/vala.bbclass
index c7db08c..0a98dab 100644
--- a/meta/classes/vala.bbclass
+++ b/meta/classes/vala.bbclass
@@ -1,9 +1,9 @@ 
 # Vala has problems with multiple concurrent invocations
 PARALLEL_MAKE = ""
 
-# Vala needs vala-native
-DEPENDS += "vala-native"
-DEPENDS_virtclass-native += "vala-native"
+# Vala needs vala-native (and we need vala)
+DEPENDS += "vala-native vala"
+DEPENDS_class-native += "vala-native"
 
 # Our patched version of Vala looks in STAGING_DATADIR for .vapi files
 export STAGING_DATADIR