Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939141 - sci-electronics/kicad-8.0.3-r1 determines version string through git
Summary: sci-electronics/kicad-8.0.3-r1 determines version string through git
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Zoltan Puskas
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-05 19:23 UTC by Esteve Varela Colominas
Modified: 2024-10-13 09:06 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esteve Varela Colominas 2024-09-05 19:23:27 UTC
When configuring kicad, I see the following messages:

-- Found Git: /usr/bin/git (found version "2.44.2")
-- Using Git to determine build version string.
-- git describe returned error 128: fatal: not a git repository (or any parent up to mount point /var)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

-- git rev-parse returned error 128: fatal: not a git repository (or any parent up to mount point /var)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

-- git rev-list --count returned error 128: fatal: not a git repository (or any parent up to mount point /var)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

These checks are performed in a few places in the cmake files, and defined in cmake/CreateGitVersionHeader.cmake.
While kicad does fall back to an internally specified version number (cmake/KiCadVersion.cmake), having this behavior in there can cause the version to be reported wrong in the compiled package.
I think the best way to deal with this is appending a no-op macro to the CreateGitVersionHeader.cmake file.
Comment 1 Zoltan Puskas 2024-10-13 05:32:27 UTC
I'm wondering how realistic this scenario is. For this to happen you'd need the following to happen:

- have a valid .git directory somewhere on the path of /var/tmp/portage (or whavever $PORTAGE_TMPDIR/tmp is if user set that)
- .git directory has to be owned by `portage` user
- or in the `portage` user's home directory have a .gitconfig file that declares said .git directory on the path to be safe

Otherwise this check will always fail and we will never pick up a random git commit hash. FWIW I've tested this locally to be the case.

I just don't see this happening on a user system in general. However if someone is emerging kicad-9999 we want this feature, since that is coming from a git repository.

While it does print some warning messages during configure time, I don't think this is worth investing time into.
Comment 2 Esteve Varela Colominas 2024-10-13 09:06:05 UTC
The most likely scenario in my opinion is a dotfile management scheme that makes $HOME a git repository (I've seen various people do this), and installing Gentoo Prefix in $HOME (which is also the default).

Anyway I think it's good to try to minimize the possibility for miscompilation due to effects in the environment, for the same reason we avoid automagic deps.