Re: [OE-core] [PATCH] oeqa: sdk: basic go toolchain test support

2021-06-04 Thread Peter Morrow
On Thu, May 20, 2021 at 02:57:26PM +0100, Richard Purdie wrote:
> On Thu, 2021-05-20 at 12:27 +0100, Richard Purdie via lists.openembedded.org 
> wrote:
> > On Tue, 2021-05-18 at 06:05 -0700, Peter Morrow wrote:
> > > Add a simple build test for the golang toolchain which is produced into a 
> > > SDK.
> > > 
> > > Signed-off-by: Peter Morrow 
> > > ---
> > >  meta/lib/oeqa/sdk/cases/go.py   | 34 ++
> > >  meta/lib/oeqa/sdk/files/test.go |  7 +++
> > >  2 files changed, 41 insertions(+)
> > >  create mode 100644 meta/lib/oeqa/sdk/cases/go.py
> > >  create mode 100644 meta/lib/oeqa/sdk/files/test.go
> > > 
> > > diff --git a/meta/lib/oeqa/sdk/cases/go.py b/meta/lib/oeqa/sdk/cases/go.py
> > > new file mode 100644
> > > index 000..1af5516
> > > --- /dev/null
> > > +++ b/meta/lib/oeqa/sdk/cases/go.py
> > > @@ -0,0 +1,34 @@
> > > +#
> > > +# SPDX-License-Identifier: MIT
> > > +#
> > > +
> > > +import os
> > > +import shutil
> > > +import unittest
> > > +
> > > +from oeqa.core.utils.path import remove_safe
> > > +from oeqa.sdk.case import OESDKTestCase
> > > +
> > > +from oeqa.utils.subprocesstweak import errors_have_output
> > > +errors_have_output()
> > > +
> > > +class GoCompileTest(OESDKTestCase):
> > > +@classmethod
> > > +def setUpClass(self):
> > > +files = {'test.go' : self.tc.files_dir}
> > > +for f in files:
> > > +shutil.copyfile(os.path.join(files[f], f),
> > > +os.path.join(self.tc.sdk_dir, f))
> > > +
> > > +def setUp(self):
> > > +if not self.tc.hasHostPackage("^nativesdk-go", regex=True):
> > > +raise unittest.SkipTest("GoCompileTest class: SDK doesn't 
> > > contain a golang toolchain")
> > > +
> > > +def test_go_compile(self):
> > > +self._run('go build -o %s/test %s/test.go' % (self.tc.sdk_dir, 
> > > self.tc.sdk_dir))
> > > +
> > > +@classmethod
> > > +def tearDownClass(self):
> > > +files = [os.path.join(self.tc.sdk_dir, f) for f in ['test.go', 
> > > 'test']]
> > > +for f in files:
> > > +remove_safe(f)
> > > diff --git a/meta/lib/oeqa/sdk/files/test.go 
> > > b/meta/lib/oeqa/sdk/files/test.go
> > > new file mode 100644
> > > index 000..089f721
> > > --- /dev/null
> > > +++ b/meta/lib/oeqa/sdk/files/test.go
> > > @@ -0,0 +1,7 @@
> > > +package main
> > > +
> > > +import "fmt"
> > > +
> > > +func main() {
> > > +fmt.Println("hello world!")
> > > +}
> > 
> > I'd love to add something like this but adding it triggered a lot of errors
> > in our automated QA:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/2169
> > 
> 
> The autobuilder output isn't helpful to debug. I looked in and grabbed some 
> of a logfile:
> 
> NOTE: ==
> NOTE: ERROR: setUpClass (go.GoCompileTest)
> NOTE: --
> NOTE: Traceback (most recent call last):
>   File 
> "/home/pokybuild/yocto-worker/genericx86-64/build/meta/lib/oeqa/core/case.py",
>  line 39, in _oeSetUpClass
> clss.setUpClassMethod()
>   File 
> "/home/pokybuild/yocto-worker/genericx86-64/build/meta/lib/oeqa/sdk/cases/go.py",
>  line 20, in setUpClass
> shutil.copyfile(os.path.join(files[f], f),
>   File "/usr/lib64/python3.8/shutil.py", line 264, in copyfile
> with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
> FileNotFoundError: [Errno 2] No such file or directory: 
> '/home/pokybuild/yocto-worker/genericx86-64/build/meta/lib/oeqa/files/test.go'
> 
> NOTE: --

Hi Richard,

I can't seem to recreate this problem locally, I've built both
core-image-sato and core-image-minimal and both seem to pass the sdktest
suite with no problems such as above.

SDK testing environment: core2-64-poky-linux
GoCompileTest class: SDK doesn't contain a golang toolchain
No python package in the SDK
RESULTS:
RESULTS - assimp.BuildAssimp.test_assimp: PASSED (275.54s)
RESULTS - buildcpio.BuildCpioTest.test_cpio: PASSED (27.66s)
RESULTS - buildepoxy.EpoxyTest.test_epoxy: PASSED (15.31s)
RE

Re: [OE-core] [PATCH] oeqa: sdk: basic go toolchain test support

2021-05-25 Thread Peter Morrow
On Thu, May 20, 2021 at 02:57:26PM +0100, Richard Purdie wrote:
> On Thu, 2021-05-20 at 12:27 +0100, Richard Purdie via lists.openembedded.org 
> wrote:
> > On Tue, 2021-05-18 at 06:05 -0700, Peter Morrow wrote:
> > > Add a simple build test for the golang toolchain which is produced into a 
> > > SDK.
> > > 
> > > Signed-off-by: Peter Morrow 
> > > ---
> > >  meta/lib/oeqa/sdk/cases/go.py   | 34 ++
> > >  meta/lib/oeqa/sdk/files/test.go |  7 +++
> > >  2 files changed, 41 insertions(+)
> > >  create mode 100644 meta/lib/oeqa/sdk/cases/go.py
> > >  create mode 100644 meta/lib/oeqa/sdk/files/test.go
> > > 
> > > diff --git a/meta/lib/oeqa/sdk/cases/go.py b/meta/lib/oeqa/sdk/cases/go.py
> > > new file mode 100644
> > > index 000..1af5516
> > > --- /dev/null
> > > +++ b/meta/lib/oeqa/sdk/cases/go.py
> > > @@ -0,0 +1,34 @@
> > > +#
> > > +# SPDX-License-Identifier: MIT
> > > +#
> > > +
> > > +import os
> > > +import shutil
> > > +import unittest
> > > +
> > > +from oeqa.core.utils.path import remove_safe
> > > +from oeqa.sdk.case import OESDKTestCase
> > > +
> > > +from oeqa.utils.subprocesstweak import errors_have_output
> > > +errors_have_output()
> > > +
> > > +class GoCompileTest(OESDKTestCase):
> > > +@classmethod
> > > +def setUpClass(self):
> > > +files = {'test.go' : self.tc.files_dir}
> > > +for f in files:
> > > +shutil.copyfile(os.path.join(files[f], f),
> > > +os.path.join(self.tc.sdk_dir, f))
> > > +
> > > +def setUp(self):
> > > +if not self.tc.hasHostPackage("^nativesdk-go", regex=True):
> > > +raise unittest.SkipTest("GoCompileTest class: SDK doesn't 
> > > contain a golang toolchain")
> > > +
> > > +def test_go_compile(self):
> > > +self._run('go build -o %s/test %s/test.go' % (self.tc.sdk_dir, 
> > > self.tc.sdk_dir))
> > > +
> > > +@classmethod
> > > +def tearDownClass(self):
> > > +files = [os.path.join(self.tc.sdk_dir, f) for f in ['test.go', 
> > > 'test']]
> > > +for f in files:
> > > +remove_safe(f)
> > > diff --git a/meta/lib/oeqa/sdk/files/test.go 
> > > b/meta/lib/oeqa/sdk/files/test.go
> > > new file mode 100644
> > > index 000..089f721
> > > --- /dev/null
> > > +++ b/meta/lib/oeqa/sdk/files/test.go
> > > @@ -0,0 +1,7 @@
> > > +package main
> > > +
> > > +import "fmt"
> > > +
> > > +func main() {
> > > +fmt.Println("hello world!")
> > > +}
> > 
> > I'd love to add something like this but adding it triggered a lot of errors
> > in our automated QA:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/2169
> > 
> 
> The autobuilder output isn't helpful to debug. I looked in and grabbed some 
> of a logfile:
> 
> NOTE: ==
> NOTE: ERROR: setUpClass (go.GoCompileTest)
> NOTE: --
> NOTE: Traceback (most recent call last):
>   File 
> "/home/pokybuild/yocto-worker/genericx86-64/build/meta/lib/oeqa/core/case.py",
>  line 39, in _oeSetUpClass
> clss.setUpClassMethod()
>   File 
> "/home/pokybuild/yocto-worker/genericx86-64/build/meta/lib/oeqa/sdk/cases/go.py",
>  line 20, in setUpClass
> shutil.copyfile(os.path.join(files[f], f),
>   File "/usr/lib64/python3.8/shutil.py", line 264, in copyfile
> with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
> FileNotFoundError: [Errno 2] No such file or directory: 
> '/home/pokybuild/yocto-worker/genericx86-64/build/meta/lib/oeqa/files/test.go'
> 
> NOTE: --

Thanks Richard,

I'll take a look into these failures (which I didn't see when testing
locally) and will hopefully come back with a V2 shortly.

Peter.


> 
> 
> Cheers,
> 
> Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#152210): 
https://lists.openembedded.org/g/openembedded-core/message/152210
Mute This Topic: https://lists.openembedded.org/mt/82910985/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] oeqa: sdk: basic go toolchain test support

2021-05-18 Thread Peter Morrow
Add a simple build test for the golang toolchain which is produced into a SDK.

Signed-off-by: Peter Morrow 
---
 meta/lib/oeqa/sdk/cases/go.py   | 34 ++
 meta/lib/oeqa/sdk/files/test.go |  7 +++
 2 files changed, 41 insertions(+)
 create mode 100644 meta/lib/oeqa/sdk/cases/go.py
 create mode 100644 meta/lib/oeqa/sdk/files/test.go

diff --git a/meta/lib/oeqa/sdk/cases/go.py b/meta/lib/oeqa/sdk/cases/go.py
new file mode 100644
index 000..1af5516
--- /dev/null
+++ b/meta/lib/oeqa/sdk/cases/go.py
@@ -0,0 +1,34 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
+import os
+import shutil
+import unittest
+
+from oeqa.core.utils.path import remove_safe
+from oeqa.sdk.case import OESDKTestCase
+
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
+class GoCompileTest(OESDKTestCase):
+@classmethod
+def setUpClass(self):
+files = {'test.go' : self.tc.files_dir}
+for f in files:
+shutil.copyfile(os.path.join(files[f], f),
+os.path.join(self.tc.sdk_dir, f))
+
+def setUp(self):
+if not self.tc.hasHostPackage("^nativesdk-go", regex=True):
+raise unittest.SkipTest("GoCompileTest class: SDK doesn't contain 
a golang toolchain")
+
+def test_go_compile(self):
+self._run('go build -o %s/test %s/test.go' % (self.tc.sdk_dir, 
self.tc.sdk_dir))
+
+@classmethod
+def tearDownClass(self):
+files = [os.path.join(self.tc.sdk_dir, f) for f in ['test.go', 'test']]
+for f in files:
+remove_safe(f)
diff --git a/meta/lib/oeqa/sdk/files/test.go b/meta/lib/oeqa/sdk/files/test.go
new file mode 100644
index 000..089f721
--- /dev/null
+++ b/meta/lib/oeqa/sdk/files/test.go
@@ -0,0 +1,7 @@
+package main
+
+import "fmt"
+
+func main() {
+fmt.Println("hello world!")
+}
-- 
1.8.3.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#152032): 
https://lists.openembedded.org/g/openembedded-core/message/152032
Mute This Topic: https://lists.openembedded.org/mt/82910985/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [dunfell][PATCH 1/2] goarch: map target os to windows for mingw* TARGET_OS

2021-04-09 Thread Peter Morrow
On Tue, Apr 06, 2021 at 08:21:59AM -0700, Khem Raj wrote:
> Lgtm

Thanks Khem!

Peter.


> 
> On Tue, Apr 6, 2021 at 6:08 AM Peter Morrow 
> wrote:
> 
> > mingw32/mingw64 is not a supported value for GOOS, so map from 'mingw*' to
> > 'windows' to enable building for windows targets.
> >
> > Signed-off-by: Peter Morrow 
> > ---
> >  meta/classes/goarch.bbclass | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
> > index 1099b95..ecd3044 100644
> > --- a/meta/classes/goarch.bbclass
> > +++ b/meta/classes/goarch.bbclass
> > @@ -114,6 +114,8 @@ def go_map_mips(a, f, d):
> >  def go_map_os(o, d):
> >  if o.startswith('linux'):
> >  return 'linux'
> > +elif o.startswith('mingw'):
> > +return 'windows'
> >  return o
> >
> >
> > --
> > 1.8.3.1
> >
> >

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150334): 
https://lists.openembedded.org/g/openembedded-core/message/150334
Mute This Topic: https://lists.openembedded.org/mt/81888702/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [meta-mingw][PATCH] go: add environment setup batch file for go

2021-04-07 Thread Peter Morrow
On Wed, Apr 07, 2021 at 07:56:01AM -0500, Joshua Watt wrote:
> On Wed, Apr 7, 2021 at 5:31 AM Peter Morrow
>  wrote:
> >
> > When building the nativesdk for mingw we need to set GOROOT in order to 
> > build
> > anything out of the box.
> >
> > Signed-off-by: Peter Morrow 
> > ---
> >  recipes-devtools/go/go_%.bbappend | 9 +
> >  1 file changed, 9 insertions(+)
> >  create mode 100644 recipes-devtools/go/go_%.bbappend
> >
> > diff --git a/recipes-devtools/go/go_%.bbappend 
> > b/recipes-devtools/go/go_%.bbappend
> > new file mode 100644
> > index 000..9933108
> > --- /dev/null
> > +++ b/recipes-devtools/go/go_%.bbappend
> > @@ -0,0 +1,9 @@
> > +do_install_append_class-nativesdk_mingw32() {
> > +install -d ${D}${SDKPATHNATIVE}/environment-setup.d
> > +
> > +cat < ${D}${SDKPATHNATIVE}/environment-setup.d/go.bat
> > +set GOROOT=%OECORE_NATIVE_SYSROOT%\\usr\\lib\\${BPN}
> > +EOF
> > +}
> > +
> > +FILES_${PN}_append_class-nativesdk_mingw32 = " 
> > ${SDKPATHNATIVE}/environment-setup.d"
> > --
> > 1.8.3.1
> >
> 
> I've put this patch in master-next oe meta-mingw. This is the wrong
> mailing list for these patches, please use
> yo...@lists.yoctoproject.org time.

Thanks, noted.

Peter.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150269): 
https://lists.openembedded.org/g/openembedded-core/message/150269
Mute This Topic: https://lists.openembedded.org/mt/81912228/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [meta-mingw][PATCH] go: add environment setup batch file for go

2021-04-07 Thread Peter Morrow
When building the nativesdk for mingw we need to set GOROOT in order to build
anything out of the box.

Signed-off-by: Peter Morrow 
---
 recipes-devtools/go/go_%.bbappend | 9 +
 1 file changed, 9 insertions(+)
 create mode 100644 recipes-devtools/go/go_%.bbappend

diff --git a/recipes-devtools/go/go_%.bbappend 
b/recipes-devtools/go/go_%.bbappend
new file mode 100644
index 000..9933108
--- /dev/null
+++ b/recipes-devtools/go/go_%.bbappend
@@ -0,0 +1,9 @@
+do_install_append_class-nativesdk_mingw32() {
+install -d ${D}${SDKPATHNATIVE}/environment-setup.d
+
+cat < ${D}${SDKPATHNATIVE}/environment-setup.d/go.bat
+set GOROOT=%OECORE_NATIVE_SYSROOT%\\usr\\lib\\${BPN}
+EOF
+}
+
+FILES_${PN}_append_class-nativesdk_mingw32 = " 
${SDKPATHNATIVE}/environment-setup.d"
-- 
1.8.3.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150262): 
https://lists.openembedded.org/g/openembedded-core/message/150262
Mute This Topic: https://lists.openembedded.org/mt/81912228/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [dunfell][PATCH 1/2] goarch: map target os to windows for mingw* TARGET_OS

2021-04-06 Thread Peter Morrow
mingw32/mingw64 is not a supported value for GOOS, so map from 'mingw*' to
'windows' to enable building for windows targets.

Signed-off-by: Peter Morrow 
---
 meta/classes/goarch.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 1099b95..ecd3044 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -114,6 +114,8 @@ def go_map_mips(a, f, d):
 def go_map_os(o, d):
 if o.startswith('linux'):
 return 'linux'
+elif o.startswith('mingw'):
+return 'windows'
 return o
 
 
-- 
1.8.3.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150242): 
https://lists.openembedded.org/g/openembedded-core/message/150242
Mute This Topic: https://lists.openembedded.org/mt/81888702/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [dunfell][PATCH 2/2] go_1.14: don't set -buildmode=pie when building for windows targets

