Skip to content

--no-run-solver option #6204

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

Closed
tseenshe opened this issue Aug 21, 2019 · 5 comments
Closed

--no-run-solver option #6204

tseenshe opened this issue Aug 21, 2019 · 5 comments

Comments

@tseenshe
Copy link
Contributor

tseenshe commented Aug 21, 2019

As discussed in #6203 it can be beneficial to workflows (e.g. large projects with many local packages) to run the solver rarely and to receive an error in preference to cache invalidation.

It would be good if this could be put behind a flag, e.g. --no-run-solver with the ability to go in cabal.project.local, and a --run-solver overriding.

Workflow: a developer could run the solver when they rebase their branch, then forgetting some trivial flag like -O0 or --enable-tests will cause an error rather than a (time costly) cache invalidation that requires another invalidation to fix.

@phadej
Copy link
Collaborator

phadej commented Aug 22, 2019

FWIW, you can add optimization: False and tests: True to cabal.project.local so they aren't "trivially' forgotten.

@DanielG
Copy link
Collaborator

DanielG commented Aug 23, 2019

Indeed but the specific problem @tseenshe has is that on their rather large projects the solver takes around a minute to run and since this happens without user consent it can be irritating depending on the workflow.

I actually think there's another use-case for this flag. When you cabal update normally v2-build will just start using newer dependencies but sometimes you might want to just stick to the old ones which this would let you do.

@phadej
Copy link
Collaborator

phadej commented Aug 23, 2019

@DanielG for that you should really use index-state

@DanielG
Copy link
Collaborator

DanielG commented Aug 23, 2019

That's one option, sure.

However for the workflow I'm thinking of that's not really the nicest thing. As far as I can see there's no option to say "pin the index state to the current one" I can do =HEAD but that'll just hardcode HEAD in cabal.project.local. That's another issue though.

Anyways the main use-case is still a valid one I think. Being able to opt-out of a potentally long running computation when it's really not absolutely required to keep working seems like a no-brainer to me.

@tseenshe
Copy link
Contributor Author

Closing because I no longer feel the need to use such a flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants