Skip to contentSkip to conversation

mingw32-common: change mingw sdk to .zip type

PATCH In review [email protected] 3 participants 9 messages Jan 16, 2019 – May 5, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mingw32-common: change mingw sdk to .zip type

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so change to .zip type

Also tried to use option --dereference of tar which use means:
"follow symlinks; archive and dump the files they point to" with this option, when archive it will deal with symlink to hard link, but windows not support hard link, so drop this solution, and use .zip for windows.

---
 conf/machine-sdk/include/mingw32-common.inc | 5 +++++
 1 file changed, 5 insertions(+)
conf/machine-sdk/include/mingw32-common.inc +5 -0
index 9011ded..dbad50a 100644
@@ -46,3 +46,8 @@ GCCPIE_mingw32 = ""
 # wine and wineserver are required to test MinGW SDKs
 HOSTTOOLS += "${@'wine wineserver' if (bb.utils.contains_any('IMAGE_CLASSES', 'testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testsdk.bbclass"])) else ''}"
 
+# mingw sdk use .zip type
+SDK_TAR_TYPE = "zip"
+SDK_TAR_DEPENDS = "zip-native"
+SDK_TAR_CMD ?= "zip -r  ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE} ."
+
Signature · 1 line
2.7.4
#1 lore raw
Quoted 34 lines · On Wed, Jan 16, 2019, 3:37 AM <[email protected] wrote:

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so change to .zip type

Also tried to use option --dereference of tar which use means:
"follow symlinks; archive and dump the files they point to" with this option, when archive it will deal with symlink to hard link, but windows not support hard link, so drop this solution, and use .zip for windows.

---
 conf/machine-sdk/include/mingw32-common.inc | 5 +++++
 1 file changed, 5 insertions(+)
conf/machine-sdk/include/mingw32-common.inc +0 -0
index 9011ded..dbad50a 100644
@@ -46,3 +46,8 @@ GCCPIE_mingw32 = ""
 # wine and wineserver are required to test MinGW SDKs
 HOSTTOOLS += "${@'wine wineserver' if

(bb.utils.contains_any('IMAGE_CLASSES', 'testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testsdk.bbclass"])) else ''}"

conf/machine-sdk/include/mingw32-common.inc +4 -0
+# mingw sdk use .zip type
+SDK_TAR_TYPE = "zip"
+SDK_TAR_DEPENDS = "zip-native"
+SDK_TAR_CMD ?= "zip -r
Quoted 3 lines

${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE} ." +

You will also need to update the QA tests, since right now they expecting a tar file (lib/oeqa/sdkmingw/testsdk.py)

--

2.7.4

Quoted 7 lines

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#2 lore raw

Just in case you hadn't noticed, that this depends on a corresponding patch to oe-core, which I've comments on.

Ross

Quoted 56 lines · Joshua Watt
Quoted 25 lines · On Wed, Jan 16, 2019, 3:37 AM <[email protected] wrote:

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so change to .zip type

Also tried to use option --dereference of tar which use means:
"follow symlinks; archive and dump the files they point to" with this option, when archive it will deal with symlink to hard link, but windows not support hard link, so drop this solution, and use .zip for windows.

---
 conf/machine-sdk/include/mingw32-common.inc | 5 +++++
 1 file changed, 5 insertions(+)
conf/machine-sdk/include/mingw32-common.inc +0 -0
index 9011ded..dbad50a 100644

conf/machine-sdk/include/mingw32-common.inc GCCPIE_mingw32 = "" · line 53

Quoted 8 lines
conf/machine-sdk/include/mingw32-common.inc +5 -0
@@ -46,3 +46,8 @@ GCCPIE_mingw32 = ""
 # wine and wineserver are required to test MinGW SDKs
 HOSTTOOLS += "${@'wine wineserver' if (bb.utils.contains_any('IMAGE_CLASSES', 'testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testsdk.bbclass"])) else ''}"
 
+# mingw sdk use .zip type
+SDK_TAR_TYPE = "zip"
+SDK_TAR_DEPENDS = "zip-native"
+SDK_TAR_CMD ?= "zip -r  ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE} ."
+

You will also need to update the QA tests, since right now they expecting a tar file (lib/oeqa/sdkmingw/testsdk.py)

Quoted 9 lines

--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#3 lore raw

Ross and Joshua,  thanks for your comments,  I will send a v2 later.

Quoted 58 lines · Ross

Just in case you hadn't noticed, that this depends on a corresponding patch to oe-core, which I've comments on.

Ross

Quoted 52 lines · Joshua Watt
Quoted 24 lines · On Wed, Jan 16, 2019, 3:37 AM <[email protected] wrote:

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so change to .zip type

Also tried to use option --dereference of tar which use means:
"follow symlinks; archive and dump the files they point to" with this option, when archive it will deal with symlink to hard link, but windows not support hard link, so drop this solution, and use .zip for windows.

---
  conf/machine-sdk/include/mingw32-common.inc | 5 +++++
  1 file changed, 5 insertions(+)
