-
Notifications
You must be signed in to change notification settings - Fork 742
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
error[E0425]: cannot find function set_boxed_logger
in crate log
when building with Bazel/cargo-raze
#839
Comments
Can you reproduce this outside of Bazel, with just Cargo? It would be nice to know whether this is a Bazel-specific issue, or if it effects all builds. Thanks! |
I wasn't able to reproduce this with a plain Cargo-based directory. |
Thanks for checking! I think this is likely related to feature flags in some way --- the tracing/tracing-subscriber/Cargo.toml Line 43 in 0de7d51
My guess is that either |
set_boxed_logger
in crate log
set_boxed_logger
in crate log
when building with Bazel/cargo-raze
If you find this by googling the error message like I did: This issue was caused for me by Windows 10 Malwarebytes antivirus blocking a build script from running during compilation. Every time I ran a build, it would quarantine the file that was wanting to run a build for one of the dependencies. I had to add the crate directory to the allow list in order for the build to finish successfully. Not sure which script in particular it was, since I already added it to the allow list--sorry for lack of details there. |
I bumped into a similar issue as described by @austintheriot above and to my understanding it is caused when log's build script is not run and cannot set the |
Resolves the error ``` error[E0425]: cannot find function `set_boxed_logger` in crate `log` --> third-party/rust/vendor/tracing-log-0.1.3/src/log_tracer.rs:292:14 | 292 | log::set_boxed_logger(logger)?; | ^^^^^^^^^^^^^^^^ not found in `log` ``` caused by the `build.rs` script not running and [not setting](https://github.com/rust-lang/log/blob/d6707108c6959ac7b60cdb60a005795ece6d82d6/build.rs#L14) the `atomic_cas` configuration which [is needed](https://github.com/rust-lang/log/blob/d6707108c6959ac7b60cdb60a005795ece6d82d6/src/lib.rs#L1262) for `set_boxed_logger`. See also [related issue](tokio-rs/tracing#839 (comment)).
Resolves the error ``` error[E0425]: cannot find function `set_boxed_logger` in crate `log` --> third-party/rust/vendor/tracing-log-0.1.3/src/log_tracer.rs:292:14 | 292 | log::set_boxed_logger(logger)?; | ^^^^^^^^^^^^^^^^ not found in `log` ``` caused by the `build.rs` script not running and [not setting](https://github.com/rust-lang/log/blob/d6707108c6959ac7b60cdb60a005795ece6d82d6/build.rs#L14) the `atomic_cas` configuration which [is needed](https://github.com/rust-lang/log/blob/d6707108c6959ac7b60cdb60a005795ece6d82d6/src/lib.rs#L1262) for `set_boxed_logger`. See also [related issue](tokio-rs/tracing#839 (comment)).
@aherrmann did you figure out a solution? I am getting the same error.
|
@psalaberria002 Yes, the solution for my use case was to make sure that the |
Bug Report
Version
I see that
tracing-log
has a dependency on the log package as well:Platform
Darwin hostname 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64
Description
I'm trying out an example from the tokio documentation that uses mini-redis:
I get the following error:
I was expecting the example to compile successfully.
Thank you! :)
The text was updated successfully, but these errors were encountered: