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

Disable / Delay "Warning: modules not listed in *.cabal for '*' component (add to other-modules):" Warning #1705

Open
blitzcode opened this issue Jan 26, 2016 · 4 comments

Comments

@blitzcode
Copy link

From what I can tell, the other-modules field in a cabal file only matters when packaging for a Hackage upload. Cold this warning instead be emitted during the upload check or could we have a flag to disable this warning? It seems pointless to manually maintain a module list or see this warning on every single build for projects that won't end up on Hackage.

@mgsloan
Copy link
Contributor

mgsloan commented Jan 27, 2016

You make a reasonable point! After typing up the list of pros / cons, I think we should keep the current behavior:

Points in favor of removing the warnings from build (in favor of sdist / upload):

  • Less noisy when you don't intend to ever publish the package

Points against removing the warnings from build:

We could add a configuration field to suppress this, but I'm inclined to avoid adding extra knobs for stuff like this. What do others think? Is it worth it? I guess I'm not seeing a flag for filtering this output as all that useful, since it's easy to ignore it. Maybe write a utility that pipes the output of stack through something that filters out these lines, if they bug you?

You might like hpack, which allows either exposed-modules or other-modules to be auto-generated. It isn't integrated with stack, but it'd be cool to add support: sol/hpack#61 #1679

@borsboom
Copy link
Contributor

borsboom commented Feb 4, 2016

I think our warning support in general could be improved. Right now these warning messages are ad-hoc without any framework around them. It'd be nice is every warning message could be disabled (analogous to GHC's -fno-warn-* options), which would cover this particular issue as well. It'd also be nice if repeated warnings were automatically suppressed and they could be emitted together for a given package instead of being interspersed with other output. What do you think? If so, opening a separate issue would probably be good.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 5, 2016

Agreed! Another reason to have a system like this is so that they can be moved to the end of the output. Currently it's easy for them to get lost in the midst of output.

We've also sometimes needed to restructure code to plumb warning / error info to the end of output. It'd be nicer to store away warnings / errors at the location that generates them.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 18, 2016

It'd make a lot of sense to have a proper system for reporting warnings to the user, it's easy to overlook the missing module warnings as they're jammed in the middle of output.

Since other-modules is also used for the dirtiness check (#1797), we may actually want to make it a noisier issue (perhaps it's a bug?)

It seems that we have a whole spectrum - some folks want to make these into errors #1323

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