conf/machine-sdk/include/mingw32-common.inc +0 -0
index 9011ded..dbad50a 100644

conf/machine-sdk/include/mingw32-common.inc GCCPIE_mingw32 = "" · line 53

Quoted 8 lines
conf/machine-sdk/include/mingw32-common.inc +5 -0
@@ -46,3 +46,8 @@ GCCPIE_mingw32 = ""
  # wine and wineserver are required to test MinGW SDKs
  HOSTTOOLS += "${@'wine wineserver' if (bb.utils.contains_any('IMAGE_CLASSES', 'testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testsdk.bbclass"])) else ''}"
 
+# mingw sdk use .zip type
+SDK_TAR_TYPE = "zip"
+SDK_TAR_DEPENDS = "zip-native"
+SDK_TAR_CMD ?= "zip -r  ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE} ."
+

You will also need to update the QA tests, since right now they expecting a tar file (lib/oeqa/sdkmingw/testsdk.py)

Quoted 9 lines

--

2.7.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Signature · 3 lines
BRs

Sandy(Li Changqing)
#4 lore raw

PATCH v2 1/1 testsdk: enhance extract sdk part

In reply to Burton, Ross

change in V2:
1. move zip part to oe-core, and if usr want to use .zip file set SDK_ARCHIVE_TYPE to zip in local.conf
2. correct extract sdk function for qa test

Changqing Li (1):
testsdk: enhance extract sdk part

 lib/oeqa/sdkmingw/testsdk.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 1/1 testsdk: enhance extract sdk part

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so oe-core have add support of change SDK type to .zip, so correct the extract function.

---
 lib/oeqa/sdkmingw/testsdk.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
lib/oeqa/sdkmingw/testsdk.py +9 -2
index 85fe3c6..173cfd9 100644
@@ -12,7 +12,7 @@ class TestSDKMinGW(TestSDK):
         """
         Get the name of the SDK file
         """
-        return d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz")
+        return d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}")
 
     def extract_sdk(self, tcname, sdk_dir, d):
         """
@@ -23,7 +23,14 @@ class TestSDKMinGW(TestSDK):
         try:
             # TODO: It would be nice to try and extract the SDK in Wine to make
             # sure it is well formed
-            subprocess.check_output(['tar', '-xf', tcname, '-C', sdk_dir])
+            
+            # TODO: Extract SDK according to SDK_ARCHIVE_TYPE, need to change if
+            # oe-core support other types.
+            if d.getVar("SDK_ARCHIVE_TYPE") == "zip":
+                subprocess.check_output(['unzip', '-d', sdk_dir, tcname])
+            else:
+                subprocess.check_output(['tar', '-xf', tcname, '-C', sdk_dir])
+
         except subprocess.CalledProcessError as e:
             bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8"))
 
Signature · 1 line
2.7.4
#6 lore raw

Re: [meta-mingw][PATCH V2] testsdk: enhance extract sdk part

Just FYI, I haven't forgot about this patch. I want to wait until the dependent OE-core patch is at least in the master-next branch before I apply this to the MinGW master-next branch. If you want to give me a ping when the OE-core patch shows up in master-next, it would be very helpful.

Thanks

Quoted 55 lines · On Thu, 2019-01-17 at 17:49 +0800, [email protected] wrote:

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so oe-core have add support of change SDK type to .zip, so correct the extract function.

---
 lib/oeqa/sdkmingw/testsdk.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
lib/oeqa/sdkmingw/testsdk.py +1 -1
index 85fe3c6..173cfd9 100644
@@ -12,7 +12,7 @@ class TestSDKMinGW(TestSDK):
         """
         Get the name of the SDK file
         """
-        return
 d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz")
+        return
 d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}")
 

def extract_sdk(self, tcname, sdk_dir, d):
"""

lib/oeqa/sdkmingw/testsdk.py +0 -0
@@ -23,7 +23,14 @@ class TestSDKMinGW(TestSDK):
         try:
             # TODO: It would be nice to try and extract the SDK in

Wine to make

             # sure it is well formed
-            subprocess.check_output(['tar', '-xf', tcname, '-C',
sdk_dir])
lib/oeqa/sdkmingw/testsdk.py +2 -0
+            
+            # TODO: Extract SDK according to SDK_ARCHIVE_TYPE, need

to change if

lib/oeqa/sdkmingw/testsdk.py +3 -0
+            # oe-core support other types.
+            if d.getVar("SDK_ARCHIVE_TYPE") == "zip":
+                subprocess.check_output(['unzip', '-d', sdk_dir,

tcname])

lib/oeqa/sdkmingw/testsdk.py +2 -0
+            else:
+                subprocess.check_output(['tar', '-xf', tcname, '-C', 

sdk_dir])
+
except subprocess.CalledProcessError as e:
bb.fatal("Couldn't install the SDK:\n%s" %
e.output.decode("utf-8"))

Signature · 1 line
2.7.4
Signature · 1 line
Joshua Watt <[email protected]>
#7 lore raw

