bacon icon indicating copy to clipboard operation
bacon copied to clipboard

Run job doesn't show output if there are any warnings

Open crumblingstatue opened this issue 3 years ago • 8 comments
trafficstars

fn main() {
	println!("Hello world!");
}
 playground   run   pass!

   Compiling playground v0.1.0 (/tmp/playground)
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/playground`
Hello world!
fn main() {
	let unused = 42;
	println!("Hello world!");
}
 playground   run    1 warning

 1  warning: unused variable: `unused`
  --> src/main.rs:2:6
   |
 2 |     let unused = 42;
   |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
   |
   = note: `#[warn(unused_variables)]` on by default

Hello World! isn't shown in the second case.

crumblingstatue avatar May 19 '22 09:05 crumblingstatue

Any updates?

MarcoBuster avatar Jul 29 '22 12:07 MarcoBuster

Any updates?

I had just forgotten this issue, sorry.

Canop avatar Jul 29 '22 13:07 Canop

This should be fixed on branch fix-issue-81 : the job takes a new "allow_warnings" setting.

More tests are needed before I merge into main. I'd appreciate your tests.

Canop avatar Jul 29 '22 18:07 Canop

Hi! I'm new to the rust game and I've been using bacon to work on my first project. I'm also experiencing this issue and switching to the branch fix-issue-81 fixed it for me! It worked both with the default .toml file and with a project-specific bacon.toml file. I cloned and built Bacon for release from within a common repos folder and then executed it with ../bacon/target/release/bacon. Worked perfectly!

jjmarchewitz avatar Aug 12 '22 17:08 jjmarchewitz

I tried the branch with the example given above, but it doesn't print hello world.

warning: unused variable: `unused`                                                                                                                                                            ▐
 --> src/main.rs:2:6                                                                                                                                                                          ▐
  |                                                                                                                                                                                           ▐
2 |     let unused = 42;                                                                                                                                                                      ▐
  |         ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`                                                                                                      ▐
  |                                                                                                                                                                                           ▐
  = note: `#[warn(unused_variables)]` on by default                                                                                                                                           ▐
                                                                                                                                                                                              ▐
warning: `loltest` (bin "loltest") generated 1 warning                                                                                                                                        ▐
    Finished dev [unoptimized + debuginfo] target(s) in 0.00s                                                                                                                                 ▐
     Running `target/debug/loltest`

println!("Hello world!\n"); works, however. It seems like the last line is swallowed.

crumblingstatue avatar Aug 13 '22 13:08 crumblingstatue

It would also be nice if there was an option to scroll to the end automatically on every update. It would be useful when doing iterative development that's based on program output.

crumblingstatue avatar Aug 13 '22 13:08 crumblingstatue

It also seems non-zero exit code inhibits output as well. Seeing panic/crash output is very important. Otherwise, users are forced to leave bacon and rerun to see panic output.

crumblingstatue avatar Aug 13 '22 13:08 crumblingstatue

Now that you mention it, the last line is being swallowed for me too. I didn't notice because my code has a ton of output

jjmarchewitz avatar Aug 13 '22 16:08 jjmarchewitz

Hum. I can't reproduce the last line being swallowed :
image There are sometimes synchronization problem since the switch to tokio so that might be another occurence.

Canop avatar Aug 28 '22 07:08 Canop

I also have the panic: image

I'll merge this and we'll create other issues for the last line being swallowed if confirmed.

Canop avatar Aug 28 '22 07:08 Canop