-
Notifications
You must be signed in to change notification settings - Fork 843
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
Conditional inclusion of packages: #2048
Comments
Related issue: #1722 For now I would recommend having multiple stack.yaml files. Fancier config would be nice, but we have bigger fish to fry. It's been discussed in the past, and so far we've held off from doing fancy config merging / conditionals / environment interpolation. There are lots of benefits to having simple configuration. Alternatively, have a dummy cabal file in the package dir - it can be named something else to avoid it looking like it exists. |
Note that the inclusion here is just with In the package list, you can do the following: packages:
- location: haskell-gi
extra-dep: true See the relevant section of docs |
Ah, I see now that the issue is that there is no cabal file. Eugh, how about just put a dummy cabal file there? |
I've been following this issue but I'm not sure it is related to the problem we have. Due to licensing issues we need to build with using the stack.yaml (for windows): extra-deps:
- text-1.2.2.2
flags:
text:
integer-simple: true stack_linux.yaml: extra-deps:
# Nothing, no problem with integer GMP licensing on Unix systems This not only doubles the maintenance efforts, but breaks editor tools on Linux (like I guess this issue cannot be solved in the way @mgsloan indicated, or can it? |
Cool. It does looks like this is no longer an issue for Leksah (so we only need one |
@capitanbatata, I think your issue is #3369 |
@leohaskell It is indeed. But that one was closed, and it refers to this one. Do you also maintain two stack files? |
@capitanbatata, it's not closed yet, it's in discussion state. |
It may be feasible / desireable to have conditionals that are in the same form as hpack, for consistency. Primary concerns:
In general, it seems complicated to make the configuration more and more like a program, I like to keep it simple while handling 95% of cases. A potential workaround for y'all is to name neither of your stack.yaml files "stack.yaml", and have a simple I have to look at how much complexity / bug surface area / maintainability this would add to stack, atop the complexity of implementi0ng it the first place, versus how many times it's actually useful. Strongly leaning towards "have a ./configure.hs" script at least in the short to medium term. I haven't looked into dhall much, but it seems cool. Maybe one long term direction would be to switch to it. Then, many of the concerns of having programmatic configuration would not be the responsibility of the stack project. |
I understand this might be tricky to implement, and maybe it could be solved somewhere else. Regarding the |
I completely understand that from a maintainability perspective.
This is the same as having multiple A better thing to do is to have a |
Thanks. Regarding how useful it would be, I guess that every Haskell project that aims at being multi-platform and not licensed under the GPL license will run into this issues, since on Windows you need libraries to use |
Is there a way to do this? For instance we have this in
leksah.cabal
:But if we want to include this in
packages:
we get:In this case it is because
haskell-gi
cannot generate the package on Linux.Could we perhaps add an
optional-packages:
section where stack would look for a.cabal
file and only include the listed directory if a.cabal
file was found?CC @JPMoresmau
The text was updated successfully, but these errors were encountered: