cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.28k stars 1.1k forks source link

TinyUFO unable to run benches #186

Closed NathanielPrescott closed 2 months ago

NathanielPrescott commented 2 months ago

Describe the bug

When running TinyUFO (benches / tests) I am getting an error due to the Bucket struct not being publicly usable for the bucket.rs file.

Pingora info

Please include the following information about your environment:

Pingora version: 0.1.1 Rust version: 1.72.1 Operating system version: Manjaro, Kernel 6.6

Steps to reproduce

When I run any tests or benchmarks for TinyUFO I get the observed error.

cargo bench --bench bench_perf

Observed results

error[E0446]: private type Bucket<T> in public interface --> tinyufo/src/buckets.rs:39:5 39 pub fn get(&self, key: &Key) -> Option<Entry<Key, Bucket>> { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type

::: tinyufo/src/lib.rs:124:1 | 124 | struct Bucket { | ---------------- Bucket<T> declared as private

Additional context

These tests / benches were working for me before the TinyUFO compact changes were added where the Bucket was moved. This was fixed by making the Bucket public. Let me know if you'd like me to create a PR or if I am doing something wrong when trying to run these tests.

johnhurt commented 2 months ago

Thanks for reporting. That's what we get for not actually verifying our minimum rust version. We'll have a fix for this out soon.