2021-04-06 Thread Peter Morrow
go 1.14 for windows targets does not support -buildmode=pie, disable it and use
the default buildmode instead. Support for -buildmode=pie for windows targets
is added with go 1.15 (https://golang.org/doc/go1.15) which is added to poky in
gatesgarth.

Signed-off-by: Peter Morrow 
---
 meta/classes/go.bbclass | 8 
 meta/recipes-devtools/go/go_1.14.bb | 8 
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a9e31b5..8ff482b 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -144,11 +144,11 @@ FILES_${PN}-staticdev = "${libdir}/go/pkg"
 
 INSANE_SKIP_${PN} += "ldflags"
 
-# Add -buildmode=pie to GOBUILDFLAGS to satisfy "textrel" QA checking, but mips
-# doesn't support -buildmode=pie, so skip the QA checking for mips and its
-# variants.
+# Add -buildmode=pie to GOBUILDFLAGS to satisfy "textrel" QA checking, but
+# windows/mips/riscv doesn't support -buildmode=pie, so skip the QA checking
+# for windows/mips/riscv and their variants.
 python() {
-if 'mips' in d.getVar('TARGET_ARCH') or 'riscv' in d.getVar('TARGET_ARCH'):
+if 'mips' in d.getVar('TARGET_ARCH') or 'riscv' in d.getVar('TARGET_ARCH') 
or 'windows' in d.getVar('TARGET_GOOS'):
 d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel")
 else:
 d.appendVar('GOBUILDFLAGS', ' -buildmode=pie')
diff --git a/meta/recipes-devtools/go/go_1.14.bb 
b/meta/recipes-devtools/go/go_1.14.bb
index bc90a13..c175279 100644
--- a/meta/recipes-devtools/go/go_1.14.bb
+++ b/meta/recipes-devtools/go/go_1.14.bb
@@ -3,11 +3,11 @@ require go-target.inc
 
 export GOBUILDMODE=""
 export CGO_ENABLED_riscv64 = ""
-# Add pie to GOBUILDMODE to satisfy "textrel" QA checking, but mips/riscv
-# doesn't support -buildmode=pie, so skip the QA checking for mips/riscv and 
its
-# variants.
+# Add pie to GOBUILDMODE to satisfy "textrel" QA checking, but
+# windows/mips/riscv doesn't support -buildmode=pie, so skip the QA checking
+# for windows/mips/riscv and their variants.
 python() {
-if 'mips' in d.getVar('TARGET_ARCH',True) or 'riscv' in 
d.getVar('TARGET_ARCH',True):
+if 'mips' in d.getVar('TARGET_ARCH',True) or 'riscv' in 
d.getVar('TARGET_ARCH',True) or 'windows' in d.getVar('TARGET_GOOS', True):
 d.appendVar('INSANE_SKIP_%s' % d.getVar('PN',True), " textrel")
 else:
 d.setVar('GOBUILDMODE', 'pie')
-- 
1.8.3.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150243): 
https://lists.openembedded.org/g/openembedded-core/message/150243
Mute This Topic: https://lists.openembedded.org/mt/81888703/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v3] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

2020-09-14 Thread Peter Morrow
The default compression algorithm is currently gzip, this patch allows the
default to be changed by setting SQUASHFS_TOOLS_COMP_DEFAULT to a valid
compression algorithm.

Signed-off-by: Peter Morrow 
---
 meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb 
b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
index b06951d..42fae28 100644
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -25,6 +25,9 @@ PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr"
 PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd"
 PACKAGECONFIG[reproducible] = "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0,"
 
+SQUASHFS_TOOLS_COMP_DEFAULT ?= "gzip"
+EXTRA_OEMAKE += "COMP_DEFAULT=${SQUASHFS_TOOLS_COMP_DEFAULT}"
+
 do_compile() {
oe_runmake all
 }
-- 
1.8.3.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142501): 
https://lists.openembedded.org/g/openembedded-core/message/142501
Mute This Topic: https://lists.openembedded.org/mt/76838796/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH v2] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

2020-09-14 Thread Peter Morrow
On Fri, Sep 11, 2020 at 10:04:00PM -0700, Khem Raj wrote:
> 
> 
> On 9/11/20 10:33 AM, Andre McCurdy wrote:
> > On Fri, Sep 11, 2020 at 10:21 AM Peter Morrow
> >  wrote:
> >>
> >> The default compression algorithm is gzip, this patch allows the default
> >> to be changed via a bbappend file by setting SQUASHFS_TOOLS_COMP_DEFAULT
> >> to a valid compression algorithm.
> >>
> >> Signed-off-by: Peter Morrow 
> >> ---
> >>  ...ols-Allow-COMP_DEFAULT-to-be-overridden-v.patch | 34 
> >> ++
> >>  .../squashfs-tools/squashfs-tools_git.bb   |  4 +++
> >>  2 files changed, 38 insertions(+)
> >>  create mode 100644 
> >> meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> >>
> >> diff --git 
> >> a/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> >>  
> >> b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> >> new file mode 100644
> >> index 000..5f12c42
> >> --- /dev/null
> >> +++ 
> >> b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> >> @@ -0,0 +1,34 @@
> >> +From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
> >> +From: Peter Morrow 
> >> +Date: Fri, 4 Sep 2020 15:43:15 +0100
> >> +Subject: [PATCH] squashfs-tools: Allow COMP_DEFAULT to be overridden via 
> >> make
> >> + cmdline
> >> +
> >> +Currently the only way to modify the default compression algorithm is to
> >> +modify the Makefile. It is useful to be able to set the default 
> >> compression
> >> +algorithm via the make command line since otherwise a build time search
> >> +replace operation needs to be performed on the Makefile.
> > 
> > That's not how Makefiles normally work. Options set via the command
> > line over-ride variables set with = in the Makefile.
> > 
> > Does setting your chosen value for COMP_DEFAULT on the make command
> > line really not work?
> 
> that works if make is invoked with -e option, We do not use make -e with
> bare makefile based recipes.
> 
> > 
> >> +Upstream-Status: Submitted 
> >> [https://github.com/plougher/squashfs-tools/pull/93 ]
> >> +
> >> +Signed-off-by: Peter Morrow 
> >> +---
> >> + squashfs-tools/Makefile | 2 +-
> >> + 1 file changed, 1 insertion(+), 1 deletion(-)
> >> +
> >> +diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile
> >> +index aee4b96..7425605 100644
> >> +--- a/squashfs-tools/Makefile
> >>  b/squashfs-tools/Makefile
> >> +@@ -85,7 +85,7 @@ GZIP_SUPPORT = 1
> >> + # in Mksquashfs.  Obviously the compression algorithm must have been
> >> + # selected to be built
> >> + #
> >> +-COMP_DEFAULT = gzip
> >> ++COMP_DEFAULT ?= gzip
> >> +
> >> +
> >> + ###
> >> +--
> >> +2.20.1
> >> +
> >> diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb 
> >> b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> >> index b06951d..df025d4 100644
> >> --- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> >> +++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
> >> @@ -9,6 +9,7 @@ PV = "4.4"
> >>  SRCREV = "52eb4c279cd283ed9802dd1ceb686560b22ffb67"
> >>  SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \
> >> 
> >> file://0001-squashfs-tools-fix-build-failure-against-gcc-10.patch;striplevel=2
> >>  \
> >> +   
> >> file://0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch;striplevel=2
> >>  \
> >>  "
> >>
> >>  S = "${WORKDIR}/git/squashfs-tools"
> >> @@ -25,6 +26,9 @@ PACKAGECONFIG[xattr] = 
> >> "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr"
> >>  PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd"
> >>  PACKAGECONFIG[reproducible] = 
> >> "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0,"
> >>
> >> +SQUASHFS_TOOLS_COMP_DEFAULT ?= "gzip"
> >> +EXTRA_OEMAKE += "COMP_DEFAULT=${SQUASHFS_TOOLS_COMP_DEFAULT}"
> > 
> > Note that this will force the recipe's default value even if upstream
> > squashfs-tools changes. Not a problem now as the two are the same, but
> > something which will need to be checked each time squashfs-tools is
> > updated.

Yep, good point. I covered this in V1, though have not covered it in V3.
I'm happy to add something to cover this in a V4 if you'd like?

Thanks,
Peter.

> > 
> >>  do_compile() {
> >> oe_runmake all
> >>  }
> >> --
> >> 1.8.3.1
> >>
> >>
> >>
> >> 

> pub  1024D/919D3314 2009-08-28 Khem Raj 
> sub  4096g/7CF5958F 2009-08-28

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142500): 
https://lists.openembedded.org/g/openembedded-core/message/142500
Mute This Topic: https://lists.openembedded.org/mt/76784587/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH v2] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

2020-09-14 Thread Peter Morrow
On Sat, Sep 12, 2020 at 12:37:28AM -0700, Khem Raj wrote:
> On Fri, Sep 11, 2020 at 11:36 PM Andre McCurdy  wrote:
> >
> > On Fri, Sep 11, 2020 at 10:04 PM Khem Raj  wrote:
> > >
> > >
> > >
> > > On 9/11/20 10:33 AM, Andre McCurdy wrote:
> > > > On Fri, Sep 11, 2020 at 10:21 AM Peter Morrow
> > > >  wrote:
> > > >>
> > > >> The default compression algorithm is gzip, this patch allows the 
> > > >> default
> > > >> to be changed via a bbappend file by setting 
> > > >> SQUASHFS_TOOLS_COMP_DEFAULT
> > > >> to a valid compression algorithm.
> > > >>
> > > >> Signed-off-by: Peter Morrow 
> > > >> ---
> > > >>  ...ols-Allow-COMP_DEFAULT-to-be-overridden-v.patch | 34 
> > > >> ++
> > > >>  .../squashfs-tools/squashfs-tools_git.bb   |  4 +++
> > > >>  2 files changed, 38 insertions(+)
> > > >>  create mode 100644 
> > > >> meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> > > >>
> > > >> diff --git 
> > > >> a/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> > > >>  
> > > >> b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> > > >> new file mode 100644
> > > >> index 000..5f12c42
> > > >> --- /dev/null
> > > >> +++ 
> > > >> b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
> > > >> @@ -0,0 +1,34 @@
> > > >> +From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
> > > >> +From: Peter Morrow 
> > > >> +Date: Fri, 4 Sep 2020 15:43:15 +0100
> > > >> +Subject: [PATCH] squashfs-tools: Allow COMP_DEFAULT to be overridden 
> > > >> via make
> > > >> + cmdline
> > > >> +
> > > >> +Currently the only way to modify the default compression algorithm is 
> > > >> to
> > > >> +modify the Makefile. It is useful to be able to set the default 
> > > >> compression
> > > >> +algorithm via the make command line since otherwise a build time 
> > > >> search
> > > >> +replace operation needs to be performed on the Makefile.
> > > >
> > > > That's not how Makefiles normally work. Options set via the command
> > > > line over-ride variables set with = in the Makefile.
> > > >
> > > > Does setting your chosen value for COMP_DEFAULT on the make command
> > > > line really not work?
> > >
> > > that works if make is invoked with -e option, We do not use make -e with
> > > bare makefile based recipes.
> >
> > The -e option is related to environment variables. It's not relevant
> > for this discussion - which is about setting options via the make
> > command line.
> >
> 
> I somehow oversaw the fact its being passed as make variable on
> cmdline  and not becoming
> an export. so you are right, I think we don't need the patch perhaps
> setting it via EXTRA_OEMAKE
> should suffice

Yes, not sure what I was thinking. I've tested again without the
squashfs-tools patch and setting via EXTRA_OEMAKE works as expected.

Thanks,
Peter.

> 
> > > >> +Upstream-Status: Submitted 
> > > >> [https://github.com/plougher/squashfs-tools/pull/93 ]
> > > >> +
> > > >> +Signed-off-by: Peter Morrow 
> > > >> +---
> > > >> + squashfs-tools/Makefile | 2 +-
> > > >> + 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >> +
> > > >> +diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile
> > > >> +index aee4b96..7425605 100644
> > > >> +--- a/squashfs-tools/Makefile
> > > >>  b/squashfs-tools/Makefile
> > > >> +@@ -85,7 +85,7 @@ GZIP_SUPPORT = 1
> > > >> + # in Mksquashfs.  Obviously the compression algorithm must have been
> > > >> + # selected to be built
> > > >> + #
> > > >> +-COMP_DEFAULT = gzip
> > > >> ++COMP_DEFAULT ?= gzip
> > > >> +
> > > >> +
> > > >> + ###
> > > >&g

[OE-core] [PATCH v2] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

2020-09-11 Thread Peter Morrow
The default compression algorithm is gzip, this patch allows the default
to be changed via a bbappend file by setting SQUASHFS_TOOLS_COMP_DEFAULT
to a valid compression algorithm.

Signed-off-by: Peter Morrow 
---
 ...ols-Allow-COMP_DEFAULT-to-be-overridden-v.patch | 34 ++
 .../squashfs-tools/squashfs-tools_git.bb   |  4 +++
 2 files changed, 38 insertions(+)
 create mode 100644 
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch

diff --git 
a/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
 
b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
new file mode 100644
index 000..5f12c42
--- /dev/null
+++ 
b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow 
+Date: Fri, 4 Sep 2020 15:43:15 +0100
+Subject: [PATCH] squashfs-tools: Allow COMP_DEFAULT to be overridden via make
+ cmdline
+
+Currently the only way to modify the default compression algorithm is to
+modify the Makefile. It is useful to be able to set the default compression
+algorithm via the make command line since otherwise a build time search
+replace operation needs to be performed on the Makefile.
+
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 
]
+
+Signed-off-by: Peter Morrow 
+---
+ squashfs-tools/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile
+index aee4b96..7425605 100644
+--- a/squashfs-tools/Makefile
 b/squashfs-tools/Makefile
+@@ -85,7 +85,7 @@ GZIP_SUPPORT = 1
+ # in Mksquashfs.  Obviously the compression algorithm must have been
+ # selected to be built
+ #
+-COMP_DEFAULT = gzip
++COMP_DEFAULT ?= gzip
+ 
+ 
+ ###
+-- 
+2.20.1
+
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb 
b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
index b06951d..df025d4 100644
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -9,6 +9,7 @@ PV = "4.4"
 SRCREV = "52eb4c279cd283ed9802dd1ceb686560b22ffb67"
 SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \

file://0001-squashfs-tools-fix-build-failure-against-gcc-10.patch;striplevel=2 \
+   
file://0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch;striplevel=2
 \
 "
 
 S = "${WORKDIR}/git/squashfs-tools"
@@ -25,6 +26,9 @@ PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr"
 PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd"
 PACKAGECONFIG[reproducible] = "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0,"
 
+SQUASHFS_TOOLS_COMP_DEFAULT ?= "gzip"
+EXTRA_OEMAKE += "COMP_DEFAULT=${SQUASHFS_TOOLS_COMP_DEFAULT}"
+
 do_compile() {
oe_runmake all
 }
-- 
1.8.3.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142442): 
https://lists.openembedded.org/g/openembedded-core/message/142442
Mute This Topic: https://lists.openembedded.org/mt/76784587/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

