-
Notifications
You must be signed in to change notification settings - Fork 696
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
Package with custom Setup.hs "Encountered missing dependencies" #3199
Comments
Thanks, will take a look. |
I think I see the problem. #2731 (merged in #3039) prevented cabal from requiring the dependencies of components that are not "Buildable". I don't see an easy way to fix it before the release, besides reverting the cabal-install part of #2731. |
@grayjay Thanks for the analysis. I think that the ultimate solution is to ensure that such a situation never happens and just always build setup scripts against the same version of For the 1.24 release, maybe we can do something similar to the |
@23Skidoo I thought Is there any way to make Setup completely ignore dependencies? As far as I can tell, |
One other thing we can do is pass @grayjay Yes, |
@23Skidoo How can we use |
@grayjay Before |
@23Skidoo I just tried configuring the package from the "Buildable" package test, and it didn't work:
I think |
Well, that's a pity. |
@grayjay Maybe we'll have to, but I don't want to do it just yet. Need to think a bit more about this. |
One way to solve this is to add a command to Setup scripts which lets us probe them for what features we support. Then we don't ignore non-buildable components when the Setup script doesn't support it. |
There actually seems to be a problem with inconsistent dependency requirements in the other direction, too. One of the integration tests failed with an invalid install plan when I tried reverting the cabal-install change. Commit: grayjay@a6dba5c
|
@ezyang We would have to know the versions of the setup scripts during dependency solving in order to choose dependencies for the non-buildable components (See #3199 (comment)). |
We should probably use |
@23Skidoo I'm not sure I understand. Would this work? Before solving for dependencies, we decide whether each package with |
@23Skidoo Do you know how we should handle this issue? I might have time to work on it now. |
Could we make a point release of Cabal 1.22 with the bug fixed? |
This only affects 1.24+. |
Would the point release contain #2731, possibly with a flag to control the behavior, so that |
@grayjay I think that a simple solution would be to require that the setup script is compiled against Cabal 1.24 when there are non-buildable components. In fact, we can do this for all setup scripts when there is no So I propose using |
@23Skidoo Thanks for the advice; I did some testing like you suggested I wanted to minimize the number of packages affected by a change this close to the release, so I first tried to filter out packages that aren't affected by the bug. All counts include package and version: So we could add default setup dependencies in a way that only affects ~328 packages. Then I tested the effects of calling
The only package that compiled with 1.22 but not 1.24 was hpqtypes (all 12 versions). Here are the missing imports. Since I didn't download full packages, some of these modules could be included in the package, like
It seems like the biggest problem with calling |
@grayjay Thanks for looking into this!
What was the error?
OK, so we need to include
This module was removed from
I don't think we should add
These look like internal dependencies.
In principle yes, we could invoke |
I tried this approach but got stuck. I was able to enforce the constraint on Cabal by setting I also tried adding a dependency on Cabal >= 1.24 using After looking into it, I realized that this change is much more complicated than I first thought, and I'm not very familiar with the code. I don't think I'll be able to finish it in time. I posted the function that I used to check whether this issue applies to a package, if someone wants to pick it up: https://gist.github.com/grayjay/c5c2627d02303bd59a3b164055233bcb |
@ezyang Thanks for looking into the other error. |
Fixes haskell#3199. (cherry picked from commit 2f97657)
(cherry picked from commit d70c9aa)
Fixes haskell#3199. (cherry picked from commit 2f97657)
(cherry picked from commit d70c9aa)
(cherry picked from commit d70c9aa)
Fixes haskell#3199. (cherry picked from commit 2f97657)
(cherry picked from commit d70c9aa)
(cherry picked from commit d70c9aa)
Removes command and cleanups cabal-testsuite. The tests for haskell#3199 haskell#4099 haskell#3436 are removed, but they seem to be sandbox specific issues.
Removes command and cleanups cabal-testsuite. The tests for haskell#3199 haskell#4099 haskell#3436 are removed, but they seem to be sandbox specific issues.
Removes command and cleanups cabal-testsuite. The tests for haskell#3199 haskell#4099 haskell#3436 are removed, but they seem to be sandbox specific issues. Removes Sandbox.Types, Sandbox.Index and Sandbox.Timestamp modules. The Sandbox and Sandbox.PackageEnvironment are still there as some configuration in v1-commands happens through them (~/.cabal/config vs ./cabal.config). BuildExFlags contained only sandbox specific parameter, so it's removed as well. Remove sandbox support from cabal-testsuite Remove sandbox from GlobalFlags and Sandbox unit-tests
New report (edited by @ezyang)
Cabal 1.23 and later #2731 allow you to skip specifying dependencies which are not part of a buildable component. cabal-install was updated to take advantage of this fact.
However, when a package has a
Custom
setup script, it is possible for the Setup script to be built against an old version of Cabal, which is doesn't know to ignore non-buildable dependencies. In this case, cabal-install will pass an insufficient set of dependencies, resulting in an error like this:(where these are dependencies of non-buildable components.)
A workaround is to explicitly request that all components be built. For example, if there is some flag which must be selected to make a component buildable, you should pass
--constraint="package-name +flagname"
Original bug report:
Trying to build pandoc-citeproc (which has a custom Setup.hs with a couple of hooks) using the latest-packaged version from git in the HVR repository (Version: 1.23+git20160204.0.7aab356~wily) fails to find dependencies already installed in a sandbox (whether the dependencies are installed manually or via the dependency solver).
This was previously filed as jgm/pandoc-citeproc#216
The text was updated successfully, but these errors were encountered: