4ms / metamodule

MetaModule virtual patch module firmware
Other
9 stars 0 forks source link

Automatic git tag appended to build is sometimes one commit behind #338

Open LnnrtS opened 2 months ago

LnnrtS commented 2 months ago

I thought we fixed that (and the fix is present in the code) but it still doesn't work all the time

make --build --preset full 
[0/2] Re-checking globbed directories...
[0/14] Creating assets uimg file
[3/14] Tagging git revision
Git hash: d5f5abcca. Commit time: 2024-08-21 16:28:05 +0200. Tag: firmware-v1.0.1-11-gd5f5abcca
...
[10/12] Creating releases at metamodule/firmware/build/metamodule-firmware-v1.0.1-10-gda66fd3cf-*.zip
danngreen commented 2 months ago

Yeah I noticed this as well. It seems that the git tag is put into the generated files in the build dir, but updating those files doesn't trigger a re-build of the main binary. I poked at it for a little while and didn't see the cause.

You can make it not work by tagging a commit, then building. It will use the tag of the previous commit. But if you make a new commit, it will use the new tag.

When I need a certain tag, e.g. for a release, a clean build fixes it (though if you do make clean you have to also rebuild the api-symbol list with make new-api-sym-list && make. Since CI uses clean builds, it's not a problem for tagging releases, just for locally keeping track of versions.

LnnrtS commented 2 months ago

The last line in log above is just printing a cmake variable so even that on is not set correctly