Skip to content

Build issue: Build picks up wrong git info #10995

@ferdnyc

Description

@ferdnyc

This is similar to #10643, but coming from a different angle.

Describe the bug
I'm building in a Fedora tree where:

  1. Our packaging configs are a Git repo, say it's /src/doxygen/
  2. The package uses doxygen-1.11.0.src.tar.gz (the source tarball) as its source
  3. Local builds are done by extracting the tarball to /src/doxygen/doxygen-1.11.0
  4. git commands inside the doxygen-1.11.0 source directory will therefore work, and return data from /src/doxygen/.git.

To Reproduce

mkdir /tmp/doxygen-test
cd /tmp/doxygen-test
git init
touch dummy-file.txt
git commit -m "Initial commit" dummy-file.txt

# The output here will be something like 'heads/main-0-<shorthash>'
git describe --all --long

wget 'https://www.doxygen.nl/files/doxygen-1.11.0.src.tar.gz'
tar xf doxygen-1.11.0.src.tar.gz
cd doxygen-1.11.0
cmake -B _build -S .
cmake --build _build

Expected behavior
Doxygen builds with no Git version

Actual behavior
doxygen --version shows 1.11.0 (<the_hash_from_git_describe_above>*)

Version
Building 1.11.0 from source

Additional editorializing
IMHO it would be better to just look for a .git directory at the root of the Doxygen source, and disable all Git processing unless one's found. Blindly running git commands and making decisions based on whether or not they succeed is far too error-prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions