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

How to build without rcgen and without ring? #1404

Open
xnox opened this issue Dec 24, 2024 · 3 comments
Open

How to build without rcgen and without ring? #1404

xnox opened this issue Dec 24, 2024 · 3 comments

Comments

@xnox
Copy link

xnox commented Dec 24, 2024

rcgen should be an optional feature, and yet it seems to be always compiled...

# install cargo-auditable plugin
cargo install cargo-auditable
# install rust-audit-info inspection binary
cargo install rust-audit-info
# build ztunnel binary with audit information, no default features, just tls-boring feature
# expectation is that this binary does not pull in rcgen nor ring
cargo auditable build --bin ztunnel --no-default-features --features tls-boring --release
# observe that rcgen & ring packages are pulled into ztunnel binary
rust-audit-info ./out/rust/release/ztunnel | jq -r '.packages | .[] | .name' | grep -e '^rcgen' -e '^ring'
rcgen
ring

Built on master, 1.24.0-alpha.0-33-g0ad78e3, 0ad78e3

Am i missing something?

It seems to me that somehow, via testing feature & dev-dependencies rcgen is always enabled; when it should be optional.

Or is there a bug in the generated rust-audit-info?

@xnox
Copy link
Author

xnox commented Dec 24, 2024

Executing:

cargo remove rcgen
cargo remove ring

Appears to remove rcgen & ring from Cargo.toml and lock files.

Rebuilding the binary shows that boring crate, ends up pulling in rustls, and ends up pulling in ring.

Shouldn't the boring crate pull in rustls with custom-provider feature set?

@xnox xnox changed the title How to build without rcgen? How to build without rcgen and without ring? Dec 24, 2024
@xnox
Copy link
Author

xnox commented Dec 24, 2024

Executing

cargo add --no-default-features --features custom-provider,tls12 [email protected]

Still pulls in ring =(

@howardjohn
Copy link
Member

hmmm..

$ cargo tree --no-default-features --features tls-boring -e normal | grep ' ring'

finds no matches. Seems like a bug in cargo-audit or cargo-tree.

$ strings ./out/rust/debug/ztunnel | rg rcgen has none either - not sure that is a very valid check, though - but with the ring build it does show up rcgen so that adds some credibility.

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

No branches or pull requests

2 participants