* Re: [meta-virtualization][PATCH] umoci: rework recipe
[not found] <168DEA6BA6D7C3F7.26864@lists.yoctoproject.org>
@ 2021-07-02 8:11 ` hongxu
2021-07-02 13:23 ` Bruce Ashfield
0 siblings, 1 reply; 5+ messages in thread
From: hongxu @ 2021-07-02 8:11 UTC (permalink / raw)
To: meta-virtualization, bruce.ashfield
[-- Attachment #1: Type: text/plain, Size: 5743 bytes --]
On 7/2/21 3:59 PM, hongxu wrote:
> 1. tweak homepage
>
> 2. Use go_do_compile of go bbclass in oe-core to replace
> the do_compile in recipe, variables such as LD,CC,
> CFLAGS, CGO_CFLAGS will be set automatically
>
> 3. Use go_do_install of go bbclass in oe-core to replace
> the do_install in recipe, all necessary will be installed
>
> 4. export GO111MODULE=off globally
>
> 5. Skip file-rdeps insane for umoci dev packages since scripts
> in umoci dev packages contains awk, bash shebang
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> recipes-containers/umoci/umoci_git.bb | 75 ++++-----------------------
> 1 file changed, 10 insertions(+), 65 deletions(-)
>
> diff --git a/recipes-containers/umoci/umoci_git.bb b/recipes-containers/umoci/umoci_git.bb
> index f83a35a7..c4007eb3 100644
> --- a/recipes-containers/umoci/umoci_git.bb
> +++ b/recipes-containers/umoci/umoci_git.bb
> @@ -1,80 +1,25 @@
> -HOMEPAGE = "https://github.com/openSUSE/umoci"
> +HOMEPAGE = "https://umo.ci"
> SUMMARY = "umoci modifies Open Container images"
> LICENSE = "Apache-2.0"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
> +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
>
> RDEPENDS_${PN} = "skopeo"
> RDEPENDS_${PN}_class-native = ""
>
> -SRCREV_umoci = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> -SRC_URI = "git://github.com/opencontainers/umoci.git;branch=master;name=umoci;destsuffix=github.com/opencontainers/umoci \
> - "
> +SRCREV = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> +SRC_URI = " \
> + git://${GO_IMPORT}; \
> +"
>
> PV = "v0.4.7-dev+git${SRCPV}"
> -S = "${WORKDIR}/github.com/opencontainers/umoci"
> +S = "${WORKDIR}/git"
> GO_IMPORT = "github.com/opencontainers/umoci"
>
> inherit goarch
> inherit go
>
> -# This disables seccomp and apparmor, which are on by default in the
> -# go package.
> -EXTRA_OEMAKE="BUILDTAGS=''"
> +export GO111MODULE="off"
>
> -
> -do_compile_class-native () {
> - export GOARCH="${BUILD_GOARCH}"
> -
> - # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
> - export CGO_ENABLED="1"
> - export CFLAGS="${BUILD_CFLAGS}"
> - export LDFLAGS="${BUILD_LDFLAGS}"
> - export CGO_CFLAGS="${BUILD_CFLAGS}"
> -
> - # as of go 1.15.5, there are some flags the CGO doesn't like. Rather than
> - # clearing them all, we sed away the ones we don't want.
> - # export CGO_LDFLAGS="$(echo ${BUILD_LDFLAGS} | sed 's/-Wl,-O1//g' | sed 's/-Wl,--dynamic-linker.*?( \|$\)//g')"
> - export CC="${BUILD_CC}"
> - export LD="${BUILD_LD}"
> -
> - export GOPATH="${WORKDIR}/git/"
> - export GO111MODULE=off
> -
> - cd ${S}
> -
> - # why static ? patchelf will be run on dynamic binaries and it breaks
> - # the executable (coredump)
> - # https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
> - # https://github.com/NixOS/patchelf/issues/146
> - oe_runmake umoci.static
> -
Hi Bruce,
About native umoci, I've no idea about the patchelf testing, I directly
run native umoci -h in my build
...
$
image/buildarea/raid5/hjia/wrlinux-20/lat_deb_061621/build-binary/tmp-glibc/work/x86_64-linux/umoci-native/0.4.6-r0/recipe-sysroot-native/usr/bin/umoci
-h
NAME:
umoci - umoci modifies Open Container images
USAGE:
umoci [global options] command [command options] [arguments...]
VERSION:
unknown
AUTHOR:
Aleksa Sarai <asarai@suse.com>
COMMANDS:
raw advanced internal image tooling
help, h Shows a list of commands or help for one command
image:
config modifies the image configuration of an OCI image
unpack unpacks a reference into an OCI runtime bundle
repack repacks an OCI runtime bundle into a reference
new creates a blank tagged OCI image
tag creates a new tag in an OCI image
remove, rm removes a tag from an OCI image
stat displays status information of an image manifest
insert insert content into an OCI image
layout:
gc garbage-collects an OCI image's blobs
init create a new OCI layout
list, ls lists the set of tags in an OCI layout
GLOBAL OPTIONS:
--verbose alias for --log=info
--log value set the log level (debug, info, [warn], error, fatal)
(default: "warn")
--help, -h show help
--version, -v print the version
...
//Hongxu
> - # so the common install can find our binary
> - cp umoci.static umoci
> -}
> -
> -do_compile() {
> - export GOARCH="${TARGET_GOARCH}"
> - export GOPATH="${WORKDIR}/git/"
> -
> - # Pass the needed cflags/ldflags so that cgo
> - # can find the needed headers files and libraries
> - export CGO_ENABLED="1"
> - export CFLAGS=""
> - export LDFLAGS=""
> - export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> - export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> -
> - export GO111MODULE=off
> -
> - cd ${S}
> -
> - oe_runmake umoci
> -}
> -
> -do_install() {
> - install -d ${D}/${sbindir}
> - install ${S}/umoci ${D}/${sbindir}
> -}
> -
> -INSANE_SKIP_${PN} += "ldflags already-stripped"
> +INSANE_SKIP_${PN}-dev += "file-rdeps"
> +INSANE_SKIP_${PN} += "already-stripped"
> BBCLASSEXTEND = "native nativesdk"
>
>
>
[-- Attachment #2: Type: text/html, Size: 8212 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [meta-virtualization][PATCH] umoci: rework recipe
2021-07-02 8:11 ` [meta-virtualization][PATCH] umoci: rework recipe hongxu
@ 2021-07-02 13:23 ` Bruce Ashfield
0 siblings, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2021-07-02 13:23 UTC (permalink / raw)
To: Hongxu Jia; +Cc: meta-virtualization
On Fri, Jul 2, 2021 at 4:11 AM Hongxu Jia <hongxu.jia@windriver.com> wrote:
>
> On 7/2/21 3:59 PM, hongxu wrote:
>
> 1. tweak homepage
>
> 2. Use go_do_compile of go bbclass in oe-core to replace
> the do_compile in recipe, variables such as LD,CC,
> CFLAGS, CGO_CFLAGS will be set automatically
>
> 3. Use go_do_install of go bbclass in oe-core to replace
> the do_install in recipe, all necessary will be installed
>
> 4. export GO111MODULE=off globally
>
> 5. Skip file-rdeps insane for umoci dev packages since scripts
> in umoci dev packages contains awk, bash shebang
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> recipes-containers/umoci/umoci_git.bb | 75 ++++-----------------------
> 1 file changed, 10 insertions(+), 65 deletions(-)
>
> diff --git a/recipes-containers/umoci/umoci_git.bb b/recipes-containers/umoci/umoci_git.bb
> index f83a35a7..c4007eb3 100644
> --- a/recipes-containers/umoci/umoci_git.bb
> +++ b/recipes-containers/umoci/umoci_git.bb
> @@ -1,80 +1,25 @@
> -HOMEPAGE = "https://github.com/openSUSE/umoci"
> +HOMEPAGE = "https://umo.ci"
> SUMMARY = "umoci modifies Open Container images"
> LICENSE = "Apache-2.0"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
> +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
>
> RDEPENDS_${PN} = "skopeo"
> RDEPENDS_${PN}_class-native = ""
>
> -SRCREV_umoci = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> -SRC_URI = "git://github.com/opencontainers/umoci.git;branch=master;name=umoci;destsuffix=github.com/opencontainers/umoci \
> - "
> +SRCREV = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> +SRC_URI = " \
> + git://${GO_IMPORT}; \
> +"
>
> PV = "v0.4.7-dev+git${SRCPV}"
> -S = "${WORKDIR}/github.com/opencontainers/umoci"
> +S = "${WORKDIR}/git"
> GO_IMPORT = "github.com/opencontainers/umoci"
>
> inherit goarch
> inherit go
>
> -# This disables seccomp and apparmor, which are on by default in the
> -# go package.
> -EXTRA_OEMAKE="BUILDTAGS=''"
> +export GO111MODULE="off"
>
> -
> -do_compile_class-native () {
> - export GOARCH="${BUILD_GOARCH}"
> -
> - # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
> - export CGO_ENABLED="1"
> - export CFLAGS="${BUILD_CFLAGS}"
> - export LDFLAGS="${BUILD_LDFLAGS}"
> - export CGO_CFLAGS="${BUILD_CFLAGS}"
> -
> - # as of go 1.15.5, there are some flags the CGO doesn't like. Rather than
> - # clearing them all, we sed away the ones we don't want.
> - # export CGO_LDFLAGS="$(echo ${BUILD_LDFLAGS} | sed 's/-Wl,-O1//g' | sed 's/-Wl,--dynamic-linker.*?( \|$\)//g')"
> - export CC="${BUILD_CC}"
> - export LD="${BUILD_LD}"
> -
> - export GOPATH="${WORKDIR}/git/"
> - export GO111MODULE=off
> -
> - cd ${S}
> -
> - # why static ? patchelf will be run on dynamic binaries and it breaks
> - # the executable (coredump)
> - # https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
> - # https://github.com/NixOS/patchelf/issues/146
> - oe_runmake umoci.static
> -
>
> Hi Bruce,
>
> About native umoci, I've no idea about the patchelf testing, I directly run native umoci -h in my build
>
I have a whole series of OCI image construction changes that do need
that static support. both sloci and umoci run in some unique ways to
do the image work, hence why it must be static and isolated from the
defaults.
Once I get 5.13 into oe-core as the default kernel, I'll be returning
to that image work.
Cheers,
Bruce
> ...
>
> $ image/buildarea/raid5/hjia/wrlinux-20/lat_deb_061621/build-binary/tmp-glibc/work/x86_64-linux/umoci-native/0.4.6-r0/recipe-sysroot-native/usr/bin/umoci -h
> NAME:
> umoci - umoci modifies Open Container images
>
> USAGE:
> umoci [global options] command [command options] [arguments...]
>
> VERSION:
> unknown
>
> AUTHOR:
> Aleksa Sarai <asarai@suse.com>
>
> COMMANDS:
> raw advanced internal image tooling
> help, h Shows a list of commands or help for one command
>
> image:
> config modifies the image configuration of an OCI image
> unpack unpacks a reference into an OCI runtime bundle
> repack repacks an OCI runtime bundle into a reference
> new creates a blank tagged OCI image
> tag creates a new tag in an OCI image
> remove, rm removes a tag from an OCI image
> stat displays status information of an image manifest
> insert insert content into an OCI image
>
> layout:
> gc garbage-collects an OCI image's blobs
> init create a new OCI layout
> list, ls lists the set of tags in an OCI layout
>
> GLOBAL OPTIONS:
> --verbose alias for --log=info
> --log value set the log level (debug, info, [warn], error, fatal) (default: "warn")
> --help, -h show help
> --version, -v print the version
>
> ...
>
> //Hongxu
>
> - # so the common install can find our binary
> - cp umoci.static umoci
> -}
> -
> -do_compile() {
> - export GOARCH="${TARGET_GOARCH}"
> - export GOPATH="${WORKDIR}/git/"
> -
> - # Pass the needed cflags/ldflags so that cgo
> - # can find the needed headers files and libraries
> - export CGO_ENABLED="1"
> - export CFLAGS=""
> - export LDFLAGS=""
> - export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> - export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> -
> - export GO111MODULE=off
> -
> - cd ${S}
> -
> - oe_runmake umoci
> -}
> -
> -do_install() {
> - install -d ${D}/${sbindir}
> - install ${S}/umoci ${D}/${sbindir}
> -}
> -
> -INSANE_SKIP_${PN} += "ldflags already-stripped"
> +INSANE_SKIP_${PN}-dev += "file-rdeps"
> +INSANE_SKIP_${PN} += "already-stripped"
> BBCLASSEXTEND = "native nativesdk"
>
>
>
>
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [meta-virtualization][PATCH] umoci: rework recipe
[not found] ` <168DFAA59EFCBE06.30759@lists.yoctoproject.org>
@ 2021-07-02 13:12 ` Bruce Ashfield
0 siblings, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2021-07-02 13:12 UTC (permalink / raw)
To: Bruce Ashfield; +Cc: Hongxu Jia, meta-virtualization
On Fri, Jul 2, 2021 at 8:57 AM Bruce Ashfield via
lists.yoctoproject.org
<bruce.ashfield=gmail.com@lists.yoctoproject.org> wrote:
>
> On Fri, Jul 2, 2021 at 3:59 AM Hongxu Jia <hongxu.jia@windriver.com> wrote:
> >
> > 1. tweak homepage
> >
> > 2. Use go_do_compile of go bbclass in oe-core to replace
> > the do_compile in recipe, variables such as LD,CC,
> > CFLAGS, CGO_CFLAGS will be set automatically
> >
> > 3. Use go_do_install of go bbclass in oe-core to replace
> > the do_install in recipe, all necessary will be installed
> >
> > 4. export GO111MODULE=off globally
> >
> > 5. Skip file-rdeps insane for umoci dev packages since scripts
> > in umoci dev packages contains awk, bash shebang
> >
>
> Hmm. no. We need to keep all of the local parts of this recipe, it
> needs to stay somewhat the bbclasses in oe-core, due to the way it
> changes over time.
>
> What we have works, and I'll leave it as-is.
I should add that there is a middle ground.
Leave the source layout as-is, and the explicit compile/install
routines in place. If there are some variables that can now safely
take defaults from the bbclass, we can use those. But dropping the
recipe structure as it stands, and using the default routines (which
have lost me days and weeks of time over the years), isn't going to
make it into the tree as-is.
Bruce
>
> cheers,
>
> Bruce
>
> > Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> > ---
> > recipes-containers/umoci/umoci_git.bb | 75 ++++-----------------------
> > 1 file changed, 10 insertions(+), 65 deletions(-)
> >
> > diff --git a/recipes-containers/umoci/umoci_git.bb b/recipes-containers/umoci/umoci_git.bb
> > index f83a35a7..c4007eb3 100644
> > --- a/recipes-containers/umoci/umoci_git.bb
> > +++ b/recipes-containers/umoci/umoci_git.bb
> > @@ -1,80 +1,25 @@
> > -HOMEPAGE = "https://github.com/openSUSE/umoci"
> > +HOMEPAGE = "https://umo.ci"
> > SUMMARY = "umoci modifies Open Container images"
> > LICENSE = "Apache-2.0"
> > -LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
> > +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
> >
> > RDEPENDS_${PN} = "skopeo"
> > RDEPENDS_${PN}_class-native = ""
> >
> > -SRCREV_umoci = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> > -SRC_URI = "git://github.com/opencontainers/umoci.git;branch=master;name=umoci;destsuffix=github.com/opencontainers/umoci \
> > - "
> > +SRCREV = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> > +SRC_URI = " \
> > + git://${GO_IMPORT}; \
> > +"
> >
> > PV = "v0.4.7-dev+git${SRCPV}"
> > -S = "${WORKDIR}/github.com/opencontainers/umoci"
> > +S = "${WORKDIR}/git"
> > GO_IMPORT = "github.com/opencontainers/umoci"
> >
> > inherit goarch
> > inherit go
> >
> > -# This disables seccomp and apparmor, which are on by default in the
> > -# go package.
> > -EXTRA_OEMAKE="BUILDTAGS=''"
> > +export GO111MODULE="off"
> >
> > -
> > -do_compile_class-native () {
> > - export GOARCH="${BUILD_GOARCH}"
> > -
> > - # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
> > - export CGO_ENABLED="1"
> > - export CFLAGS="${BUILD_CFLAGS}"
> > - export LDFLAGS="${BUILD_LDFLAGS}"
> > - export CGO_CFLAGS="${BUILD_CFLAGS}"
> > -
> > - # as of go 1.15.5, there are some flags the CGO doesn't like. Rather than
> > - # clearing them all, we sed away the ones we don't want.
> > - # export CGO_LDFLAGS="$(echo ${BUILD_LDFLAGS} | sed 's/-Wl,-O1//g' | sed 's/-Wl,--dynamic-linker.*?( \|$\)//g')"
> > - export CC="${BUILD_CC}"
> > - export LD="${BUILD_LD}"
> > -
> > - export GOPATH="${WORKDIR}/git/"
> > - export GO111MODULE=off
> > -
> > - cd ${S}
> > -
> > - # why static ? patchelf will be run on dynamic binaries and it breaks
> > - # the executable (coredump)
> > - # https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
> > - # https://github.com/NixOS/patchelf/issues/146
> > - oe_runmake umoci.static
> > -
> > - # so the common install can find our binary
> > - cp umoci.static umoci
> > -}
> > -
> > -do_compile() {
> > - export GOARCH="${TARGET_GOARCH}"
> > - export GOPATH="${WORKDIR}/git/"
> > -
> > - # Pass the needed cflags/ldflags so that cgo
> > - # can find the needed headers files and libraries
> > - export CGO_ENABLED="1"
> > - export CFLAGS=""
> > - export LDFLAGS=""
> > - export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> > - export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> > -
> > - export GO111MODULE=off
> > -
> > - cd ${S}
> > -
> > - oe_runmake umoci
> > -}
> > -
> > -do_install() {
> > - install -d ${D}/${sbindir}
> > - install ${S}/umoci ${D}/${sbindir}
> > -}
> > -
> > -INSANE_SKIP_${PN} += "ldflags already-stripped"
> > +INSANE_SKIP_${PN}-dev += "file-rdeps"
> > +INSANE_SKIP_${PN} += "already-stripped"
> > BBCLASSEXTEND = "native nativesdk"
> > --
> > 2.27.0
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
>
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [meta-virtualization][PATCH] umoci: rework recipe
2021-07-02 7:59 hongxu
@ 2021-07-02 12:56 ` Bruce Ashfield
[not found] ` <168DFAA59EFCBE06.30759@lists.yoctoproject.org>
1 sibling, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2021-07-02 12:56 UTC (permalink / raw)
To: Hongxu Jia; +Cc: meta-virtualization
On Fri, Jul 2, 2021 at 3:59 AM Hongxu Jia <hongxu.jia@windriver.com> wrote:
>
> 1. tweak homepage
>
> 2. Use go_do_compile of go bbclass in oe-core to replace
> the do_compile in recipe, variables such as LD,CC,
> CFLAGS, CGO_CFLAGS will be set automatically
>
> 3. Use go_do_install of go bbclass in oe-core to replace
> the do_install in recipe, all necessary will be installed
>
> 4. export GO111MODULE=off globally
>
> 5. Skip file-rdeps insane for umoci dev packages since scripts
> in umoci dev packages contains awk, bash shebang
>
Hmm. no. We need to keep all of the local parts of this recipe, it
needs to stay somewhat the bbclasses in oe-core, due to the way it
changes over time.
What we have works, and I'll leave it as-is.
cheers,
Bruce
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> recipes-containers/umoci/umoci_git.bb | 75 ++++-----------------------
> 1 file changed, 10 insertions(+), 65 deletions(-)
>
> diff --git a/recipes-containers/umoci/umoci_git.bb b/recipes-containers/umoci/umoci_git.bb
> index f83a35a7..c4007eb3 100644
> --- a/recipes-containers/umoci/umoci_git.bb
> +++ b/recipes-containers/umoci/umoci_git.bb
> @@ -1,80 +1,25 @@
> -HOMEPAGE = "https://github.com/openSUSE/umoci"
> +HOMEPAGE = "https://umo.ci"
> SUMMARY = "umoci modifies Open Container images"
> LICENSE = "Apache-2.0"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
> +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
>
> RDEPENDS_${PN} = "skopeo"
> RDEPENDS_${PN}_class-native = ""
>
> -SRCREV_umoci = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> -SRC_URI = "git://github.com/opencontainers/umoci.git;branch=master;name=umoci;destsuffix=github.com/opencontainers/umoci \
> - "
> +SRCREV = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
> +SRC_URI = " \
> + git://${GO_IMPORT}; \
> +"
>
> PV = "v0.4.7-dev+git${SRCPV}"
> -S = "${WORKDIR}/github.com/opencontainers/umoci"
> +S = "${WORKDIR}/git"
> GO_IMPORT = "github.com/opencontainers/umoci"
>
> inherit goarch
> inherit go
>
> -# This disables seccomp and apparmor, which are on by default in the
> -# go package.
> -EXTRA_OEMAKE="BUILDTAGS=''"
> +export GO111MODULE="off"
>
> -
> -do_compile_class-native () {
> - export GOARCH="${BUILD_GOARCH}"
> -
> - # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
> - export CGO_ENABLED="1"
> - export CFLAGS="${BUILD_CFLAGS}"
> - export LDFLAGS="${BUILD_LDFLAGS}"
> - export CGO_CFLAGS="${BUILD_CFLAGS}"
> -
> - # as of go 1.15.5, there are some flags the CGO doesn't like. Rather than
> - # clearing them all, we sed away the ones we don't want.
> - # export CGO_LDFLAGS="$(echo ${BUILD_LDFLAGS} | sed 's/-Wl,-O1//g' | sed 's/-Wl,--dynamic-linker.*?( \|$\)//g')"
> - export CC="${BUILD_CC}"
> - export LD="${BUILD_LD}"
> -
> - export GOPATH="${WORKDIR}/git/"
> - export GO111MODULE=off
> -
> - cd ${S}
> -
> - # why static ? patchelf will be run on dynamic binaries and it breaks
> - # the executable (coredump)
> - # https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
> - # https://github.com/NixOS/patchelf/issues/146
> - oe_runmake umoci.static
> -
> - # so the common install can find our binary
> - cp umoci.static umoci
> -}
> -
> -do_compile() {
> - export GOARCH="${TARGET_GOARCH}"
> - export GOPATH="${WORKDIR}/git/"
> -
> - # Pass the needed cflags/ldflags so that cgo
> - # can find the needed headers files and libraries
> - export CGO_ENABLED="1"
> - export CFLAGS=""
> - export LDFLAGS=""
> - export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> - export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
> -
> - export GO111MODULE=off
> -
> - cd ${S}
> -
> - oe_runmake umoci
> -}
> -
> -do_install() {
> - install -d ${D}/${sbindir}
> - install ${S}/umoci ${D}/${sbindir}
> -}
> -
> -INSANE_SKIP_${PN} += "ldflags already-stripped"
> +INSANE_SKIP_${PN}-dev += "file-rdeps"
> +INSANE_SKIP_${PN} += "already-stripped"
> BBCLASSEXTEND = "native nativesdk"
> --
> 2.27.0
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
^ permalink raw reply [flat|nested] 5+ messages in thread
* [meta-virtualization][PATCH] umoci: rework recipe
@ 2021-07-02 7:59 hongxu
2021-07-02 12:56 ` Bruce Ashfield
[not found] ` <168DFAA59EFCBE06.30759@lists.yoctoproject.org>
0 siblings, 2 replies; 5+ messages in thread
From: hongxu @ 2021-07-02 7:59 UTC (permalink / raw)
To: meta-virtualization, bruce.ashfield
1. tweak homepage
2. Use go_do_compile of go bbclass in oe-core to replace
the do_compile in recipe, variables such as LD,CC,
CFLAGS, CGO_CFLAGS will be set automatically
3. Use go_do_install of go bbclass in oe-core to replace
the do_install in recipe, all necessary will be installed
4. export GO111MODULE=off globally
5. Skip file-rdeps insane for umoci dev packages since scripts
in umoci dev packages contains awk, bash shebang
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
recipes-containers/umoci/umoci_git.bb | 75 ++++-----------------------
1 file changed, 10 insertions(+), 65 deletions(-)
diff --git a/recipes-containers/umoci/umoci_git.bb b/recipes-containers/umoci/umoci_git.bb
index f83a35a7..c4007eb3 100644
--- a/recipes-containers/umoci/umoci_git.bb
+++ b/recipes-containers/umoci/umoci_git.bb
@@ -1,80 +1,25 @@
-HOMEPAGE = "https://github.com/openSUSE/umoci"
+HOMEPAGE = "https://umo.ci"
SUMMARY = "umoci modifies Open Container images"
LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
+LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
RDEPENDS_${PN} = "skopeo"
RDEPENDS_${PN}_class-native = ""
-SRCREV_umoci = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
-SRC_URI = "git://github.com/opencontainers/umoci.git;branch=master;name=umoci;destsuffix=github.com/opencontainers/umoci \
- "
+SRCREV = "758044fc26ad65eb900143e90d1e22c2d6e4484d"
+SRC_URI = " \
+ git://${GO_IMPORT}; \
+"
PV = "v0.4.7-dev+git${SRCPV}"
-S = "${WORKDIR}/github.com/opencontainers/umoci"
+S = "${WORKDIR}/git"
GO_IMPORT = "github.com/opencontainers/umoci"
inherit goarch
inherit go
-# This disables seccomp and apparmor, which are on by default in the
-# go package.
-EXTRA_OEMAKE="BUILDTAGS=''"
+export GO111MODULE="off"
-
-do_compile_class-native () {
- export GOARCH="${BUILD_GOARCH}"
-
- # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
- export CGO_ENABLED="1"
- export CFLAGS="${BUILD_CFLAGS}"
- export LDFLAGS="${BUILD_LDFLAGS}"
- export CGO_CFLAGS="${BUILD_CFLAGS}"
-
- # as of go 1.15.5, there are some flags the CGO doesn't like. Rather than
- # clearing them all, we sed away the ones we don't want.
- # export CGO_LDFLAGS="$(echo ${BUILD_LDFLAGS} | sed 's/-Wl,-O1//g' | sed 's/-Wl,--dynamic-linker.*?( \|$\)//g')"
- export CC="${BUILD_CC}"
- export LD="${BUILD_LD}"
-
- export GOPATH="${WORKDIR}/git/"
- export GO111MODULE=off
-
- cd ${S}
-
- # why static ? patchelf will be run on dynamic binaries and it breaks
- # the executable (coredump)
- # https://forum.snapcraft.io/t/patchelf-broke-my-binary/4928
- # https://github.com/NixOS/patchelf/issues/146
- oe_runmake umoci.static
-
- # so the common install can find our binary
- cp umoci.static umoci
-}
-
-do_compile() {
- export GOARCH="${TARGET_GOARCH}"
- export GOPATH="${WORKDIR}/git/"
-
- # Pass the needed cflags/ldflags so that cgo
- # can find the needed headers files and libraries
- export CGO_ENABLED="1"
- export CFLAGS=""
- export LDFLAGS=""
- export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
- export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-
- export GO111MODULE=off
-
- cd ${S}
-
- oe_runmake umoci
-}
-
-do_install() {
- install -d ${D}/${sbindir}
- install ${S}/umoci ${D}/${sbindir}
-}
-
-INSANE_SKIP_${PN} += "ldflags already-stripped"
+INSANE_SKIP_${PN}-dev += "file-rdeps"
+INSANE_SKIP_${PN} += "already-stripped"
BBCLASSEXTEND = "native nativesdk"
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-07-02 13:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <168DEA6BA6D7C3F7.26864@lists.yoctoproject.org>
2021-07-02 8:11 ` [meta-virtualization][PATCH] umoci: rework recipe hongxu
2021-07-02 13:23 ` Bruce Ashfield
2021-07-02 7:59 hongxu
2021-07-02 12:56 ` Bruce Ashfield
[not found] ` <168DFAA59EFCBE06.30759@lists.yoctoproject.org>
2021-07-02 13:12 ` Bruce Ashfield
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.