2020-09-11 Thread Peter Morrow
On Fri, Sep 11, 2020 at 12:47:44PM +0100, Ross Burton wrote:
> > +python () {
> > +# Change the default compression algorithm if requested.
> > +comp_default = d.getVar('SQUASHFS_TOOLS_COMP_DEFAULT')
> > +if comp_default != None:
> > +d.appendVar('EXTRA_OEMAKE', ' COMP_DEFAULT=%s' % comp_default)
> > +}
> > +
> 
> This is overcomplicated.  Just do:
> 
> SQUASHFS_TOOLS_COMP_DEFAULT ?= "gzip"
> EXTRA_OEMAKE += "COMP_DEFAULT=${SQUASHFS_TOOLS_COMP_DEFAULT}"
> 
> This way the default is documented in the recipe, and we can change
> the default easily too.

ACK. V2 coming.

Thanks,
Peter.

> 
> Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142441): 
https://lists.openembedded.org/g/openembedded-core/message/142441
Mute This Topic: https://lists.openembedded.org/mt/76776791/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH] squashfs-tools: Allow COMP_DEFAULT to be changed easily at build time

2020-09-11 Thread Peter Morrow
The default compression algorithm is gzip, this patch allows the default
to be changed via a bbappend file by setting SQUASHFS_TOOLS_COMP_DEFAULT
to a valid compression algorithm.

