Skip to content

Commit

Permalink
externalxsctsrc.bbclass: Provide src and/or build option to check fil…
Browse files Browse the repository at this point in the history
…e hashes

When using files from an external source, bitbake should spend time to
hash all the files to know if any of the files have been changed. This
results in builds taking more time. Incase of petalinux-tools, since the
external source is coming from the tool itself, we can skip hashing the
source files  when building and only hash the files in the build
directory.

This patch gives the option of specifiying whether we need to add src
and/or build files to the hash check list. By setting
EXTERNALXSCTSRCHASH to src and/or build we can control what files gets
added to the hash check list.

By default it will hash the source files when EXTERNALXSCTSRCHASH is
empty

Signed-off-by: Bhargava Sreekantappa Gayathri <bhargava.sreekantappa-gayathri@xilinx.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
  • Loading branch information
Bhargava Sreekantappa Gayathri authored and mharth committed Dec 12, 2017
1 parent 14db16f commit 460156a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion classes/externalxsctsrc.bbclass
Expand Up @@ -6,6 +6,7 @@
# Released under the MIT license (see COPYING.MIT for the terms)

SRCTREECOVEREDTASKS ?= "do_patch do_unpack do_fetch"
EXTERNALXSCTSRCHASH ?= "src build"

python () {
externalsrc = d.getVar('EXTERNALXSCTSRC', True)
Expand Down Expand Up @@ -68,7 +69,18 @@ python () {

d.prependVarFlag('do_compile', 'prefuncs', "xsct_externalsrc_compile_prefunc")

d.setVarFlag('do_compile', 'file-checksums', '${@xsct_srctree_hash_files(d)} ${@xsct_buildtree_hash_files(d)}')
external_xsct_src_hash = d.getVar('EXTERNALXSCTSRCHASH', True)

# If EXTERNALXSCTSRCHASH is set to both build and src, hash both.
# If EXTERNALXSCTSRCHASH is set to build, hash build file. By default hash src files if EXTERNALXSCTSRCHASH is empty.
if ((external_xsct_src_hash.find('build') != -1) and (external_xsct_src_hash.find('src')!= -1)):
d.setVarFlag('do_compile', 'file-checksums', '${@xsct_buildtree_hash_files(d)} ${@xsct_srctree_hash_files(d)}')

elif external_xsct_src_hash.find('build') != -1:
d.setVarFlag('do_compile', 'file-checksums', '${@xsct_buildtree_hash_files(d)}')

else:
d.setVarFlag('do_compile', 'file-checksums', '${@xsct_srctree_hash_files(d)}')

# We don't want the workdir to go away
d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True))
Expand Down

0 comments on commit 460156a

Please sign in to comment.