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

"buildable: False" should fail the current configuration #224

Closed
bos opened this issue May 24, 2012 · 4 comments
Closed

"buildable: False" should fail the current configuration #224

bos opened this issue May 24, 2012 · 4 comments

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(Imported from Trac #231, reported by @dcoutts on 2008-02-05)

Currently resolving configurations does not take account of the buildable field. It should act rather like build-depends: non-existant, though with a different error message.

If possible the error message should relate to the guard condition expression (the conjunction if there are several nested guards).

At the moment it is not considered at all and we don't notice that the package cannot be built until the build step, rather than the configure step.

One problem is that it's not clear if buildable: False is always fatal. People sometimes do that for test executables that are not supposed to be installed. So what should the behaviour be? The lib or only exe failing to configure must be an error.

@ghost ghost assigned nominolo May 24, 2012
@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2008-02-05)

Another possibility is to deprecate buildable for this use case and add fail instead which would provide an error message to indicate why a particular configuration is not possible.

The semantics would be slightly different to buildable: False. It would make configuring the whole package fail, not just disable building that executable or library.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dcoutts on 2008-08-15)

This is doable as part of a larger overhaul of configuration search.

@hvr
Copy link
Member

hvr commented Jul 22, 2015

Another possibility is to deprecate buildable for this use case and add fail instead which would provide an error message to indicate why a particular configuration is not possible.

I guess fail would have a similiar effect to build-depends: base<0?

@Ericson2314
Copy link
Collaborator

Now that #1725 is fixed (with #3039), can we revisit this? I might take a stab at undoing 04dff51

If I understand correctly, that other commit works for flags but may not work in other situations such as:

name:                Foo
version:             0.1.0.0

library
  if impl(ghcjs)
    buildable: false
  default-language:    Haskell2010
name:                Foo
version:             0.1.0.1

library
  default-language:    Haskell2010
name:                Bar
version:             0.2.0.0

library
  default-language:    Haskell2010
  Build-Depends:       Foo >= 0.1

CC @luite

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