-
Notifications
You must be signed in to change notification settings - Fork 846
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Best effort stack init when some of the source packages have conflicts #1621
Comments
Makes sense to me! For #1616 , maybe it makes sense to have a mode that does this for any package that's problematic (and not just the ones that aren't compatible witht eh compiler). Perhaps a flag called something like |
I was thinking of using The overloading of Maybe we can postpone the 'use --force to overwrite' message to the end after it has been determined whether the config will be successfully created or not i.e. fail just before we are actually going to write it - instead of right at the beginning as the first message. That way the message will show up after the user knows whether he will get an incomplete or complete config. Any other ideas? |
Hmm, yeah, now that the meaning of One question is what happens when none of the packages can be built. In that circumstance, it may still be valuable to output a stack.yaml file, even if it won't build. |
The cases that we have can be summarized as:
What will be option names for these cases? Which one keeps Another option could be to simply generate the config always with a bold warning when it is not self contained or broken. More importantly, generate a config param to indicate that the config is not self contained or broken. We then provide an elaborate warning every time a stack command using the config is run. The warning can be suppressed by explicitly editing the config param to say I accept it the way it is and don't bother me anymore. When none of the packages can be built, all of them will be commented out in stack.yaml with everything else in place. The file can then be fixed by the user. |
I'm thinking that I like the idea of putting a message in the .yaml file that gets printed when you use it. With that addition, I think it makes sense to default to writing a config file, even if it's broken. Some might not like this behavior, so it'd be good to wrap it up in a flag. How about having the flags be I can also see this being useful when / if we have multiple configurations in the stack file (#1568). For example, if the user really should pick a configuration, then the default config can just consist of a message that tells them about that. How about something like |
Maybe we should file a bug with the title 'stack supports too many options' :-) I wouldn't add the flags unless someone asks for it and makes a good case for it. How about having case specific messages for the two cases I listed above. In the first case we can add something to the effect - Also, how about |
Sure, sounds great! True, maybe it'd be good not to add flags anticipating some unknown usecase :) |
I was going to remove This will make both the cases consistent and also make |
Hmm, I think Is the issue that it's difficult to implement the "leave out some packages" logic with Another thing that's tricky about leaving out some packages is how this relates to snapshot selection. I'm not 100% sure exactly the metric that's being used here, so this might not be an issue. Is it possible that a snapshot can get picked because it works better for some packages which end up getting left out? I'm starting to think that automatically leaving out packages might be more effort than it's worth. How about this alternative: In the list of ways to resolve, provide the CLI invocation that only specifies the packages that have a workable build plan. It would be cool to provide the full CLI including flags the user passed, but this is a bit tricky. It'd be fine to just provide the list of folders, such that it can be copy+pasted into the user's invocation of new / init. |
No, its purely a matter of consistent behavior and not implementation complexity. To elaborate the reasoning, here are two conflicting points:
What I was trying to say was that in both cases we can just go ahead and use the same warning message in stack.yaml. That will make the behavior for both the cases same and reduce command line flags.
I just implemented this today. Its pretty elegant, not complex. I have a few more things to add and then I will send a PR. Meanwhile I can push it to my fork if you want to take a look.
We pick a snapshot which can compile more packages. |
I see! Yes, it makes sense to have the warning mention --solver. I'd interpreted the earlier comment as removing "--solver" entirely.
Cool, sounds good! In that case, lets go ahead with the feature. If you want feedback sooner, feel free to push a fork. Otherwise, I can take a look when it's ready. |
That's what I meant earlier and now :-) I mean the CLI switch and not the functionality of course. Because otherwise we would be ignoring packages by default, without requiring any explicit switch and on the other hand we require |
You make a good point about the consistency! Maybe have an |
that was my backup plan :-) I would prefer the simpler no flags and stack.yaml warning. Once the flags are introduced its becomes harder to remove them. |
Packages which are not compatible with the resolver are added to the config but commented out. See commercialhaskell#1621
When there are some issues with the config file add warning messages for the user to be displayed everytime the config file is read. The messages can be suppressed by a user action i.e. remove it from the config if the user accepts the config. See commercialhaskell#1621
Remove the overloading of --force option and use it exclusively for overwriting an existing config. Use a separate --omit-packages option for excluding conflicting or incompatible packages from generated config. See commercialhaskell#1621
When there are a number of packages under the directory tree and even one of them is not compatible with the snapshot compiler then
stack init
fails. Sometimes there is stray or old unmaintained package under the tree or maybe even a test package which is designed to fail.Instead what we can do is to filter out the failing packages and init the stack.yaml based on the rest. This will allow more repositories/packages to be automatically initialized by stack init. We can keep the failing packages as commented out in stack.yaml with an appropriate reason comment automatically inserted.
For example the diagrams-ci tree fails with this:
These packages can be moved out of the way automatically.
The text was updated successfully, but these errors were encountered: