You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And its Setup.hs imports the Development.Shake module. Running cabal configure with HEAD cabal and cabal-install results in this:
dist/setup/setup.hs:2:8:
Could not find module ‘Development.Shake’
Use -v to see a list of the files searched for.
The shake package is not downloaded or built.
The setup.sh file grabs cabal from git, creates a sandbox with existing cabal-install, adds Cabal and cabal-install as sources, builds the new cabal-install in the sandbox, and uses it to run cabal configure.
I looked into this a bit further. It turns out cabal configure attempts to make a build plan, and if it fails, prints a warning that only shows up with -v and build the Setup.hs anyway.
:<
I'd expect it to just fail with an error message, but I don't know the original rationale. I can't think of a situation where you'd want the configure script when the project isn't buildable.
Historically we could not always require that we must find a consistent configuration at the cabal configure step, because people were used to using Setup.hs configure where that degree of consistency was not required and while such cases were not guaranteed to work, they didn't always fail, so we didn't feel able at the time to exclude them.
Now that hardly anyone develops using Setup.hs configure anymore, and are used to cabal install requiring consistent build plans, I think we're probably safe for us to drop the compatibility behaviour and always require a consistent build plan at configure time.
It means that it will become impossible to cabal configure a package that indirectly depends on two versions of some dep, even when such a configuration might actually work.
So summary: yes I think we can now drop the fallback and fail hard if the solver doesn't find a solution there.
So summary: yes I think we can now drop the fallback and fail hard if the solver doesn't find a solution there.
We actually did that once already, but it broke the containers test suite (due to #1575), so the patch was reverted. Now with qualified goals implemented it should be possible to fix this the right way.
Activity
23Skidoo commentedon May 28, 2015
/cc @edsko, @dcoutts
edsko commentedon May 28, 2015
I wonder if it's using the right version of
Cabalto actually configure? See #2540 (comment) for a possibly comparable problem.enolan commentedon May 31, 2015
I looked into this a bit further. It turns out
cabal configureattempts to make a build plan, and if it fails, prints a warning that only shows up with-vand build the Setup.hs anyway.:<
I'd expect it to just fail with an error message, but I don't know the original rationale. I can't think of a situation where you'd want the configure script when the project isn't buildable.
edsko commentedon May 31, 2015
Ah. I changed that actually so that that would be an error, but there is a good if somewhat convoluted reason for this. Pinging @dcoutts for details.
dcoutts commentedon Jun 1, 2015
Historically we could not always require that we must find a consistent configuration at the
cabal configurestep, because people were used to usingSetup.hs configurewhere that degree of consistency was not required and while such cases were not guaranteed to work, they didn't always fail, so we didn't feel able at the time to exclude them.Now that hardly anyone develops using
Setup.hs configureanymore, and are used tocabal installrequiring consistent build plans, I think we're probably safe for us to drop the compatibility behaviour and always require a consistent build plan at configure time.It means that it will become impossible to
cabal configurea package that indirectly depends on two versions of some dep, even when such a configuration might actually work.So summary: yes I think we can now drop the fallback and fail hard if the solver doesn't find a solution there.
23Skidoo commentedon Jun 1, 2015
We actually did that once already, but it broke the containers test suite (due to #1575), so the patch was reverted. Now with qualified goals implemented it should be possible to fix this the right way.
edsko commentedon Jun 1, 2015
Ah, yes. I knew there was a reason we couldn't fix this just yet.
Fail in cabal configure if dependency solver fails
dcoutts commentedon Mar 28, 2016
Note that the nix-local-build branch doesn't use a fallback, and on
cabal configureorbuildwould do the right thing for this case.fgaz commentedon Nov 2, 2021
Closing based on last comment, since nix-local-build/new-build/v2-build is now the default