Skip to content

capi: add pathrs_version API#375

Merged
cyphar merged 4 commits into
mainfrom
version-api
May 21, 2026
Merged

capi: add pathrs_version API#375
cyphar merged 4 commits into
mainfrom
version-api

Conversation

@cyphar
Copy link
Copy Markdown
Owner

@cyphar cyphar commented May 21, 2026

This API is extensible, which will allow us to add additional
information in the future (such as API levels or feature bitflags).

Closes #370
Signed-off-by: Aleksa Sarai aleksa@amutable.com

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cyphar cyphar force-pushed the version-api branch 4 times, most recently from 26a455f to 419eded Compare May 21, 2026 15:52
@cyphar cyphar force-pushed the version-api branch 3 times, most recently from 3591b13 to e5b416f Compare May 21, 2026 16:31
cyphar added 2 commits May 22, 2026 02:45
This is a partial revert of 797b29e.

For some reason CI doesn't like this, but my local mypy really needs
this ignore line, otherwise you get annoying errors like:

  $ make -C ./contrib/bindings/python lint
  pathrs/_internal.py:96: error: Non-overlapping equality check (left operand type: "CError", right operand type: "CType")  [comparison-overlap]

Fixes: 797b29e ("mypy: fix new errors")
Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This is loosely based on the copy_struct_to_user() helper and mostly
mirrors the existing copy_from_extensible_struct port. This is going to
be needed for the version API as well as potentially some other future
APIs.

Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
@cyphar cyphar changed the title capi: add pathrs_version() API capi: add pathrs_version API May 21, 2026
cyphar added 2 commits May 22, 2026 02:46
This API is extensible, which will allow us to add additional
information in the future (such as API levels or feature bitflags).

Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
This is mostly trivial, except for the Rust test binary -- because
pathrs-cmd is not part of the pathrs crate, there appears to be no
straightforward way of getting the version of a dependency via build
scripts. (The only communication channel via DEP_* is a links-only
feature and probably is bad to use for other reasons.)

So, add a #[doc(hidden)] static constant that includes the crate version
for this purpose.

Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
@cyphar cyphar added this to the 0.2.5 milestone May 21, 2026
@cyphar cyphar merged commit 036f595 into main May 21, 2026
119 checks passed
@cyphar cyphar deleted the version-api branch May 21, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant