Open
Conversation
In particular, the unpacked source is now in $S as expected (not
$S/src/$GOIMPORT) so LICENSE files, patches, etc work as usual without
additional paths.
In addition:
- GOPATH is now exposed as a regular bitbake variable.
- GO binary is overridable (eg: to prefix it with godep)
- GO_{GCFLAGS,LDFLAGS} are no longer set from TARGET_CFLAGS/LDFLAGS.
go no longer uses gcc, so these flags are unlikely to be correct.
- New variables: GO_ASMFLAGS, GO_FLAGS
Go binaries don't use GNU_HASH.
Specific criteria is probably incomplete. Patches welcome.
caddy doesn't actually build because all these recipes use AUTOREV and upstream sources have drifted to include new dependencies. I'm not interested in maintaining these, but they should continue to serve as examples of how to use go.bbclass. (And this also serves as a good example of why we shouldn't use AUTOREV)
We only need go 1.4 to bootstrap newer versions of go compiler.
Upstream seems to be confused whether CC should have multiple args (separated by spaces) or be one arg (that may contain spaces). We would prefer the former / usual as this matches uses of $CC in other environments - so this patch does that.
In particular:
- Use bitbake environment variables rather than set in shell fragments
- Remove setup_cgo_gcc_wrapper (obsoleted by cc-args.patch)
- Cleanup path handling to take advantage of ${S}
DEPEND on go-native rather than go-cross (go >= 1.5 can cross-compile
to all supported architectures from the single native binary).
Mark ${PN}-dev as package arch "all" because it contains only golang
src code. ${PN}-staticdev contains the cross-compiled static
libraries and remains arch-specific.
Various minor path fixes and cleanups.
Standard go >=1.5 compiler can cross compile to all architectures with the one binary.
Author
|
(Apologies for the size of the PR - I can attempt to break this up further if you wish) |
Author
|
ping? |
bachp
reviewed
Mar 21, 2017
|
|
||
| FILES_${PN} += "${GOBIN_FINAL}/*" | ||
| LIC_FILES_CHKSUM = "file://COPYING;md5=389a9e29629d1f05e115f8f05c283df5" | ||
| S = "${WORKDIR}/git" |
There was a problem hiding this comment.
Maybe this could be simplified even futher similar to how the pypi.bbclass is implemented.
For example in a gopkg.bbclass it could:
- the
SRC_URIcould be derived from the import path Scould be set by default- fill the
HOMEPAGEvariable
There would only be a minimal set of information required for a standard conform packages, like it is for python for example: https://github.com/openembedded/meta-openembedded/blob/master/meta-python/recipes-devtools/python/python-chardet.inc
Example:
GO_IMPORT = "github.com/BurntSushi/toml"
LICENSE = "DWTFYW"
LIC_FILES_CHKSUM = "file://COPYING;md5=389a9e29629d1f05e115f8f05c283df5"
SRCREV = "${AUTOREV}"
inherit gopkg
Owner
|
Hi, sorry about the delay. It looks good, but I'm still going over a couple of things. Hopefully I can get this merged today or tomorrow. Thanks for the cleanup! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge the good bits from alternate golang recipe
https://gitlab.com/anguslees/meta-containos/tree/devel/recipes-devtools/go
Highlights: