Lix should provide pragmas for major, minor, and patch version. #1038

Open
opened 2025-11-18 05:49:02 +00:00 by bacchanalia · 3 comments
Member

When linking against lix from external tools, it would be nice to have numeric LIX_MAJOR, LIX_MINOR, and LIX_PATCH pragmas available to make it easier to build tools that can be build against multiple lix versions. PACKAGE_VERSION is not sufficient because it's not possible (or at least not easy) to parse in CPP.

I ran into this issue when updating nix-serve-ng to work with lix-2.93, which I solved by using

 #if __has_include (<lix/libutil/async.hh>)

but future cases such a work around might not be available.

When linking against lix from external tools, it would be nice to have numeric LIX_MAJOR, LIX_MINOR, and LIX_PATCH pragmas available to make it easier to build tools that can be build against multiple lix versions. PACKAGE_VERSION is not sufficient because it's not possible (or at least not easy) to parse in CPP. I ran into this issue when updating nix-serve-ng to work with lix-2.93, which I solved by using ```cpp #if __has_include (<lix/libutil/async.hh>) ``` but future cases such a work around might not be available.
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/4609 ("libutil: include LIX_MAJOR, LIX_MINOR, and LIX_PATCH macros")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/4609", "number": 4609, "kind": "commit message"}], "cl_meta": {"4609": {"change_title": "libutil: include LIX_MAJOR, LIX_MINOR, and LIX_PATCH macros"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/4609](https://gerrit.lix.systems/c/lix/+/4609) ("libutil: include LIX_MAJOR, LIX_MINOR, and LIX_PATCH macros")
Owner

@qyriad I think it makes sense to backport this for 2.93.4 and 2.94.1 I suppose?

@qyriad I think it makes sense to backport this for 2.93.4 and 2.94.1 I suppose?
Owner

Probably, yes

Probably, yes
qyriad reopened this issue 2025-11-20 12:02:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1038
No description provided.