zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.71k stars 6.54k forks source link

allow additional extra_post_build_commands to be executed before any other post_build_commands #53062

Open rlezuo1 opened 1 year ago

rlezuo1 commented 1 year ago

Is your enhancement proposal related to a problem? Please describe. We need to include into resulting binaries timestamps and key-material.

Describe the solution you'd like

Describe alternatives you've considered There already is extra_post_build_commands, but it is run AFTER the CONFIG_BUILDOUTPUT* targets, i.e. the binary patching must be implemented for ELF, HEX and BIN in parallel.

Additional context commit ecdea1c30c implements custom hooks, but only AFTER,

marc-hb commented 11 months ago

Why not just turn on timestamps with a new Kconfig? Something like:

builder$ west build -- -DCONFIG_TIMESTAMPS=y

EDIT just for the record: https://docs.zephyrproject.org/latest/develop/west/extensions.html

arbrauns commented 11 months ago

I can't find a CONFIG_TIMESTAMPS anywhere in the zephyr tree, are you suggesting creating it in a custom Kconfig? If so, what should its effect be and how would it help with the problem at hand?

marc-hb commented 11 months ago

are you suggesting creating it in a custom Kconfig?

Yes

If so, what should its effect be

You sound like you already have a way to break build reproducibility and incremental builds. I'm merely suggesting you don't enable it by default but only when you need it.