-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong version reported by --version option #122
Comments
Thanks for submitting this issue. I'm not really aware of how the library packaging in various distributions work, but this does seem like it might be quite problematic. The original intention of this feature was for us to get users to report the exact state of the libcamera-apps and libcamera trees for the builds if they had problems. Running
which implies that the source tree that the libraries were built from does not seem to be a git repo. Given I know nothing about how all of this works on the disto side, I am not sure how to proceed. @XECDesign, we will probably need some guidance from you here, any thoughts? |
Yes, indeed that's why I originally wanted to get the version exposed by libcamera. And of course, if built from a tar-ball - then there is no git log to capture the version / sha1 from - so we'd have to find another way to identify it anyway. |
Right, debian packages are built from source tarballs which don't contain version control files in them. If you run I could patch it to do something different, like extract the version from debian/changelog at build time, but that wouldn't address it on other distros. |
Basically at the build system there is an information about the version either in the form of tag or gitsha, it's just a matter of providing an option to pass that to cmake, meson, etc. Please consider to add a possibility to pass e.g. |
Ok, having a version string passed in as a cmake variable sounds plausible. This string really wants to be the sha-1 of the top commit, and if no version string is passed, we do what we do right now. @kbingham, would you consider a similar change for the libcamera library builds? Otherwise, libcamera will also report a version string of 0.0. I'd be happy to make the change and submit for review if you think that would be an acceptable approach. |
At least initially yes, I think letting us override the version at build time makes sense. That means if the distro takes away our versioning, they are responsible for setting it again. I expect Javier @ Redhat will have opinions too as he's recently been packaging libcamera RPMs. |
With #124 now merged, this can be closed. |
The --version option report wrong version:
The correct versions are:
which translates to:
respectively.
The problem comes from the fact that the RPM build system (but it applies to many other build systems) fetches tarball based on the gitsha from github and such a tarball is then converted to git repository where other local patches can be easilly applied.
Please note, that the git repository created by the build system does not have any references to the original github repository (tarball does not convery git repository - see Source0 example below). Not to mention that when no patches are to be applied then the git repository might not be created out of tarball.
So, please consider to use other more reliable system for retrieving software version as the case that original git repository will be used is very uncommon for most linux distributions.
Example what I currently use for building libcamera-apps (source tarball + patch):
The text was updated successfully, but these errors were encountered: