Skip to content

Use bindgen to automatically generate boring-sys #11

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
Feb 19, 2021

Conversation

jedisct1
Copy link
Contributor

This ensures that all the Rust functions, types and constants always match the actual BoringSSL definitions.

It also removes quite a lot of manually maintained code, as well as the need for systest.

The value for SslOptions::ALL, for example, was wrong. On current BoringSSL versions, this is a no-op, and is set to 0.

Clearing it does nothing. So, the clear_ctx_options test, that passed by accident, was adjusted to use a different option.

The libc crate is not required, as we only use it for types that are already defined in the standard library. It was removed from boring-sys. The same can be done to other crates later.

@jedisct1 jedisct1 changed the title Use bindgen to automatically generate the boring-sys Use bindgen to automatically generate boring-sys Feb 11, 2021
@jedisct1
Copy link
Contributor Author

Fixes #10

@inikulin
Copy link
Collaborator

This is awesome, thanks!

Can we keep systest to ensure generated bindings validity? Also, it seems like it fails to compile on Windows

@jedisct1
Copy link
Contributor Author

jedisct1 commented Feb 12, 2021

The Windows CI issue is due to KyleMayes/clang-sys#121

Should be good now!

This ensures that all the Rust functions, types and constants
always match the actual BoringSSL definitions.

It also removes quite a lot of manually maintained code, as well
as the need for systest.

The value for `SslOptions::ALL`, for example, was wrong. On current
BoringSSL versions, this is a no-op, and is set to `0`.

Clearing it does nothing. So, the `clear_ctx_options` test, that
passed by accident, was adjusted to use a different option.

The `libc` crate is not required, as we only use it for types that
are already defined in the standard library. It was removed from
`boring-sys`. The same can be done to other crates later.
@jedisct1
Copy link
Contributor Author

Can we keep systest to ensure generated bindings validity?

bindgen is configured to generate layout tests for every single type it defines, so systest seems a bit redundant. systest also fails to parse the generated bindings due to a current bug in the syntex crate it depends on.

@inikulin
Copy link
Collaborator

@cbranch @ghedo @wbl could you take a look too pls?

@inikulin inikulin merged commit 8b67670 into cloudflare:master Feb 19, 2021
shahn pushed a commit to shahn/boring that referenced this pull request Oct 28, 2023
Put 1.70 in there (for instance if you want to pin against OnceLock stabilizing) and it will actually test 1.7 as it appears github auto converts this to a float?

Putting in quotes seems to do the right thing here
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.

3 participants