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

build: add commit sha to bitcoinkernel.pc #23

Open
wants to merge 2 commits into
base: kernelApi
Choose a base branch
from

Conversation

stickies-v
Copy link

In the current experimental phase of bitcoinkernel, we don't offer any versioning, interface guarantees, backwards compatibility, ... This means that in practice, any software with a dependency on bitcoinkernel cannot use semver for its dependency management, but needs to specify (and ideally/usually bundle) the exact version it was built for.

Initially, I was looking at adding a kernel_Version* kernel_get_version() function to expose version and commit information, allowing downstream to provide users and build systems with better feedback when they're using a wrong bitcoinkernel version. Because this information is mostly useful at install or compile time, rather than runtime, I pivoted towards the approach in this PR, adding the commit sha to bitcoinkernel.pc.

This PR makes changes such as stickies-v/py-bitcoinkernel@772f562 very straightforward to implement.

Note: I'm not very experienced with CMake, and this is the cleanest/minimal diff I could come up with to achieve this goal, but I'm very much not confident that there aren't much better alternatives to do so.

This allows future commits to use the get_git_info function
to access git commit info
As long as the bitcoinkernel shared library does not offer any interface
guarantees, versioning, or backwards compatibility, exposing the
build git commit (if it exists) allows the user's build system to
do some kind of dependency management.
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