-
Notifications
You must be signed in to change notification settings - Fork 683
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
Cabal 2.0 asks ghc to build modules that are #ifdefed out #4655
Comments
Workaround is to use |
Edward Z. Yang wrote:
Workaround is to use if os(Linux) etc. to conditionally include a module in
other-modules or not, depending on whether or not you want it built
Yes, or replicate the #ifdef all around the contents of the module.
However, I hope this breakage was not intentional.
…--
ee shy jo
|
Well, the breakage of git-annex obviously wasn't intentional; it was collateral damage as a result of fixing inconsistencies in Cabal's behaviour. Just like when GHC's typechecker improves and in the process starts rejecting more programs which shouldn't have typechecked in the first place. |
Herbert Valerio Riedel wrote:
However, I hope this breakage was not intentional.
Well, the breakage of git-annex obviously wasn't intentional; it was collateral
damage as a result of fixing inconsistencies in Cabal's behaviour. Just like
when GHC's typechecker improves and in the process starts rejecting more
programs which shouldn't have typechecked in the first place.
Except in this case, ghc --make still builds the programs which cabal
now fails to build. And I'm not aware of any bug which this new bahavior
of cabal prevents either.
…--
see shy jo
|
If you don't specify |
In addition to what @23Skidoo mentioned, |
Do we need a doc update for this ticket? |
It'd be nice, but I'm not sure in which part of the manual we should put it. |
If there's no better idea, we could just clarify the wording in http://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-other-modules which already specifies e.g. the invariant that
which should be clarified that this is actually per-component, rather than per-package, as well as that all modules specified via those 3 facilities are passed to the compiler. |
git-annex fails to build using Cabal 2.0 (via stack with resolver: nightly-2017-07-31). An example of the problem is its Utility.LockFile module, which contains:
Building on Linux, this fails:
Previous versions of cabal did not have this problem. Looks like cabal is now running ghc with --make --no-link and a list of every module listed in the cabal file, including modules that are never used for the current OS and current set of build flags.
The text was updated successfully, but these errors were encountered: