-
Notifications
You must be signed in to change notification settings - Fork 411
Add developer guideline notes for C/C++ bindings generation #688
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
Changes from all commits
83322e1
dbf4f58
53182a8
dce831e
3fa0548
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,17 @@ Fuzzing is heavily encouraged: you will find all related material under `fuzz/` | |
|
||
Mutation testing is work-in-progress; any contribution there would be warmly welcomed. | ||
|
||
C/C++ Bindings | ||
-------------- | ||
|
||
You can learn more about the C/C++ bindings that are made available by reading the | ||
[C/C++ Bindings README](lightning-c-bindings/README.md). If you are not using the C/C++ bindings, | ||
you likely don't need to worry about them, and during their early experimental phase we are not | ||
requiring that pull requests keep the bindings up to date (and, thus, pass the bindings_check CI | ||
run). If you wish to ensure your PR passes the bindings generation phase, you should run the | ||
`genbindings.sh` script in the top of the directory tree to generate, build, and test C bindings on | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed a lot of the build process uses shell scripts. What does the supported build platform matrix look like? Is all the tooling mostly focused on mac/linux or are there Windows use cases? In general, how much of the entire project (lightning/tokio/c-bindings/etc) should be buildable on Mac and Windows? Trying to wrap my head around the supported platform matrix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, I don't think we have anyone working with/spending too much time on Windows, but if you're less interested in testing and only want a shared library build, just running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running c-bindings-gen/target/ Should this end up in target/ or .gitignore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. That makes sense why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified the target files are now ignored in 74cd3c9. Thanks! |
||
your local system. | ||
|
||
Going further | ||
------------- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative could be to also run
genbindings.sh
with thecontinue-on-error
keyword. That way we could still see the output if it gets out of sync, but it doesn't prevent the job from failing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm not sure what the value would be - if the bindings fall out of sync,
genbindings.sh
isn't going to give you a lot of useful output thatcargo check
isn't? I added it in part to short-circuit all the /stuff/ if things are stale anyway (because the intent would be one of the full-timers or regular contributors can go fix it later).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understanding the lifecycle for the generated code makes this clearer. I guess you would have to pair
genbindings.sh
with agit diff
or something to show that "hey it's out of sync" sincecargo check
doesn't always identify mismatches, but that isn't really the goal so it seems fine as-is.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build script a bit further doesn't does do some
git diff
stuff (though noting that the bindings aren't fully deterministic in terms of ordering, so letting that fluctuate a bit), butcargo check
is a much quicker way to get that.