rust-lang / rustc_codegen_gcc

libgccjit AOT codegen for rustc
Apache License 2.0
906 stars 60 forks source link

Hide output by default and only display it if there is an error #376

Open GuillaumeGomez opened 10 months ago

GuillaumeGomez commented 10 months ago

Like bootstrap is doing. There is no need to have it displayed by default. I can add an option to still display it in any case.

RalfJung commented 10 months ago

More broadly speaking, you should imagine some running the test suite who has never looked at your code and has no idea how the GCC backend works. The output on a failing (or passing) test should be geared towards that kind of user.

As an example: it's completely unclear what "AOT" means. When a test fails, there should be some indication of where one can find the test sources.

bjorn3 commented 10 months ago

it's completely unclear what "AOT" means.

cg_clif compiles and runs several small tests both in AOT (ahead of time, so write executable and the run it as separate process) and JIT (just in time, so keep the compiled code in memory and directly execute it in the same process) configuration. cg_gcc doesn't have a JIT mode, so distinguishing between them indeed doesn't really make sense here.

bjorn3 commented 10 months ago

Hide output by default

For cg_clif I've been thinking about checking the output of the small executables against the expected result and hiding the output when they match, but never got around implementing this. I think for the bigger tests (regex, rand, ...) showing the "Compiling ..." lines from cargo as well as the -q output of the test runner like I do currently makes more sense than entirely hiding it given that it takes much longer than a single test and you would lose any indication of progress during the compilation of a test (which can easily take half a minute or longer) when you hide this all. compiletest only shows when individual tests are done, but there it has a lot of tests that run very quickly and thus give you a clear indication of progress and if a test runs for over 60s it will print a message about this.

It seems that cg_gcc doesn't always pass -q to the test runner. The regex test does, but the rand and libcore ones don't. Passing this would reduce the verbosity a fair amount.

GuillaumeGomez commented 10 months ago

That's a good point. Keeping cargo output by default seems like a good idea.