Skip to content
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

Ability to use -Wall without -Werror #2035

Closed
mightybyte opened this issue Apr 14, 2016 · 9 comments
Closed

Ability to use -Wall without -Werror #2035

mightybyte opened this issue Apr 14, 2016 · 9 comments

Comments

@mightybyte
Copy link
Contributor

I find it very useful to build with -Wall in situations where -Werror is not desirable. stack build --ghc-options="-Wall" does not display any warnings, so this does not appear to be possible right now.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 14, 2016

The issue is probably that ghc does not rebuild when -Wall is added. Does stack build --ghc-options="-Wall -fforce-recomp" do what you want?

It may also be due to building multiple packages concurrently. In that case you need to look at build logs for warnings, or build the package individually.

@mgsloan mgsloan added this to the Support milestone Apr 14, 2016
@mightybyte
Copy link
Contributor Author

It was definitely building before. -fforce-recomp didn't help either. Build logs are displayed with --pedantic, so it seems like they should be able to be displayed similarly (without taking the -j1 hit) for an option that has -Wall without -Werror.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 14, 2016

It works for me. Can you please provide a repro based on publically available code?

Might also be worthwhile trying with HEAD stack, though I doubt that's the difference.

@mightybyte
Copy link
Contributor Author

mightybyte commented Apr 18, 2016

git clone https://github.com/jaspervdj/digestive-functors.git
cd digestive-functors
stack build --ghc-options="-Wall"

Following this by stack build --pedantic fails with warnings that weren't shown in the above -Wall build.

I'm using this version of stack:

Version 1.0.4, Git revision cf18703b1392a96a5a4896a560309e501af63260 (3220 commits) x86_64

@snoyberg
Copy link
Contributor

This is most likely caused by logs for multi-package projects being sent to log files instead of to the console. If you want to see the output on the console, you need to specify just one package to build, e.g.:

stack build --ghc-options="-Wall" --file-watch digestive-functors-snap

Does that work?

@mightybyte
Copy link
Contributor Author

That works, but it is not a sufficient solution IMO. stack build --pendantic shows warnings even when building multiple packages, so there's clearly no technical reason the same can't be done for -Wall. I want to be seeing warnings as often as possible, not just when building a single package. Getting -Wall behavior also shouldn't require any extra characters to be typed on the command line.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 29, 2016

The reason that stack build --pedantic shows warnings for all packages is because it causes them to be errors. Erroring builds are always shown to the user.

I thoroughly agree that we should be able to show all output, and potentially even make it a default. Sounds like this is the main issue here, and it's currently tracked by #426, so marking as a dupe of that.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 29, 2016

Might also be running into #2063

@mightybyte
Copy link
Contributor Author

Sounds good. If #426 is the dupe for this, my main thought is that it should be possible to configure the option from the stack.yaml file so it can be set on a per-project basis rather than whenever developers think to do it.

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

No branches or pull requests

3 participants