Signed-off-by: Peter Morrow 
---
 ...ols-Allow-COMP_DEFAULT-to-be-overridden-v.patch | 34 ++
 .../squashfs-tools/squashfs-tools_git.bb   |  8 +
 2 files changed, 42 insertions(+)
 create mode 100644 
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch

diff --git 
a/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
 
b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
new file mode 100644
index 000..5f12c42
--- /dev/null
+++ 
b/meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch
@@ -0,0 +1,34 @@
+From d2d9b517696f5950597f5b60ae8fdade5b7c14a9 Mon Sep 17 00:00:00 2001
+From: Peter Morrow 
+Date: Fri, 4 Sep 2020 15:43:15 +0100
+Subject: [PATCH] squashfs-tools: Allow COMP_DEFAULT to be overridden via make
+ cmdline
+
+Currently the only way to modify the default compression algorithm is to
+modify the Makefile. It is useful to be able to set the default compression
+algorithm via the make command line since otherwise a build time search
+replace operation needs to be performed on the Makefile.
+
+Upstream-Status: Submitted [https://github.com/plougher/squashfs-tools/pull/93 
]
+
+Signed-off-by: Peter Morrow 
+---
+ squashfs-tools/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile
+index aee4b96..7425605 100644
+--- a/squashfs-tools/Makefile
 b/squashfs-tools/Makefile
