-
Notifications
You must be signed in to change notification settings - Fork 842
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/platform-specific fields in stack.yaml #3369
Comments
Potentially related issue: #2048 Adding conditionals could be a bit complicated, might be worth it though. I don't have a strong feeling about it, but historically we've avoided making the configuration format very fancy. |
I would mark this as a duplicate of #2048, no? #2048 (comment) seems to be the best solution for this so far. |
It's not a duplicate of it, although the mentioned solution works in this case too. However, I'm not talking about packages, I'm talking about all building flags/options, which could be different depending on the OSes. |
Is there a way to specify platform specific stack overrides in my home folder, i.e. outside of the project root? I'm on mac osx and need different cabal flags for hlibsass, while everyone else on my team is on linux and needs different flags. |
@saurabhnanda, if you need different cabal flags only, you can pass them to stack like this: |
Lacking this is a significant pain. For example, we build llvm-hs with If you ever use a |
To be clear, this is flags for dependencies, correct? For a package itself one can use the os conditional in the cabal/hpack file. One can set flags in a machine's |
Yes. The packages whose flags need to be influenced are not under my control.
That's not great either, since it is an additional step that must be documented and remembered to be done during setup of the machine. It would be much better if it were simply a property of the stack. |
I can see good reasons to have such tooling. In one sense it is similar to haddock — often there are haddock build failures with dependencies, but stack currently has no way to indicate that a build should ignore these (the stackage-curator tool does, however). This broadens the proposal slightly — perhaps it would be better to invert the tree:
That way any key (within some subset of the top level keys, perhaps) can have such conditionality. For the examples I've seen, however, it seems the best case is actually to fix these issues upstream. For example, while it would be very useful to have the haddock workaround, the real fix would be for upstream libraries to fix their docs. Likewise,
Surely this should be fixed by |
Well, whether to use shared llvm or not is a choice, depending on whether you want to statically compile your executable or not. I can see strong arguments for using either, but in my particular case I require them to be statically linked. I can't enforce that decision on the upstream project, it might not be appropriate for other users. Something like |
Ah, yes, if its a choice then that's different — and should be fixable without forking. |
I think it would be nice to have a way of specifying fields that are os-specific. Something like this:
Thus, one can keep more build information within stack and write less additional scripts.
NOTE: This could be possible also by modifying the confHook in Setup.hs if stack didn't bypass the configure step.
The text was updated successfully, but these errors were encountered: