microsoft / knossos-ksc

Compiler with automatic differentiation
Other
45 stars 10 forks source link

How to suppress unused variable warning in futhark check? #200

Open toelli-msft opened 4 years ago

toelli-msft commented 4 years ago

Currently we use futhark check in our CI pipeline to check that the Futhark code we emit is at least type-correct. Because it's generated code we end up with quite a lot of unused variable warnings. Is it possible to suppress them? futhark check --help doesn't seem very promising:

~/futhark-0.14.1-linux-x86_64/bin/futhark check --help
Futhark 0.14.1
git: HEAD @ 7b1c9ac (Fri Jan 24 14:09:09 2020 +0100)
Copyright (C) DIKU, University of Copenhagen, released under the ISC license.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Usage: futhark check program
Options:

  -V  --version  Print version information and exit.
  -h  --help     Print help and exit.
toelli-msft commented 4 years ago

Looks like this is currently not possible: https://github.com/diku-dk/futhark/blob/7ae2f47a57a9e6a74ebcaaedd73a0309efba4216/src/Futhark/CLI/Misc.hs#L22-L28

athas commented 4 years ago

I can definitely add this if it's considered useful, although it won't be available until the next release. But don't most CI tools normally hide the output of commands that succeed?

toelli-msft commented 4 years ago

I can definitely add this if it's considered useful, although it won't be available until the next release

I think it would be pretty useful to have in general, unless there's another workaround I'm not seeing.

But don't most CI tools normally hide the output of commands that succeed?

Yes, I wasn't quite precise enough. I only care that there are a lot of unused variable warnings when there is a failure. Then I have to scroll through a lot of warnings to see the error message. We also run the exact same command locally when we're developing and the problem applies there too. Is there any other solution you can think of that would be more appropriate?

athas commented 4 years ago

It does not print warnings when there is a type error.

I think a --no-warnings flag or similar for futhark check might be generally useful, so I'll probably add it.

toelli-msft commented 4 years ago

It does not print warnings when there is a type error.

The troublesome cases are the ones where one file in the test suite produces errors but most of the other files don't, but do produce a lot warnings.

I think a --no-warnings flag or similar for futhark check might be generally useful, so I'll probably add it.

Great! In the meantime I may just suppress all output from successful invocations of Futhark.