Skip to content
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

pkgconfig files have no version number #2329

Closed
kermitdafrog8 opened this issue Mar 18, 2022 · 16 comments · Fixed by #2345
Closed

pkgconfig files have no version number #2329

kermitdafrog8 opened this issue Mar 18, 2022 · 16 comments · Fixed by #2345

Comments

@kermitdafrog8
Copy link

The pkgconfig files have no version number causing other applications not to detect proper version during configure process.

@diabonas
Copy link
Member

All pkg-config files distributed by tpm2-tss do include a version field, e.g.

Version: @VERSION@

What is the exact error message you see when running ./configure for one of the affected applications using tpm2-tss? And how did you obtain or build tpm2-tss?

@kermitdafrog8
Copy link
Author

kermitdafrog8 commented Mar 21, 2022

I downloaded the 3.2.0 source tarball. After installation in my /usr/lib64/pkgconfig directory I get files like this
Taken from the tss2-mu.pc file.

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=${prefix}/include

Name: tss2-mu
Description: TPM2 type marshaling and unmarshaling library.
URL: https://github.com/tpm2-software/tpm2-tss
Version: (version missing here had to manually enter for the library needed to be found with proper version number)
Cflags: -I${includedir} -I${includedir}/tss2
Libs: -ltss2-mu -L${libdir}

The program said it found the dependency but didn't find the right version number to match required. The pkgconfig file showed no version number so I manually entered the version to fix the issue. This might not be an issue any more or just a fluke on my end but just wanted to make you aware of it.

@AndreasFuchsTPM
Copy link
Member

Ok, I think I got the problem.
We retrieve the version from git. But the .tar.gz does not contain git information anymore...
That's bad...
@williamcroberts Should we move the git describe --tags from configure to bootstrap and somehow include it from a file into configure or what should we do ?

@williamcroberts
Copy link
Member

williamcroberts commented Mar 21, 2022

@AndreasFuchsSIT the release packages do not require a git repo, so I am assuming when @kermitdafrog8 downloaded the source tarball, that was the one generated by github. That one does not work. The solution is to always use the release tarballs. I wish Github would let me turn off that feature. We probably need to make sure this is documented somewhere.

@AndreasFuchsTPM
Copy link
Member

I guess the same is true, if you call bootstrap or autoconf on the release tarball (as per our instructions).
Since configure.ac is part of the release tarball this will in the end not work.
I guess my Question is: how do we remove configure.ac from the release tarball.
And of course we need to update the INSTALL.md

@kermitdafrog8
Copy link
Author

Why not get the version number from the CHANGELOG?

@williamcroberts
Copy link
Member

I guess the same is true, if you call bootstrap or autoconf on the release tarball (as per our instructions). Since configure.ac is

In my tarballs I didn't include bootstrap, so you would have to call autoconf directly which I don't think any of our instructions do.

part of the release tarball this will in the end not work. I guess my Question is: how do we remove configure.ac from the release tarball. And of course we need to update the INSTALL.md

@williamcroberts
Copy link
Member

Why not get the version number from the CHANGELOG?

parsing, no real need to add that complexity. If you just get the distribution tarball and run ./configure, it all just works.

@AndreasFuchsTPM
Copy link
Member

AndreasFuchsTPM commented Mar 21, 2022

Why not get the version number from the CHANGELOG?

Because inbetween releases we do not update the CHANGELOG file but instead track changes in the github milestone.
So all dirty builds would fail.
EDIT: not fail, but report some old version instead of the current git commit...

Did you however call autoreconf or use the github-source-tarball ?

@AndreasFuchsTPM
Copy link
Member

In my tarballs I didn't include bootstrap, so you would have to call autoconf directly which I don't think any of our instructions do.

Still, do you know how to remove configure.ac from distfiles ?

@williamcroberts
Copy link
Member

Why not get the version number from the CHANGELOG?

Because inbetween releases we do not update the CHANGELOG file but instead track changes in the github milestone. So all dirty builds would fail.

Duh, good point. git describe handles all of that.

@williamcroberts
Copy link
Member

In my tarballs I didn't include bootstrap, so you would have to call autoconf directly which I don't think any of our instructions do.

Still, do you know how to remove configure.ac from distfiles ?

no idea

@diabonas
Copy link
Member

