diff options
author | Paul Barker <paul@paulbarker.me.uk> | 2017-01-01 22:21:19 +0000 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-01-03 10:28:33 -0500 |
commit | b0a72cd343c9bdb38d01f6dbf0c5ac3d55c769dd (patch) | |
tree | 015af8a09780023a0eff596038aa4a29518f1d26 /classes | |
parent | c0d11eeb261f65e6e3615cd9e08872c88425526d (diff) | |
download | meta-virtualization-b0a72cd343c9bdb38d01f6dbf0c5ac3d55c769dd.tar.gz |
go-osarchmap: Skip golang recipes for unsupported architectures
Building any recipe for a mips-based machine like arduino-yun currently leads
to errors in go_map_arch(). Instead, errors should only be raised if a recipe
which uses golang is built. This is achieved using the same error handling seen
in recipes-extended/xen.
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/go-osarchmap.bbclass | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/classes/go-osarchmap.bbclass b/classes/go-osarchmap.bbclass index 4e00c7bf..303b30ba 100644 --- a/classes/go-osarchmap.bbclass +++ b/classes/go-osarchmap.bbclass | |||
@@ -11,6 +11,11 @@ TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEAT | |||
11 | TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" | 11 | TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" |
12 | GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE',True) == d.getVar('HOST_GOTUPLE',True)]}" | 12 | GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE',True) == d.getVar('HOST_GOTUPLE',True)]}" |
13 | 13 | ||
14 | python() { | ||
15 | if d.getVar('TARGET_GOARCH') == 'INVALID': | ||
16 | raise bb.parse.SkipPackage('Cannot map `%s` to a go architecture' % d.getVar('TARGET_ARCH', True)) | ||
17 | } | ||
18 | |||
14 | def go_map_arch(a, d): | 19 | def go_map_arch(a, d): |
15 | import re | 20 | import re |
16 | if re.match('i.86', a): | 21 | if re.match('i.86', a): |
@@ -24,7 +29,7 @@ def go_map_arch(a, d): | |||
24 | elif re.match('p(pc|owerpc)(|64)', a): | 29 | elif re.match('p(pc|owerpc)(|64)', a): |
25 | return 'powerpc' | 30 | return 'powerpc' |
26 | else: | 31 | else: |
27 | bb.error("cannot map '%s' to a Go architecture" % a) | 32 | return 'INVALID' |
28 | 33 | ||
29 | def go_map_arm(a, f, d): | 34 | def go_map_arm(a, f, d): |
30 | import re | 35 | import re |