1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00

build(core): fix prodtest build from build-docker

build-docker.sh will unconditionally pass in a value for the
VENDOR_HEADER envvar. This is a problem if the user didn't specify one,
because the value inside the container is going to be empty string.

We make prodtest look at whether the value of VENDOR_HEADER is truthy
instead of a literal None. Which is a correct logic: if the user
deliberately sets the value to an empty string, the build will fail
anyway, so we ignore such value.
This commit is contained in:
matejcik 2024-04-18 15:21:56 +02:00 committed by matejcik
parent f0c7cc4e8e
commit 66b96bc279

View File

@ -196,9 +196,9 @@ obj_program.extend(env.Object(source=SOURCE_HAL))
MODEL_IDENTIFIER = tools.get_model_identifier(TREZOR_MODEL)
if (vh := ARGUMENTS.get("VENDOR_HEADER", None)) is not None:
if (vh := ARGUMENTS.get("VENDOR_HEADER", None)):
VENDORHEADER = vh
elif (vh := os.environ.get("VENDOR_HEADER", None)) is not None:
elif (vh := os.environ.get("VENDOR_HEADER", None)):
# TODO looking at envvars in a build script is not very nice. But justifiable in case
# of vendor header which does not affect reproducibility of the build. Nonetheless,
# we should figure out a cleaner way to pass in this argument, without having to teach