summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: siggen: Make calc_taskhash match get_taskhash for file checksumsyocto-2.1.3krogoth-15.0.3Richard Purdie2017-06-271-1/+2
| | | | | | | | | | | The code in these two functions is meant to be equivlanet in behaviour but isn't. Add in code to ensure files that don't exist are handled consistently by both functions. Users did report being able to generate tracebacks otherwise. (Bitbake rev: 51e913e178a02bb603ddf874669e3ce54f90bd5d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Ensure taskhash mismatches don't override existing dataRichard Purdie2017-05-181-9/+9
| | | | | | | | | | | | | | | | | | We recalculate the taskhash to ensure the version we have matches what we think it should be. When we write out a sigdata file, use the calculated value so that we don't overwrite any existing file. This leaves any original taskhash sigdata file intact to allow a debugging comparison. (Bitbake rev: dac68af6f4add9c99cb7adcf23b2ae89b96ca075) (Bitbake rev: 03f6025a5b0cc4d883a9b2071e026769330752c8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Minor fixup Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Pass basehash to worker processes and sanity check ↵Richard Purdie2017-05-181-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reparsing result Bitbake can parse metadata in the cooker and in the worker during builds. If the metadata isn't deterministic, it can change between these two parses and this confuses things a lot. It turns out to be hard to debug these issues currently. This patch ensures the basehashes from the original parsing are passed into the workers and that these are checked when reparsing for consistency. The user is shown an error message if inconsistencies are found. There is debug code in siggen.py (see the "Slow but can be useful for debugging mismatched basehashes" commented code), we don't enable this by default due to performance issues. If you run into this message, enable this code and you will find "sigbasedata" files in tmp/stamps which should correspond to the hashes shown in this error message. bitbake-diffsigs on the files should show which variables are changing. (Bitbake rev: 46207262ee6cdd2e49c4765481a6a24702ca4843) (Bitbake rev: aa873f982ae4a56b135abd9eee169794e4c3aadd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Fixed up do to python3 changes not being in krogoth. Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Ensure tainted stamps are accounted for with writing custom ↵Richard Purdie2016-04-031-3/+7
| | | | | | | | | | | stamps sstate.bbclass for example writes siginfo files to a separate location but we need to read taint data from the standard path. (Bitbake rev: da444c9761ee15a59ea8880e3f812a5d3f1a1aaa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Fix nostamp taint handlingRichard Purdie2016-04-031-3/+7
| | | | | | | | | | | The taint values need to be passed from the server to the workers to ensure they see the same stamp values. Also ensure that the "nostamp:" prefix isn't included in the checksum value to match the server calculation. This ensures the checksums are all consistent. (Bitbake rev: f80ba20e90f3746f7faee3e0ff7f249025fec8ee) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Add checksum recalculation/checking codeRichard Purdie2016-04-031-11/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | In theory all the information to recalcuate the task signatures was written into the siginfo/sigdata files. In reality, some of the information was written into the filename. Firstly this patch duplicates that info into the file itself just for easy of use since its small. Secondly, we abstract out the existing "calculate the checksum" code for the taskhash, and add a function to calculate the bashhash based on the informaiton within the file. Finally, we call these functions when we're writing out the data to check that the data we're writing is consistent. I've found a couple of places it wasn't and its good to know about these in advance, rather than having a siginfo/sigdata file which a given hash in its filename but a contents which give a different result. This should all combine to avoid a certain class of checksum bugs making it into world, and identifying problems in advance. (Bitbake rev: 0f50a18d7a0ea0d68edd8e5217e29111f4b1ea0b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Fix check calculation problem with file_checksumsRichard Purdie2016-04-031-3/+4
| | | | | | | | | | | | When I enabled debugging of the checksum code, I found the value calculated from siginfo/sigdata files for do_fetch tasks never matched. This was due to an error in the way the data was being stored for these, it wasn't ordered correctly. This patch fixes things so the checksums calculated from siginfo/sigdata files is correct when file checksums are present. (Bitbake rev: 046c1be7594fae2eec3d1f242ba3e9a85f1a1880) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Drop misleading duplicate methodRichard Purdie2016-04-031-3/+0
| | | | | | | | | The real method is a few lines later, this one is incorrect and just causing confusion. Remove it. (Bitbake rev: a896f263300f069400eae533be0daf5dedf41c95) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: SignatureGeneratorBasic: make checksum cache file configurableMarkus Lehtonen2016-02-181-3/+17
| | | | | | | | | | | Define a new bitbake configuration variable BB_HASH_CHECKSUM_CACHE_FILE that can be used to define the cache file to use for file checksum cache. (Bitbake rev: a965b390d6240e279c190b92b17c0573e9bd604c) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: SignatureGenerator: add method for saving the file checksum cacheMarkus Lehtonen2016-02-181-0/+9
| | | | | | | | | | | | Extend the API in order to be able to write out the file checksum cache onto disk. SignatureGeneratorBasic class now implements a method that update the fetcher local files checksum cache with the task file dependency checksums. (Bitbake rev: ecdabd321d48fa367b89ebffc00aa525b6eaa95c) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Change exception note into a warningRichard Purdie2016-01-061-1/+1
| | | | | | | | | This makes no sense as just a note, its at least a warning and useful to get an idea of which codepath is failing. (Bitbake rev: 0194cf0da24dc72dab0612cd54aa5190e6cd92f2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Make it clear why nostamp tasks signatures don't matchRichard Purdie2015-10-011-1/+9
| | | | | | | | | | | | If you run bitbake-diffsigs against two differing sigdata files from nostamp tasks it shows no difference despite the differing checksum. Change the code so this shows up as a nostamp 'taint' and at least makes the issue clearer to the end user. (Bitbake rev: 97679d18955dadaa34f9450564e44da99984d140) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Don't crash if number of task dependencies changeRichard Purdie2015-05-261-6/+10
| | | | | | | | | If the number of task dependencies change you currently get a traceback when using diffsigs. (Bitbake rev: c6798b431571aae18bb8699ac6e3ec75b731d719) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Ensure taskdata default functions exist in base classRichard Purdie2015-01-231-6/+7
| | | | | | | | | | | | The get/set_taskdata functions are now part of the API of the class, ensure they exist in the base class definition so the noop handler works. [YOCTO #7233] (Bitbake rev: 9b5b1bd7d77e3f5886f6c557d3b750de1f6d6025) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cache/fetch2/siggen: Ensure we track include history for file checksumsRichard Purdie2015-01-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if you reference a file url, its checksum is included in the task hash, however if you change to a different file at a different location, perhaps taking advantage of the FILESPATH functionality, the system will not reparse the file in question and change its checksum to match the new file. To correctly handle this, the system not only needs to know if the existing file still exists or not, but also check the existance of every file it would have looked at when computing the original file. We already do this in the bitbake parsing code for class inclusion. This change uses the same technique to log the file list we looked at and if files in these locations exist when they previously did not, to invalidate and reparse the file. Since data stored in the cache is flattened text, we have to use a string form of the data and split on the ":" character which is ugly, but is an internal detail we can improve later if a better method is found. The cache version changes to trigger a reparse since the previous cache data is now incompatible. [YOCTO #7019] (Bitbake rev: 6c0706a28d72c591f1b75b6e3f3b645859387c7e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: ensure nostamp tasks force dependent tasks to re-executePaul Eggleton2014-12-231-0/+6
| | | | | | | | | | | | | If a nostamp task is depended on by a non-nostamp task, then we want the signature of that task to change such that it re-executes afterwards. This is an unusual situation, but we want this to work in OE in externalsrc.bbclass so that compilation happens every time it is requested. (Bitbake rev: 73498afc3d45beede5b8f24a9acd523a1663b793) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Fix shared work checksum mismatch/rebuild issuesRichard Purdie2014-11-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the last shared work task signature bug, we've found another one. Looking at the improved output of diffsigs in this case: runtaskdeps changed from [ 'autoconf_2.69.bb.do_populate_sysroot:virtual:native', 'gnu-config_20120814.bb.do_populate_sysroot:virtual:native', 'libgcc-initial_4.9.bb.do_patch:virtual:nativesdk' ] to [ 'autoconf_2.69.bb.do_populate_sysroot:virtual:native', 'gcc-crosssdk-initial_4.9.bb.do_patch', 'gnu-config_20120814.bb.do_populate_sysroot:virtual:native' ] so we can get a different task hash since libgcc sorts before gnu-config and gcc sorts after it. We could do with a way of fixing this, the best I can come up with is to include a single parent directory. Since recipes are never at the top of any metadata trees I've seen, this should suffice for now. I'm planning to burn the concept of shared work within bitbake and do something at the metadata level in the 1.8 timeframe as its just too fragile as things stand and hard to fix well. (Bitbake rev: d753644c67d163f338f2bdc3d600203e8b1a5734) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Add computed hash code to verify hash computation to dumpsigRichard Purdie2014-11-081-0/+13
| | | | | | | | | This is useful code to double check the computed checksum value if nothing else. Might as well have it in tree. (Bitbake rev: 54ecf96c6f031927ee2410f6efde4e16f19bbf66) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Ensure we output if the ordering of runtaskdeps changesRichard Purdie2014-11-081-0/+17
| | | | | | | | | | | | | Order of runtaskdeps is important. If the hashes differ we should print output. This is complicated by shared work where the filenames themselves can differ, but the checksum should not. This fixes a case where two different checksums could show no output with bitbake-diffsigs. (Bitbake rev: 40c95cb9def282dc88234cd72ff462d7a01e47c1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen/runqueue/bitbake-worker: Improve siggen data transfer interfaceRichard Purdie2014-09-111-4/+5
| | | | | | | | | | | | | We need to transfer some of the siggen data from the core/cooker into the worker instances. There was a partial API created for this but its ugly and its not possible to extend it from the siggen class. This patch completes the interface/abstraction for the data and means the class can extend/customise it in any siggen class. (Bitbake rev: cf2d642052979d236185c5b8ca2c5478c06e62ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Fix a subtle bug in hash calculation for shared work tasksRichard Purdie2014-08-231-1/+1
| | | | | | | | | | | | | | | | | | | With a shared work task like gcc, the task can be run from a variety of different recipes which may have different virtual extensions in place. Depending on whether gcc-runtime or nativesdk-gcc-runtime's do_preconfigure task is called for example will change the sorting of the task hashes due to the way clean_basename currently works. The correct thing to do here is sort on the base filename first, then any extension when ordering the hashes. This means we do account for things like recipes with both a native and non-native dependency but we also fix the shared work case where we don't care whether it was a virtual version or not. (Bitbake rev: 2e80b5d10a5037ed6f0bc227a1f9b42529c87086) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Print warning about tainted tasksRichard Purdie2014-06-011-0/+1
| | | | | | | | | | The big warning printed when people use -f is easily ignored/forgotten. To raise user awareness, print a warning any time we include a tainted stamp file into a build instead. (Bitbake rev: 18f9bcbad059608e22fca20309314e1c399acec7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: runqueue/siggen: Pass in commandline options to dump_sigs()Richard Purdie2014-03-271-2/+2
| | | | | | | | | This allows the commandline options to be processed in the dump signature code. (Bitbake rev: ef8537a2e9b48f4fe065a165c102935aee2c9029) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen.py: fix the SignatureGenerator()Robert Yang2014-01-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | If we set: BB_SIGNATURE_HANDLER = "noop" Then we would get the following errors: [snip] File "runqueue.py", line 876, in RunQueue._start_worker(fakeroot=False, rqexec=None): "fakerootnoenv" : self.rqdata.dataCache.fakerootnoenv, > "hashes" : bb.parse.siggen.taskhash, "hash_deps" : bb.parse.siggen.runtaskdeps, AttributeError: 'SignatureGenerator' object has no attribute 'taskhash' [snip] This patch fixes the problem. [YOCTO #5741] (Bitbake rev: 2bfcb751891cf3b4050e996b3c8e28678c3a8bf4) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: SignatureGenerator: Add empty implementation for dump_sigsMartin Jansa2014-01-181-0/+2
| | | | | | | | | | | * bitbake -S throws exception when 'noop' signature handler is used [YOCTO #5738] (Bitbake rev: 53352e8d388b7fc4da73f95b93dcc087e76d0426) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Remove fsync that is causing performance issuesRichard Purdie2014-01-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | This fsync was added for belt and braces protection for things like sstate on NFS. To be honest, it probably doesn't buy much, if the rename isn't atomic, all bets are off anyway and there are bigger issues to worry about. The issue is that at the end of every task, the dump_sig() code is triggered to save out information about the task and this was triggering an fsync(fd). Whilst it may select the file descriptor, on file systems like ext4, it will require large parts of the journal to be written out so it can have significant impact. latencytop showed an average fsync() call overhead of about 2s and if that happens for 5000 tasks, the time mounts up. This blocks the next task execution by that time. We therefore drop the fsync since in reality its causing problems and is unlikely to buy much. (Bitbake rev: 46fd841319479f6079d850b3813e64bd8c2680a3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Fix reversed difference outputRichard Purdie2013-12-201-6/+6
| | | | | | | | | | The output when comparing siginfo files for dict_diff is reversed and shows additions when things were removed and vice versa. This patch reverses the operation so the changes are shown correctly and makes the output less confusing. (Bitbake rev: 9b4142df36619099670740a5d3bc94e404ab2b56) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: When printing signatures recursively, limit the outputRichard Purdie2013-12-201-1/+3
| | | | | | | | | | | | | | | | Currently the code prints all differences. If the task dependencies have changed hash, we recurse into those and print those differences as well. This leads to a lot of output. The reality is if the parents changed signature, we might as well just say that and recurse with no other output since we're much more interested in how the parents changed in nearly all cases. The changes in the parent are probably the same ones we'd have printed at each level anyway. By doing this we focus the output more carefully on the thing the user wants/needs to see. (Bitbake rev: 7a17fd6e51a76d3582c357b79f5ef86e1969650c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: handle recipe path changes in siginfo filesPaul Eggleton2013-10-141-4/+37
| | | | | | | | | | | | | | | | | | | | | Avoid storing paths to files in SRC_URI when writing out the the file checksums to siginfo files. This prevents a move of the source directory being reported by bitbake-diffsigs as files being removed and then added (the signature itself is not affected since the file paths have never been included in the signature). This has required the format of the file checksums in the siginfo file to be changed from a dict to a list of tuples (in order to handle multiple files with the same name under different paths, which is uncommon but possible); the code remains backwards-compatible with older siginfo files that use a dict however. Fixes [YOCTO #5245]. (Bitbake rev: e4d3077c5b0cc57964640512f3646c2d73c1d855) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Use lookup cache exclusivelyRichard Purdie2013-09-171-12/+3
| | | | | | | | | | All the values we need are already guaranteed to be in the lookupcache so rather than fetch variables again, just use the cache. This gives a small performance improvement and simplifies the code. (Bitbake rev: 8ffaba61da7f195d7c3b64dce35b6a56272aecae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: runqueue: Split runqueue to use bitbake-workerRichard Purdie2013-06-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a pretty fundamental change to the way bitbake operates. It splits out the task execution part of runqueue into a completely separately exec'd process called bitbake-worker. This means that the separate process has to build its own datastore and that configuration needs to be passed from the cooker over to the bitbake worker process. Known issues: * Hob is broken with this patch since it writes to the configuration and that configuration isn't preserved in bitbake-worker. * We create a worker for setscene, then a new worker for the main task execution. This is wasteful but shouldn't be hard to fix. * We probably send too much data over to bitbake-worker, need to see if we can streamline it. These are issues which will be followed up in subsequent patches. This patch sets the groundwork for the removal of the double bitbake execution for psuedo which will be in a follow on patch. (Bitbake rev: b2e26f1db28d74f2dd9df8ab4ed3b472503b9a5c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib: Use modern expcetion syntaxRichard Purdie2013-05-091-1/+1
| | | | | | (Bitbake rev: a4a37b6a83faa62f61433122c4583e93e64f7372) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: Add missing error message parameterRichard Purdie2013-05-091-1/+1
| | | | | | | | There is clearly a missing parameter from this error message, add it. (Bitbake rev: d98be5ea69b99fb7934fc3093422f139bc37a1cc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen: add quotes around variable values to see whitespaceMartin Jansa2013-03-041-4/+4
| | | | | | | | | | | | | | | | | | * without this change it's hard to see what's changed: bitbake-diffsigs sstate-cache/*/sstate-depmodwrapper-cross-cortexa8-vfp-neon-oe-linux-gnueabi-1.0-r0-cortexa8-vfp-neon-*_populate-sysroot.tgz.siginfo basehash changed from 62f28c13172d38af917716d6d4b15ac5 to 9cf38842bcc79e0a4356856a64141548 Variable TUNE_CCARGS value changed from -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 to -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 Hash for dependent task depmodwrapper-cross_1.0.bb.do_install changed from 4494cb6c117309a9b4c541ad86c0aac5 to 1e3bcf2d14e5bd30a38350b41bb98db3 * with this change, we can see extra trailing space in first version: basehash changed from 62f28c13172d38af917716d6d4b15ac5 to 9cf38842bcc79e0a4356856a64141548 Variable TUNE_CCARGS value changed from ' -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 ' to ' -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8' Hash for dependent task depmodwrapper-cross_1.0.bb.do_install changed from 4494cb6c117309a9b4c541ad86c0aac5 to 1e3bcf2d14e5bd30a38350b41bb98db3 (Bitbake rev: 7d85b1a383feaa072503d71d3baeb3bdcd1012a8) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Remove whitelisted vars from non-task depsChristopher Larson2013-02-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Though the value of variables in the BB_BASEHASH_WHITELIST is kept out of the checksums, dependency on them is not, at least for variables and non-task functions. In the code, the whitelist is removed from the overall task dep list, but not the individual variable deps. The result of this is that functions like sysroot_stage_all and oe_runmake end up with whitelisted variables like TERM listed in their dependencies, which means that doing a 'unset TERM' before building will result in all checksums for tasks that depend on those changing, and shared state reuse not behaving correctly. This is only really a potential issue for variables from the environment, as it's the existance/removal of the variable that's an issue, not its value, and the other whitelisted variables are set in our metadata. This which means in practical terms the only cases where this is likely to be an issue are in environments where one of the following are unset: TERM, LOGNAME, HOME, USER, PWD, SHELL. This may seem like an unlikely circumstance, but is in fact a real issue for those of us using autobuilders. Jenkins does not set TERM when executing shell, which means shared state archives produced by your jenkins server would not be fully reused by an actual user. Fixed by removing the whitelisted elements from the individual variable deps, not just the accumulated result. (Bitbake rev: dac12560ac8431ee24609f8de25cb1645572d350) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build/siggen.py: Avoid removing too many stamps when cleaningRichard Purdie2012-11-281-2/+1
| | | | | | | | | | | | | | | | The "*" part of the mask is to ensure we clean both any stamp, and any setscene varient. It turns out we would also trample other tasks, e.g. do_package_write could trample do_package_write_rpm. do_package also tramples do_package_write_* but this is less of an issue since the other tasks depend on it. Rather than use the wildcard, we can just use a list instead. [YOCTO #3484] (Bitbake rev: c14d831ea3f625e9a47266a0c4e6deefc924ca5a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: build/siggen: Add support for stamp 'clean' masksRichard Purdie2012-09-201-2/+11
| | | | | | | | | | | | | | | | | | | | | Currently when we execute a task, we don't remove other potentially stale stamps. This can mean if you switch between two different versions of a recipe without a clean, the build can get very confused. This patch adds in functionality to allow a wildcard expression of stamp files to be removed when creating a new stamp file. This patch adds in the core of the code to enable this but it also requires metadata support to enable it. When writing this improvement I went through several different options but this was the only way I could find to allow things like noexec tasks to function correctly (where stamps need to be created without the data store). [YOCTO #2961] (Bitbake rev: e026469b307522e5b6a680e0ae5587749d33dcae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake-diffsigs: allow specifying task & follow deps recursivelyPaul Eggleton2012-09-071-7/+10
| | | | | | | | | | | | | | | Add the ability to compare the two most recent runs of a specified task, and follow dependent hash changes recursively. This enables you to trace back and find exactly why a task was re-run after the fact. Note that this relies on the metadata providing a function, hooked in as bb.siggen.find_siginfo, which allows searching in the appropriate places to find signature data files. (Bitbake rev: cc70181659c07e04c205e17832846acf1ff31d28) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/siggen.py: make signature dump/compare functions return a listPaul Eggleton2012-09-071-30/+38
| | | | | | | | | | These functions become a little bit more reusable if they return a list containing the output rather than just printing it. (Bitbake rev: a0ad2a947b71abcc0a1244cf139b9e9dfd8ee049) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/siggen.py: insert a colon between class and recipe namePaul Eggleton2012-09-071-1/+1
| | | | | | | | | | | | | | | | | | | before: virtual:nativeautomake_1.12.1.bb.do_compile after: virtual:native:automake_1.12.1.bb.do_compile This separation ensures that the key is readable, and if necessary, parsable. Unfortunately this invalidates previous native sstate signatures with OE-Core - not much that can be done about that; however that occurs frequently during the development cycle so it's par for the course. (Bitbake rev: 5b96c32dad256090e9bda5af0f80c7dbcc90bde8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/siggen: replace tabs with spacesPaul Eggleton2012-09-071-17/+17
| | | | | | | | | | We had one section of the code mixing tabs with spaces, which is particularly undesirable with python code. (Bitbake rev: 8eaa093b179e03a6003a47220540b1bc73afca17) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: siggen.py: Insure .siginfo files writes into shared sstate cache ↵Jeffrey C Honig2012-07-171-4/+15
| | | | | | | | | | | | | are atomic Use tempfile.mkstemp to create a temporary file in the sstate dir and move it into place after closing. The previous code would fail in the chmod() if two users were running jobs that touched the same signature file. (Bitbake rev: ff11e9ac5eba2d957917664a7b91b1277d8ad548) Signed-off-by: Jeffrey C Honig <jeffrey.honig@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/siggen.py: log when tainting the signature of a taskPaul Eggleton2012-06-251-0/+1
| | | | | | | | | | | Log a note when applying a taint to a task signature (e.g. when using the -f or -C command line options) so that the user knows this has been done. (Bitbake rev: 0fd960fdea83874eedb541cbc2920257e0f3fb81) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: ensure -f causes dependent tasks to be re-runPaul Eggleton2012-06-211-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If -f is specified, force dependent tasks to be re-run next time. This works by changing the force behaviour so that instead of deleting the task's stamp, we write a "taint" file into the stamps directory, which will alter the taskhash randomly and thus trigger the task to re-run next time we evaluate whether or not that should be done as well as influencing the taskhashes of any dependent tasks so that they are similarly re-triggered. As a bonus because we write this file as <stamp file name>.taskname.taint, the existing code which deletes the stamp files in OE's do_clean will already handle removing it. This means you can now do the following: bitbake somepackage [ change the source code in the package's WORKDIR ] bitbake -c compile -f somepackage bitbake somepackage and the result will be that all of the tasks that depend on do_compile (do_install, do_package, etc.) will be re-run in the last step. Note that to operate in the manner described above you need full hashing enabled (i.e. BB_SIGNATURE_HANDLER must be set to a signature handler that inherits from BasicHash). If this is not the case, -f will just delete the stamp for the specified task as it did before. This fix is required for [YOCTO #2615] and [YOCTO #2256]. (Bitbake rev: f7b55a94226f9acd985f87946e26d01bd86a35bb) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: include varflags in checksumsPaul Eggleton2012-05-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add a dependency to each variable on a filtered list of its varflags. This is intended to catch things such as SRC_URI checksums, varflags controlling extra functionality from classes (e.g. the recently updated update-alternatives class in OE-Core), etc. and ensure their values influence the sstate checksums. There is an exclusion list which needs to be set via bitbake.conf (BB_SIGNATURE_EXCLUDE_FLAGS), if this is not set then the functionality is disabled. The existing vardepsexclude mechanism can also be used to exclude undesired varflags, but they must be fully specified, e.g.: do_patch[vardepsexclude] += "do_patch[someflag]" Implements [YOCTO #2517]. (Bitbake rev: 56c1ab18fcaf4ac245dcb412ed55e8e0af07883b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: implement checksums for local files in SRC_URIPaul Eggleton2012-05-231-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Gathers a list of paths to have checksums calculated at parse time, and processes these when calculating task hashes. Checksums are cached with the file's current mtime. Thus, changing any local file in SRC_URI will now cause the do_fetch taskhash to change, thus forcing a rebuild. This change adds very roughly about an 8% increase in parse time (a few seconds) and maybe a few seconds during runqueue generation, so a fairly moderate performance hit. Note that since paths are resolved at parse time, this will not force a rebuild when files are introduced which would cause that resolved path to be different - for example, where a machine-specific version of a file was added without otherwise changing the recipe. This will need to be handled in a future update. Code to hook this into the signature generator was courtesy of Richard Purdie <richard.purdie@linuxfoundation.org>. Implements [YOCTO #2044]. (Bitbake rev: c993b7c457f8b7776e8a5dff253bfa0724bc2cae) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bb/siggen.py: ensure dumped signatures have group R/WJoshua Lock2012-05-131-2/+4
| | | | | | | | | | We anticipate signatures being shared amongst peers in a group so ensure they have rw-rw-r-- permissions to facilitate this. (Bitbake rev: e4716f316152cafabebcefec7b387edeb02ad3eb) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/bb/siggen: use open() rather than the file constructorJoshua Lock2012-05-131-4/+4
| | | | | | | | | | | | | | | | The Python documentation states: "When opening a file, it’s preferable to use open() instead of invoking the file constructor directly." [1] Further in Python 3 direct use of the file constructor is no longer possible. 1. http://docs.python.org/library/functions.html#open (Bitbake rev: 759f953e29a7131614e5b1f0312edf2b17523675) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* siggen.py: Use basehash if no taskhashRobert Yang2012-03-121-1/+5
| | | | | | | | | | | | | | The bitbake-runtask doesn't work since there is no taskhash (it worked in the past, but seems recent changes made it doesn't work again), use the basehash when there is no taskhash, just like what dump_sigtask does. [YOCTO #1229] (Bitbake rev: b36f2e3803dfc494d5b171759f55faf33708e6f1) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/siggen: output filename on error in finalisePaul Eggleton2012-03-121-1/+5
| | | | | | | | | | | | | If an error occurs during finalise() (when for example we might get an expansion error in SRCPV), log a note which mentions which recipe was being finalised. Fixes [YOCTO #1782] (Bitbake rev: 56f9f8ffd92b00b916dbc2386150c83689d5beed) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>