libdragon icon indicating copy to clipboard operation
libdragon copied to clipboard

Generate install directory artifact with git commit information

Open gobbledygoober opened this issue 9 months ago • 4 comments

Originally discussed on Discord.

Despite the fact that rebuilding libdragon takes just a few minutes, it would be helpful if the install directory included a record of the libdragon git commit (and possibly branch) that was used when ./build.sh last ran.

This would cater to the cases such as:

  1. A developer has, for example, an installed libdragon from the stable branch, and a separate one for preview.
  2. Wants to build a project that used libdragon, and wants to see how close their libdragon submodule commit is to their existing libdragon install.

Perhaps as a follow-up task, there could be value in making the string available to libdragon itself. Per @rasky:

you might stamp it as string in the binary in case somebody finds a ROM and wants to know which version of libdragon that was

rasky noted that features like this can be a slippery slope, because full reproducibility information could require gcc, newlib, etc ... versions.

Those other versions seem out scope for now, but something simple in a location like these could be useful:

  • $(INSTALLDIR)/version.txt
  • $(INSTALLDIR)/mips64-elf/include/version.h
  • Some mechanism in n64.mk

gobbledygoober avatar Mar 17 '25 14:03 gobbledygoober