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

Use cargo-check-external-types to control type leakage in public API #1535

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

ctz
Copy link
Member

@ctz ctz commented Oct 13, 2023

I learned about this today, so thought I'd give it a try. It pointed out one rustls-webpki and two ring leakages that this PR fixes.

See https://github.com/rustls/rustls/actions/runs/6511651812/job/17687753330 for the example failing output.

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #1535 (5fe5272) into main (0bbc1cf) will decrease coverage by 0.01%.
Report is 21 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1535      +/-   ##
==========================================
- Coverage   96.46%   96.46%   -0.01%     
==========================================
  Files          74       74              
  Lines       15115    15107       -8     
==========================================
- Hits        14581    14573       -8     
  Misses        534      534              
Files Coverage Δ
rustls/src/client/hs.rs 97.21% <100.00%> (ø)
rustls/src/client/tls12.rs 98.53% <100.00%> (ø)
rustls/src/client/tls13.rs 97.05% <100.00%> (ø)
rustls/src/crypto/ring/hash.rs 100.00% <100.00%> (ø)
rustls/src/crypto/ring/hmac.rs 100.00% <100.00%> (ø)
rustls/src/msgs/handshake.rs 98.10% <100.00%> (ø)
rustls/src/msgs/handshake_test.rs 99.60% <100.00%> (ø)
rustls/src/server/tls12.rs 96.89% <100.00%> (ø)
rustls/src/server/tls13.rs 96.98% <100.00%> (ø)
rustls/src/tls12/mod.rs 97.85% <100.00%> (ø)
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is super handy 🚀

@ctz
Copy link
Member Author

ctz commented Oct 16, 2023

Working with upstream to get this going with a more recent nightly.

Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is working nicely with up-to-date nightly thanks to your upstream contrib. Cool!

.github/workflows/build.yml Outdated Show resolved Hide resolved
This needs nightly, which is affixed as the version documneted as working by
cargo-check-external-types.

external-types.toml is a config file as a starting point: it allows all types from
pki-types.

This currently fails due to some `impl From<ExternalType>` on public types.
@ctz ctz added this pull request to the merge queue Oct 18, 2023
Merged via the queue into main with commit c3f6b88 Oct 18, 2023
42 checks passed
@ctz ctz deleted the jbp-check-external-types branch October 18, 2023 09:30
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.

None yet

2 participants