Something like git-version-gen might work: it tries to run git describe to get the version, but can fall back to a .tarball-version file embedded into release tarballs if that fails. It is used like

AC_INIT([tpm2-tss],
        [m4_esyscmd([build-aux/git-version-gen .tarball-version])],
        [https://github.com/tpm2-software/tpm2-tss/issues],
        [],
        [https://github.com/tpm2-software/tpm2-tss])

This way autoreconf can still be run on release tarballs (e.g. to apply patches to the build system) while preserving the version number. The auto-generated git-archive tarballs from GitHub still won't work, but I think this is out of scope anyway.

buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Apr 4, 2022
This reverts commit ed13a65 as it
has the following non trivial issues:
 - pkgconfig files have no version number if we run autoreconf
   (tpm2-software/tpm2-tss#2329) resulting in
   the following build failures with tpm2-{abrmd,pkcs11} or libsecret:

   configure: error: Package requirements (tss2-esys >= 2.0) were not met:

   Package dependency requirement 'tss2-esys >= 2.0' could not be satisfied.
   Package 'tss2-esys' has version '', required version is '>= 2.0'

 - addgroup/groupadd and adduser/useradd are mandatory since
   tpm2-software/tpm2-tss@7fde604:

    configure: error: addgroup or groupadd are needed.

It seems better to find an upstreamable solution to both issues before
bumping.

Fixes:
 - http://autobuild.buildroot.org/results/d4d6807af3493deb47951c6f11f427040e5c5e11
 - http://autobuild.buildroot.org/results/a304e45bacb8cd7e7ea9bc49e4a8ec9359ca0a3a
 - http://autobuild.buildroot.org/results/be0befa81e955ac8cf16f9d20723f9b9b174e012
 - http://autobuild.buildroot.org/results/d4ebee400423f6df51613193c86db3c58c94ff88

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
@gotthardp
Copy link
Contributor

gotthardp commented Apr 9, 2022

+1

Yocto/OpenEmbedded always calls autoreconf as a part of the standard processing of autotools-based recipes. I would also prefer if it was possible to call autoreconf on release tarballs without having the version information cleared. Removing configure.ac would make the situation for Yocto even worse: now I can at least patch the configure.ac with a static version number.

@gotthardp
Copy link
Contributor

gotthardp commented Apr 10, 2022

Actually, the tpm2-abrmd uses a different approach based on a VERSION file generated by bootstrap. This allows calling autoreconf and works perfectly with Yocto. Couldn't we just use this approach everywhere else too?

@williamcroberts
Copy link
Member

Actually, the tpm2-abrmd uses a different approach based on a VERSION file generated by bootstrap. This allows calling autoreconf and works perfectly with Yocto. Couldn't we just use this approach everywhere else too?

That's fine, accomplishes the same task. Just make sure we add it to EXTRA_DIST so it gets rolled up into the release tarball.

gotthardp added a commit to gotthardp/tpm2-tss that referenced this issue Apr 14, 2022
This way autoreconf can still be run on release tarballs (e.g. to
apply patches to the build system) while preserving the version number.

The tpm2-abrmd already uses this approach.

Fixes: tpm2-software#2329

Signed-off-by: Petr Gotthard <petr.gotthard@centrum.cz>
gotthardp added a commit to gotthardp/tpm2-tss that referenced this issue Apr 14, 2022
This way autoreconf can still be run on release tarballs (e.g. to
apply patches to the build system) while preserving the version number.

The tpm2-abrmd already uses this approach.

Fixes: tpm2-software#2329

Signed-off-by: Petr Gotthard <petr.gotthard@centrum.cz>
JuergenReppSIT pushed a commit that referenced this issue Apr 19, 2022
This way autoreconf can still be run on release tarballs (e.g. to
apply patches to the build system) while preserving the version number.

The tpm2-abrmd already uses this approach.

Fixes: #2329

Signed-off-by: Petr Gotthard <petr.gotthard@centrum.cz>
JuergenReppSIT pushed a commit that referenced this issue Apr 19, 2022
This way autoreconf can still be run on release tarballs (e.g. to
apply patches to the build system) while preserving the version number.

The tpm2-abrmd already uses this approach.

Fixes: #2329

Signed-off-by: Petr Gotthard <petr.gotthard@centrum.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants