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

os conditionals not supported in custom-setup #4852

Closed
joeyh opened this issue Oct 27, 2017 · 5 comments
Closed

os conditionals not supported in custom-setup #4852

joeyh opened this issue Oct 27, 2017 · 5 comments

Comments

@joeyh
Copy link

joeyh commented Oct 27, 2017

My Setup.hs needs WIn32 to build on windows. So, I tried adding to its custom-setup stanza:

  custom-setup
    Setup-Depends: base (>= 4.5)
  if os(Windows)
    Setup-Depends: Win32

cabal fails to parse that:

'parseField' called on a non-field. This is possibly a bug in Cabal.
Please report it to the developers: https://github.com/haskell/cabal/issues/new
CallStack (from HasCallStack):
error, called at ./Distribution/PackageDescription/Utils.hs:21:16 in Cabal-2.0.0.2-B4YxsRmpeLCDyDZ1N9nEz7:Distribution.PackageDescription.Utils- exit 1

cabal-install version 2.0.0.0
compiled using version 2.0.0.2 of the Cabal library

@phadej
Copy link
Collaborator

phadej commented Oct 27, 2017

The current solution is to abstract custom-setup code into own package. i.e.

name: mypkg

custom-setup:
  setup-depends: mypkg-custom-setup

@phadej
Copy link
Collaborator

phadej commented Oct 27, 2017

... alternatively you could use something like unix-compat, it might be good enough for you.

@joeyh
Copy link
Author

joeyh commented Oct 27, 2017 via email

@23Skidoo
Copy link
Member

23Skidoo commented Nov 3, 2017

@dcoutts, do you think this should be supported? IIRC, the decision to keep the format of custom-setup simple was deliberate.

@grayjay
Copy link
Collaborator

grayjay commented Dec 4, 2017

I think this is a duplicate of #4286.

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