Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

clear_env_rust_log not working for in-process rustc/cargo #1487

Closed
schomatis opened this issue Jun 11, 2019 · 1 comment
Closed

clear_env_rust_log not working for in-process rustc/cargo #1487

schomatis opened this issue Jun 11, 2019 · 1 comment

Comments

@schomatis
Copy link
Contributor

schomatis commented Jun 11, 2019

To reproduce:

RUST_LOG=cargo=debug rls --cli

Unsetting RUST_LOG doesn't work when the logger has already been initialized (in the first call to rls), rustc/cargo in-process calls will be guided by the original RUST_LOG value. Out of process calls (e.g., dependencies compilation) do benefit from clear_env_rust_log as the new process initializes its log (e.g., rustc_log::run).

Not sure if there's a way to reconfigure an already initialized log.


Interestingly (and somewhat related to this but not a responsibility of clear_env_rust_log),

RUSTC_LOG=debug rls --cli

produces the rustc log for the in-process (primary packages) compilation. I would have expected those to happen with RUST_LOG (even after the RUST_ to RUSTC_ transition) because clear_env_rust_log uses the same unset env.var mechanism, but they seem to appear (no matter the filter) only with the RUSTC_ variant.

(edit: actually, the output generated in the RUSTC_ case, which contains mostly MIR and codegen information, might not come particularly from in-process rustc calls and I may be confounding sources)

(edit 2: yes, it seems the output is mainly parallel codegen spawned processes, similar to what's described in the first part of the issue)

@schomatis
Copy link
Contributor Author

Closing, once #1486 lands this loses much of its initial motivation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant