Skip to content

Is it possible to new-configure --ghc-options=-Wall for a particular local package? #4577

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

Open
lspitzner opened this issue Jun 28, 2017 · 6 comments

Comments

@lspitzner
Copy link
Collaborator

I just did the above and cabal decided to recompile the deps (which is a bit surprising on its own, but probably correct since deps might start breaking if they had -Werror as well..).

I gather that I can do

package mypackage
  ghc-options: -Wall

manually in cabal.project.local but that'll get overwritten by the next new-configure.

#4271 seems somewhat related.

@23Skidoo
Copy link
Member

Hmm, I thought we already had a ticket for this, but I can't find it right now. @hvr, maybe you remember?

@lspitzner
Copy link
Collaborator Author

Now that i search again, I see #3883 and #4247. The only difference/addition that I spot is that this is about new-configure, i.e. about how flags translate to cabal.project.local, which is an aspect not mentioned in #3883.

@lspitzner
Copy link
Collaborator Author

(commandline-flags, not package flags)

@hvr
Copy link
Member

hvr commented Jun 28, 2017

It would indeed be convenient if we had a CLI syntax for new-configure to specify the scope of e.g. ghc-options for e.g. placing it into a specific package foo section. But I'm not sure how to design the UI for that, as e.g. --ghc-options foo:-Wall would require us to steal potential syntax from the GHC CLI...

@lspitzner
Copy link
Collaborator Author

perhaps just adding --PROG-options-global and --PROG-options-local (and perhaps defaulting/redirecting --PROG-options to the latter) is an acceptable solution? I don't see a straight-forward solution to something more fine-grained (per-package) either.

(perhaps: the --RTS/+RTS/-RTS style of cascading?

--package mypackage --package-specific-flag1 --package-specific-flag2 or
+package mypackage --package-specific-flag1 --package-specific-flag2 -package ?

but i don't want to have to parse that either, especially in combination with -- run-args that new-build should support..)

@23Skidoo
Copy link
Member

23Skidoo commented Jun 28, 2017

Some ideas:

  • --package foo --ghc-options -Wall
  • --package-ghc-options foo=-Wall
  • --package-foo-ghc-options -Wall

I haven't thought about which one of these would be easiest/hardest to implement.

@ulysses4ever ulysses4ever changed the title Is it possible to new-configure --ghc-options=-Wall for current package, but not deps? Is it possible to new-configure --ghc-options=-Wall for a particular local package? Oct 3, 2022
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

4 participants