neqo icon indicating copy to clipboard operation
neqo copied to clipboard

Re-consider `bench` feature flag in `neqo_common::log` macros

Open mxinden opened this issue 11 months ago • 1 comments

Logging macros like neqo_common::log::qerror call ::neqo_common::log::init when either testing, or benchmarking.

https://github.com/mozilla/neqo/blob/e006a7d93e8387677a6f3ae7bbfc57d17deea606/neqo-common/src/log.rs#L55-L61

Here the bench in #[cfg(any(test, feature = "bench"))] does not refer to the bench feature of neqo_common, but to the bench feature of the crate executing qerror.

qerror is used in mozilla-central's neqo_glue. But neqo_glue does not have the bench feature, thus the compiler throws a warning.

I see the following ways forward:

  • Introduce a fake no-op bench feature to neqo_glue.
  • Remove the conditional log initialization on bench.

mxinden avatar Jan 24 '25 15:01 mxinden

Introduce a fake no-op bench feature to neqo_glue.

I will go with this for now in https://phabricator.services.mozilla.com/D234901.

mxinden avatar Jan 27 '25 10:01 mxinden