From bbfef572a25878f731566c8280814355b500e375 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 2 Jul 2022 15:28:13 +0200 Subject: Add note on version we save in pkg-config files --- libbuild2/cc/pkgconfig.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libbuild2/cc/pkgconfig.cxx b/libbuild2/cc/pkgconfig.cxx index 8b064d1..acf8266 100644 --- a/libbuild2/cc/pkgconfig.cxx +++ b/libbuild2/cc/pkgconfig.cxx @@ -1809,6 +1809,20 @@ namespace build2 fail << "no version variable in project " << n << info << "while generating " << p; + // When comparing versions, pkg-config uses RPM semantics, which is + // basically comparing each all-digit/alpha fragments in order. + // This means, for example, a semver with a pre-release will be + // compared incorrectly (pre-release will be greater than the final + // version). We could detect if this project uses stdver and chop + // off any pre-release information (so, essentially only saving the + // major.minor.patch part). But that means such .pc files will + // contain inaccurate version information. And seeing that we don't + // recommend using pkg-config (rather primitive) package dependency + // support, having complete version information for documentation + // seems more important. + // + // @@ Maybe still makes sense to only save version.project_id? + // const string& v (cast (vl)); os << "Name: " << n << endl; -- cgit v1.1