[PATCH 01/10] build: Generate build hash

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Feb 24 18:01:39 UTC 2021


On 24/02/2021 18:55, Gedare Bloom wrote:

> On Wed, Feb 24, 2021 at 6:57 AM Sebastian Huber
> <sebastian.huber at embedded-brains.de>  wrote:
>> Update #4265.
>> ---
>>   wscript | 27 ++++++++++++++++++++++++++-
>>   1 file changed, 26 insertions(+), 1 deletion(-)
>>
>> diff --git a/wscript b/wscript
>> index 6626fafb74..83c7c446bb 100755
>> --- a/wscript
>> +++ b/wscript
>> @@ -1359,6 +1359,30 @@ def get_compiler(conf, cp, variant):
>>       return value
>>
>>
>> +def _generate_build_hash(conf):
>> +    import hashlib
>> +    import base64
>> +
>> +    build_hash = ""
>> +    for key in sorted(conf.env):
>> +        build_hash = build_hash + key + str(conf.env[key])
>> +    for discard in [
>> +        conf.env.PREFIX,
>> +        conf.bldnode.make_node(conf.env.VARIANT).abspath(),
>> +        conf.path.abspath(),
>> +    ]:
>> +        build_hash = build_hash.replace(discard, "")
>> +    state = hashlib.sha256()
>> +    state.update(build_hash.encode("utf-8"))
>> +    conf.define(
>> +        "RTEMS_BUILD_HASH",
>> +        base64.urlsafe_b64encode(state.digest()).decode("utf-8"),
>> +    )
>> +    conf.write_config_header(
>> +        conf.env.VARIANT + "/cpukit/include/rtems/build-hash.h"
> Is this injecting a file in the source tree?
>
No, it is in the build tree, for example:

build/arm/realview_pbx_a9_qemu/cpukit/include/rtems/build-hash.h

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list