Skip to contentSkip to conversation

archiver: fix gcc-source handling

PATCH Applied Saul Wold 3 participants 5 messages Oct 10, 2016 – Oct 27, 2016

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH 1/1 archiver: fix gcc-source handling

The source archiver was not handling the gcc-source target correctly, since it uses the work-shared directory, we don't want to unpack and patch it twice, just as the comments say, but the code was not there to check for the gcc-source target.

[YOCTO #10265]

---

 meta/classes/archiver.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/archiver.bbclass +3 -2
index 1d8e863..9239983 100644
@@ -303,9 +303,10 @@ python do_unpack_and_patch() {
         return
     ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
     ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+    pn = d.getVar('PN', True)
 
     # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
-    if not bb.data.inherits_class('kernel-yocto', d):
+    if not (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc-source')):
         # Change the WORKDIR to make do_unpack do_patch run in another dir.
         d.setVar('WORKDIR', ar_workdir)
 
@@ -323,7 +324,7 @@ python do_unpack_and_patch() {
         oe.path.copytree(src, src_orig)
 
     # Make sure gcc and kernel sources are patched only once
-    if not ((d.getVar('SRC_URI', True) == "" or bb.data.inherits_class('kernel-yocto', d))):
+    if not (d.getVar('SRC_URI', True) == "" or (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc-source'))):
         bb.build.exec_func('do_patch', d)
 
     # Create the patches
Signature · 1 line
2.7.4
#1 lore raw

This has been merged to master ping for Krogoth

Sau!

Quoted 49 lines · Saul Wold

The source archiver was not handling the gcc-source target correctly, since it uses the
work-shared directory, we don't want to unpack and patch it twice, just as the comments
say, but the code was not there to check for the gcc-source target.

[YOCTO #10265]

---

 meta/classes/archiver.bbclass | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/archiver.bbclass +0 -0
index 1d8e863..9239983 100644
@@ -303,9 +303,10 @@ python do_unpack_and_patch() {

         return
     ar_outdir = d.getVar('ARCHIVER_OUTDIR', True) ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+    pn = d.getVar('PN', True)

     # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
-    if not bb.data.inherits_class('kernel-yocto', d):
+    if not (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc-source')):
         # Change the WORKDIR to make do_unpack do_patch run in another dir.
         d.setVar('WORKDIR', ar_workdir)

meta/classes/archiver.bbclass +0 -0
@@ -323,7 +324,7 @@ python do_unpack_and_patch() {
          oe.path.copytree(src, src_orig)


     # Make sure gcc and kernel sources are patched only once -    if not ((d.getVar('SRC_URI', True) == "" or bb.data.inherits_class('kernel-yocto', d))):
+    if not (d.getVar('SRC_URI', True) == "" or (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc- source'))):
         bb.build.exec_func('do_patch', d)

     # Create the patches
--
2.7.4

Applied
#2 lore raw
Quoted 1 line · Saul Wold

This has been merged to master ping for Krogoth

Merged to my stagging. Thanks for the reminder.

- armin

Quoted 53 lines

Sau!

Quoted 49 lines · Saul Wold

The source archiver was not handling the gcc-source target correctly, since it uses the
work-shared directory, we don't want to unpack and patch it twice, just as the comments
say, but the code was not there to check for the gcc-source target.

[YOCTO #10265]

---

  meta/classes/archiver.bbclass | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/archiver.bbclass +1 -0
index 1d8e863..9239983 100644
@@ -303,9 +303,10 @@ python do_unpack_and_patch() {
          return
      ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
      ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+    pn = d.getVar('PN', True)
 
      # The kernel class functions require it to be on work-shared, so

we dont change WORKDIR

meta/classes/archiver.bbclass +1 -1
-    if not bb.data.inherits_class('kernel-yocto', d):
+    if not (bb.data.inherits_class('kernel-yocto', d) or

pn.startswith('gcc-source')):
# Change the WORKDIR to make do_unpack do_patch run in
another dir.
d.setVar('WORKDIR', ar_workdir)

meta/classes/archiver.bbclass +0 -1
@@ -323,7 +324,7 @@ python do_unpack_and_patch() {
          oe.path.copytree(src, src_orig)
 
      # Make sure gcc and kernel sources are patched only once
-    if not ((d.getVar('SRC_URI', True) == "" or

bb.data.inherits_class('kernel-yocto', d))):
+ if not (d.getVar('SRC_URI', True) == "" or
(bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc- source'))):
bb.build.exec_func('do_patch', d)

# Create the patches

Signature · 1 line
2.7.4
#3 lore raw
In reply to Saul Wold

This has been merged to master ping for Krogoth

Sau!

Quoted 50 lines · Saul Wold

The source archiver was not handling the gcc-source target correctly, since it uses the
work-shared directory, we don't want to unpack and patch it twice, just as the comments
say, but the code was not there to check for the gcc-source target.

[YOCTO #10265]

---

 meta/classes/archiver.bbclass | 5 +++--

 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/archiver.bbclass +0 -0
index 1d8e863..9239983 100644
@@ -303,9 +303,10 @@ python do_unpack_and_patch() {

         return
     ar_outdir = d.getVar('ARCHIVER_OUTDIR', True) ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+    pn = d.getVar('PN', True)

     # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
-    if not bb.data.inherits_class('kernel-yocto', d):
+    if not (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc-source')):
         # Change the WORKDIR to make do_unpack do_patch run in another dir.
         d.setVar('WORKDIR', ar_workdir)

meta/classes/archiver.bbclass +0 -0
@@ -323,7 +324,7 @@ python do_unpack_and_patch() {
          oe.path.copytree(src, src_orig)


     # Make sure gcc and kernel sources are patched only once -    if not ((d.getVar('SRC_URI', True) == "" or bb.data.inherits_class('kernel-yocto', d))):
+    if not (d.getVar('SRC_URI', True) == "" or (bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc- source'))):
         bb.build.exec_func('do_patch', d)

     # Create the patches
--
2.7.4

#4 lore raw
Quoted 3 lines · Saul

This has been merged to master ping for Krogoth

Sau!

is in my staging work.
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=akuster/krogoth-next&id=d52071671f6b93a7653b8445bf9bf2b9a5c0e29a

I am working on getting a clean build out of the AB before doing a pull request. I suppose I should send a pre-pull request for review.

- armin

Quoted 51 lines · Saul Wold
Quoted 49 lines

The source archiver was not handling the gcc-source target correctly, since it uses the
work-shared directory, we don't want to unpack and patch it twice, just as the comments
say, but the code was not there to check for the gcc-source target.

[YOCTO #10265]

---

  meta/classes/archiver.bbclass | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/archiver.bbclass +1 -0
index 1d8e863..9239983 100644
@@ -303,9 +303,10 @@ python do_unpack_and_patch() {
          return
      ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
      ar_workdir = d.getVar('ARCHIVER_WORKDIR', True)
+    pn = d.getVar('PN', True)
 
      # The kernel class functions require it to be on work-shared, so

we dont change WORKDIR

meta/classes/archiver.bbclass +1 -1
-    if not bb.data.inherits_class('kernel-yocto', d):
+    if not (bb.data.inherits_class('kernel-yocto', d) or

pn.startswith('gcc-source')):
# Change the WORKDIR to make do_unpack do_patch run in
another dir.
d.setVar('WORKDIR', ar_workdir)

meta/classes/archiver.bbclass +0 -1
@@ -323,7 +324,7 @@ python do_unpack_and_patch() {
          oe.path.copytree(src, src_orig)
 
      # Make sure gcc and kernel sources are patched only once
-    if not ((d.getVar('SRC_URI', True) == "" or

bb.data.inherits_class('kernel-yocto', d))):
+ if not (d.getVar('SRC_URI', True) == "" or
(bb.data.inherits_class('kernel-yocto', d) or pn.startswith('gcc- source'))):
bb.build.exec_func('do_patch', d)

# Create the patches

Signature · 1 line
2.7.4