+@@ -85,7 +85,7 @@ GZIP_SUPPORT = 1
+ # in Mksquashfs.  Obviously the compression algorithm must have been
+ # selected to be built
+ #
+-COMP_DEFAULT = gzip
++COMP_DEFAULT ?= gzip
+ 
+ 
+ ###
+-- 
+2.20.1
+
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb 
b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
index b06951d..3c816cb 100644
--- a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -9,6 +9,7 @@ PV = "4.4"
 SRCREV = "52eb4c279cd283ed9802dd1ceb686560b22ffb67"
 SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \

file://0001-squashfs-tools-fix-build-failure-against-gcc-10.patch;striplevel=2 \
+   
file://0001-squashfs-tools-Allow-COMP_DEFAULT-to-be-overridden-v.patch;striplevel=2
 \
 "
 
 S = "${WORKDIR}/git/squashfs-tools"
@@ -25,6 +26,13 @@ PACKAGECONFIG[xattr] = "XATTR_SUPPORT=1,XATTR_SUPPORT=0,attr"
 PACKAGECONFIG[zstd] = "ZSTD_SUPPORT=1,ZSTD_SUPPORT=0,zstd"
 PACKAGECONFIG[reproducible] = "REPRODUCIBLE_DEFAULT=1,REPRODUCIBLE_DEFAULT=0,"
 
+python () {
+# Change the default compression algorithm if requested.
+comp_default = d.getVar('SQUASHFS_TOOLS_COMP_DEFAULT')
+if comp_default != None:
+d.appendVar('EXTRA_OEMAKE', ' COMP_DEFAULT=%s' % comp_default)
+}
+
 do_compile() {
oe_runmake all
 }
-- 
1.8.3.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142434): 
https://lists.openembedded.org/g/openembedded-core/message/142434
Mute This Topic: https://lists.openembedded.org/mt/76776791/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-