build: add commit sha to bitcoinkernel.pc #23
+50
−71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 tobitcoinkernel.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.