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

Re-consider bench feature flag in neqo_common::log macros #2390

Open
mxinden opened this issue Jan 24, 2025 · 1 comment
Open

Re-consider bench feature flag in neqo_common::log macros #2390

mxinden opened this issue Jan 24, 2025 · 1 comment

Comments

@mxinden
Copy link
Collaborator

mxinden commented Jan 24, 2025

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

macro_rules! qerror {
($($arg:tt)*) => ( {
#[cfg(any(test, feature = "bench"))]
::neqo_common::log::init(None);
::log::error!($($arg)*);
} );
}

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
Copy link
Collaborator Author

mxinden commented Jan 27, 2025

Introduce a fake no-op bench feature to neqo_glue.

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

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

1 participant