Ticket #43879

generate_gitrev.sh: Relative path to output file does not work

Open Date: 2022-02-16 23:03 Last Update: 2022-02-19 19:25

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
2

Details

generate_gitrev.sh writes output file relative to input (source) directory, not to the directory it was executed from.

This breaks meson builds 'gitrev' option. (gone unnoticed this far because there often is fc_gitrev_gen.h generated by earlier autotools build)

Ticket History (3/6 Histories)

2022-02-16 23:03 Updated by: cazfi
  • New Ticket "generate_gitrev.sh: Relative path to output file does not work" created
2022-02-16 23:34 Updated by: cazfi
Comment

That the gitrev build with autotools goes through is by luck. It's supposed to generate the fc_gitrev_gen.h to the build dir: '$(top_builddir)/common/fc_gitrev_gen.h' -> '../common/fc_gitrev_gen.h'. With that output file name it actually gets generated to the source directory, and gets used from there.

2022-02-16 23:40 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
2022-02-19 19:25 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed
Comment

This has been pushed in, and no fc_gitrev_gen.h should get generated to a wrong location any more. Nothing removes the old stale files that may exist from older builds, and which now pose a risk of getting used instead of a freshly generated correct one. People should check their source trees, if different from a build tree, for common/fc_gitrev_gen.h and remove it if it exist. If one does not use separate build dir, but source dir = build dir, then the file's correct location is that common/fc_gitrev_gen.h. This is also why 'git status' won't show the file in the source dir. It's listed in .gitignore for the build dir = source dir case.

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login