-
Notifications
You must be signed in to change notification settings - Fork 379
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
(cargo-)miri doesn't pass through --color=always? #2037
Comments
cargo-miri just forwards all flags to cargo. But it looks like the part where the colors are missing is the output of Miri itself? That is basically rustc with a different 'codegen backend' -- "the miri driver". I don't know how colors are controlled there, but I see rustc has a You could try passing things with |
Perfect. That works. I've definitely noticed before that the rest of |
Actually no, this doesn't work, because doctests. They all crash with this error:
|
Hmm... technically we should fix rustc to accept such flags multiple times... But I think going via the flags env var should not be necessary, so we should look into fixing that. Is |
Well, we are already passing all the arguments cargo passes to rustc, when we do the actual interpretation. We collect that info here: Line 757 in 65125df
and then pass it to the driver here: Line 933 in 65125df
So not sure why |
"The rest"? Simply all of it is passed to the driver. |
Perhaps I'm reading too much into this error, but this error makes me think that
|
No, that's not what happens. Miri's So I'd start debugging this by doing |
This looks to me like the flag gets dropped by |
Maybe the cargo cache is playing with us -- did you try |
Fresh project, ran
|
This is the key line
Indeed no So the culprit is this code: Lines 927 to 950 in 65125df
We can't have that JSON output (since we actually run this when cargo thinks it runs a binary, i.e., it wouldn't interpret that JSON), so we drop the --error-format and the --json . Looks like we should additionally, if --json contains diagnostic-rendered-ansi , add a --color=always to the flags as a replacement for the flags we dropped.
|
I'm building a website to browse my automated
cargo miri test
outputs as they appear. But I want to display logs with all the helpful coloring that appears in my terminal and I can't figure out how to do it.cargo miri test --color=always -- --color=always
produces color in the compiling messages and the very last line that sayserror: test failed
, but not the actual diagnostics.Is this a bug with
cargo-miri
? I'm not above using dirty Linux hacks to trick my experiment into thinking that a file is a TTY to get the escape codes, but I'd rather fix the problem if there is one.If anyone wants to check it out, the current prototype is at https://miri.saethlin.dev/ub. It's WIP, I may change anything about it, etc.
The text was updated successfully, but these errors were encountered: