Skip to content

Ensure PACKAGE_VERSION is set in the Makefile#2570

Merged
pd3 merged 1 commit into
samtools:developfrom
daviesrob:check-package-version-set
Jun 18, 2026
Merged

Ensure PACKAGE_VERSION is set in the Makefile#2570
pd3 merged 1 commit into
samtools:developfrom
daviesrob:check-package-version-set

Conversation

@daviesrob

Copy link
Copy Markdown
Member

In git repositories, this is set by expanding $(shell git describe --always --dirty).
As this is not in a normal Makefile rule, failure just results in an empty variable. To check that it really was set, add a check to ensure it's not empty in the rule that builds the version.h file.

See also samtools/samtools#2337 where failing to set this variable resulted in broken files. It's less of a problem for bcftools due as it always appends the string "+htslib" to its headers, however it's probably a good idea to catch the failue to set a value if it occurs.

In git repositories, this is set by expanding
  $(shell git describe --always --dirty).
As this is not in a normal Makefile rule, failure just results in an
empty variable.  To check that it really was set, add a check to
ensure it's not empty in the rule that builds the version.h file.

Signed-off-by: Rob Davies <rmd+git@sanger.ac.uk>
@pd3 pd3 merged commit f3e12f6 into samtools:develop Jun 18, 2026
8 checks passed
@pd3

pd3 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Thank you

@daviesrob daviesrob deleted the check-package-version-set branch June 19, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants