Skip to content

CI: test building libbpf-rs with libbpf-sys #55

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

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

danielocfb
Copy link
Collaborator

@danielocfb danielocfb commented Jan 11, 2023

libbpf-sys aims to adhere to semantic versioning rules and indicate incompatible changes by bumping major version numbers. However, it is sometimes hard to identify breaking changes in advance and so breakage may happen unintentionally. Detecting of such breaking changes also becomes harder with auto-generated code, and libbpf-sys has a bunch of that, owing due to it binding to a C library. For example, in libbpf-rs [0] we have encountered a case where we were relying on a bindgen generated type exported by libbpf-sys that got removed because bindgen changed its behavior, which effectively resulted in a semver violation.

To aid with the detection such unintended incompatibilities, this change adds a CI step that builds the most recent published version of libbpf-rs with the current libbpf-sys snapshot, to flag accidental breakage.

[0] libbpf/libbpf-rs#303

Closes: #53
Signed-off-by: Daniel Müller [email protected]

libbpf-sys aims to adhere to semantic versioning rules and indicate
incompatible changes by bumping major version numbers. However, it is
sometimes hard to identify breaking changes in advance and so breakage
may happen unintentionally. Detecting of such breaking changes also
becomes harder with auto-generated code, and libbpf-sys has a bunch of
that, owing due to it binding to a C library. For example, in libbpf-rs
[0] we have encountered a case where we were relying on a bindgen
generated type exported by libbpf-sys that got removed because bindgen
changed its behavior, which effectively is a semver violation.

To aid with the detection such unintended incompatibilities, this change
adds a CI step that builds the most recent published version of
libbpf-rs with the current libbpf-sys snapshot, to flag accidental
breakage.

[0] libbpf/libbpf-rs#303

Closes: libbpf#53
Signed-off-by: Daniel Müller <[email protected]>
@danielocfb
Copy link
Collaborator Author

Here is a test run with a problem similar to what we saw earlier with size_t and how this step detected the incompatibility: https://github.com/danielocfb/libbpf-sys/actions/runs/3897219774

@alexforster
Copy link
Member

Apologies for the late follow-up. This looks great. I'm going to merge this and then go a bit further by making it a prerequisite for the publish step.

@alexforster alexforster merged commit e8afb2b into libbpf:master Jan 26, 2023
@alexforster alexforster self-assigned this Jan 26, 2023
@alexforster alexforster added the enhancement New feature or request label Jan 26, 2023
@danielocfb danielocfb deleted the topic/libbpf-rs branch January 26, 2023 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test that libbpf-rs compiles without error in CI
3 participants