Re: [meta-mingw][PATCH V2] testsdk: enhance extract sdk part

Quoted 7 lines · Joshua Watt

Just FYI, I haven't forgot about this patch. I want to wait until the dependent OE-core patch is at least in the master-next branch before I apply this to the MinGW master-next branch. If you want to give me a ping when the OE-core patch shows up in master-next, it would be very helpful.

Thanks

Yes, I will do it.

Quoted 57 lines · On Thu, 2019-01-17 at 17:49 +0800, [email protected] wrote:
Quoted 55 lines

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so oe-core have add support of change SDK type to .zip, so correct the extract function.

---
  lib/oeqa/sdkmingw/testsdk.py | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
lib/oeqa/sdkmingw/testsdk.py +1 -1
index 85fe3c6..173cfd9 100644
@@ -12,7 +12,7 @@ class TestSDKMinGW(TestSDK):
          """
          Get the name of the SDK file
          """
-        return
 d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz")
+        return
 d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}")
 

def extract_sdk(self, tcname, sdk_dir, d):
"""

lib/oeqa/sdkmingw/testsdk.py +0 -0
@@ -23,7 +23,14 @@ class TestSDKMinGW(TestSDK):
          try:
              # TODO: It would be nice to try and extract the SDK in

Wine to make

              # sure it is well formed
-            subprocess.check_output(['tar', '-xf', tcname, '-C',
sdk_dir])
lib/oeqa/sdkmingw/testsdk.py +2 -0
+
+            # TODO: Extract SDK according to SDK_ARCHIVE_TYPE, need

to change if

lib/oeqa/sdkmingw/testsdk.py +3 -0
+            # oe-core support other types.
+            if d.getVar("SDK_ARCHIVE_TYPE") == "zip":
+                subprocess.check_output(['unzip', '-d', sdk_dir,

tcname])

lib/oeqa/sdkmingw/testsdk.py +2 -0
+            else:
+                subprocess.check_output(['tar', '-xf', tcname, '-C',

sdk_dir])
+
except subprocess.CalledProcessError as e:
bb.fatal("Couldn't install the SDK:\n%s" %
e.output.decode("utf-8"))

Signature · 1 line
2.7.4
Signature · 3 lines
BRs

Sandy(Li Changqing)
#8 lore raw

Re: [meta-mingw][PATCH V2] testsdk: enhance extract sdk part

In reply to Joshua Watt

Hi, Joshua

OE-core patch have merge to master: https://git.openembedded.org/openembedded-core/commit/?id=57a33048a89a422cfdc986d3489c67b2d297e1e7

please help to merge this patch, thanks.

Quoted 64 lines · Joshua Watt

Just FYI, I haven't forgot about this patch. I want to wait until the dependent OE-core patch is at least in the master-next branch before I apply this to the MinGW master-next branch. If you want to give me a ping when the OE-core patch shows up in master-next, it would be very helpful.

Thanks

Quoted 55 lines · On Thu, 2019-01-17 at 17:49 +0800, [email protected] wrote:

From: Changqing Li <[email protected]>

Current sdk type is tar.xz, but for mingw sdk, since we have symlink under the sdk folder, 7zip which used to extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so oe-core have add support of change SDK type to .zip, so correct the extract function.

---
  lib/oeqa/sdkmingw/testsdk.py | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
lib/oeqa/sdkmingw/testsdk.py +1 -1
index 85fe3c6..173cfd9 100644
@@ -12,7 +12,7 @@ class TestSDKMinGW(TestSDK):
          """
          Get the name of the SDK file
          """
-        return
 d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.xz")
+        return
 d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.${SDK_ARCHIVE_TYPE}")
 

def extract_sdk(self, tcname, sdk_dir, d):
"""

lib/oeqa/sdkmingw/testsdk.py +0 -0
@@ -23,7 +23,14 @@ class TestSDKMinGW(TestSDK):
          try:
              # TODO: It would be nice to try and extract the SDK in

Wine to make

              # sure it is well formed
-            subprocess.check_output(['tar', '-xf', tcname, '-C',
sdk_dir])
lib/oeqa/sdkmingw/testsdk.py +2 -0
+
+            # TODO: Extract SDK according to SDK_ARCHIVE_TYPE, need

to change if

lib/oeqa/sdkmingw/testsdk.py +3 -0
+            # oe-core support other types.
+            if d.getVar("SDK_ARCHIVE_TYPE") == "zip":
+                subprocess.check_output(['unzip', '-d', sdk_dir,

tcname])

lib/oeqa/sdkmingw/testsdk.py +2 -0
+            else:
+                subprocess.check_output(['tar', '-xf', tcname, '-C',

sdk_dir])
+
except subprocess.CalledProcessError as e:
bb.fatal("Couldn't install the SDK:\n%s" %
e.output.decode("utf-8"))

Signature · 1 line
2.7.4
Signature · 3 lines
BRs

Sandy(Li Changqing)