Re: [OE-core] [PATCH 1/3] Revert "ccache.bbclass: use ccache from host distribution"

2021-01-19 Thread Robert Yang



On 1/19/21 5:23 PM, Robert Yang wrote:

This reverts commit f5b29367af4d8e5daea5771264774aa49519f9a8.

Will use ccache-native which is more reliable.

Signed-off-by: Robert Yang 
---
  meta/classes/ccache.bbclass  | 3 +--
  meta/conf/bitbake.conf   | 2 +-
  meta/lib/oeqa/selftest/cases/buildoptions.py | 8 
  3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index f00fafc292a..fc4745609ce 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -1,7 +1,5 @@
  #
  # Usage:
-# - Install ccache package on the host distribution and set up a build 
directory
-#
  # - Enable ccache
  #   Add the following line to a conffile such as conf/local.conf:
  #   INHERIT += "ccache"
@@ -53,6 +51,7 @@ python() {
  # quilt-native doesn't need ccache since no c files
  if not (pn in ('ccache-native', 'quilt-native') or
  bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))):
+d.appendVar('DEPENDS', ' ccache-native')
  d.setVar('CCACHE', 'ccache ')
  }
  
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf

index be94b78eb15..74976ac05c2 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -498,7 +498,7 @@ HOSTTOOLS += " \
  HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) 
or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", 
"testsdk.bbclass"])) else ''}"
  
  # Link to these if present

-HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh 
sudo"
+HOSTTOOLS_NONFATAL += "aws gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh 
sudo"


The original patch has another side effect, once ccache is in hosttools, it
might be used when automatically, no matter set "INHERIT += ccache.bbclass" or 
not, and cause build errros such as:


ccache: error: Failed to create temporary file 
for~/.ccache/a/9/d6ei86jnu3q6gknptjb97vtr9hc329kR.tmp.kufXFz: Disk quota exceeded


So we can't add ccache to hosttools.

// Robert

  
  # Temporary add few more detected in bitbake world

  HOSTTOOLS_NONFATAL += "join nl size yes zcat"
diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py 
b/meta/lib/oeqa/selftest/cases/buildoptions.py
index d0f64773002..e91f0bd18f6 100644
--- a/meta/lib/oeqa/selftest/cases/buildoptions.py
+++ b/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -33,10 +33,10 @@ class ImageOptionsTests(OESelftestTestCase):
  self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % 
log_data_removed)
  
  def test_ccache_tool(self):

-bb_vars = get_bb_vars(['HOSTTOOLS_DIR'], 'm4-native')
-p = bb_vars['HOSTTOOLS_DIR'] + "/" + "ccache"
-if not os.path.isfile(p):
-self.skipTest("No ccache binary found in %s" % 
bb_vars['HOSTTOOLS_DIR'])
+bitbake("ccache-native")
+bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
+p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
+self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
  self.write_config('INHERIT += "ccache"')
  self.add_command_to_tearDown('bitbake -c clean m4-native')
  bitbake("m4-native -c clean")






-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#146971): 
https://lists.openembedded.org/g/openembedded-core/message/146971
Mute This Topic: https://lists.openembedded.org/mt/79948151/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 1/3] Revert "ccache.bbclass: use ccache from host distribution"

2021-01-19 Thread Robert Yang
This reverts commit f5b29367af4d8e5daea5771264774aa49519f9a8.

Will use ccache-native which is more reliable.

Signed-off-by: Robert Yang 
---
 meta/classes/ccache.bbclass  | 3 +--
 meta/conf/bitbake.conf   | 2 +-
 meta/lib/oeqa/selftest/cases/buildoptions.py | 8 
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
index f00fafc292a..fc4745609ce 100644
--- a/meta/classes/ccache.bbclass
+++ b/meta/classes/ccache.bbclass
@@ -1,7 +1,5 @@
 #
 # Usage:
-# - Install ccache package on the host distribution and set up a build 
directory
-#
 # - Enable ccache
 #   Add the following line to a conffile such as conf/local.conf:
 #   INHERIT += "ccache"
@@ -53,6 +51,7 @@ python() {
 # quilt-native doesn't need ccache since no c files
 if not (pn in ('ccache-native', 'quilt-native') or
 bb.utils.to_boolean(d.getVar('CCACHE_DISABLE'))):
+d.appendVar('DEPENDS', ' ccache-native')
 d.setVar('CCACHE', 'ccache ')
 }
 
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index be94b78eb15..74976ac05c2 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -498,7 +498,7 @@ HOSTTOOLS += " \
 HOSTTOOLS += "${@'ip ping ps scp ssh stty' if 
(bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) or 
any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", 
"testsdk.bbclass"])) else ''}"
 
 # Link to these if present
-HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat 
ssh sudo"
+HOSTTOOLS_NONFATAL += "aws gcc-ar gpg ld.bfd ld.gold nc pigz sftp socat ssh 
sudo"
 
 # Temporary add few more detected in bitbake world
 HOSTTOOLS_NONFATAL += "join nl size yes zcat"
diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py 
b/meta/lib/oeqa/selftest/cases/buildoptions.py
index d0f64773002..e91f0bd18f6 100644
--- a/meta/lib/oeqa/selftest/cases/buildoptions.py
+++ b/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -33,10 +33,10 @@ class ImageOptionsTests(OESelftestTestCase):
 self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % 
log_data_removed)
 
 def test_ccache_tool(self):
-bb_vars = get_bb_vars(['HOSTTOOLS_DIR'], 'm4-native')
-p = bb_vars['HOSTTOOLS_DIR'] + "/" + "ccache"
-if not os.path.isfile(p):
-self.skipTest("No ccache binary found in %s" % 
bb_vars['HOSTTOOLS_DIR'])
+bitbake("ccache-native")
+bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
+p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
+self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
 self.write_config('INHERIT += "ccache"')
 self.add_command_to_tearDown('bitbake -c clean m4-native')
 bitbake("m4-native -c clean")
-- 
2.17.1


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