-
Notifications
You must be signed in to change notification settings - Fork 695
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
build-tool-depends silently ignored for non-existent executable #4781
Comments
It looks like cabal doesn't solve for specific executables yet: cabal/cabal-install/Distribution/Solver/Modular/IndexConversion.hs Lines 374 to 376 in d53b6e0
That will probably require #4087. |
@grayjay yeah that was a stop-gap in lieu of per-component solving. Is a better solution possible now? |
Can we make specific constraints, including only versions of package with an executable requested. That should work even we don't have per-component solving |
That would be nice. To be clear, this still fails on the Cabal library side of things, right? I added a bunch of tests and stuff for those failure cases. |
@Ericson2314 I don't know of a better solution now. @phadej Where would the constraints be specified? It seems like that would be easier to implement than complete per-component dependency solving. |
@grayjay when the build-tool-depends executable is requested, we could elaborate that into more precise constraints than just package (+ bounds). I don't know how it happens now though :( |
I think that would need to happen in the solver, after it chooses to build a package that has a build-tool-depends dependency. That corresponds to the first tree transformation that I described under "Component dependency validation steps" in #4087 (comment). I don't think we need to add the other tree transformations as long as we continue to require the dependencies for all executables for each package. |
This commit adds two checks to the validation phase of the solver: 1. It checks that each newly chosen package instance contains all executables that are required from that package so far. 2. It checks that each new build tool dependency that refers to a previously chosen package can be satisfied by the executables in that package. This commit also fixes a TODO related to solver log messages. Previously, it was possible for the log to associate an incorrect executable name with a dependency.
This commit adds two checks to the validation phase of the solver: 1. It checks that each newly chosen package instance contains all executables that are required from that package so far. 2. It checks that each new build tool dependency that refers to a previously chosen package can be satisfied by the executables in that package. This commit also fixes a TODO related to solver log messages. Previously, it was possible for the log to associate an incorrect executable name with a dependency.
Solver: Enforce dependencies on executables (fixes #4781).
This commit generalizes the fix for issue haskell#4781 (e86f838) by tracking dependencies on components instead of dependencies on executables. Associating each dependency with a component also moves towards the design for component-based dependency solving described in issue haskell#4087.
This commit generalizes the fix for issue haskell#4781 (e86f838) by tracking dependencies on components instead of dependencies on executables. That means that the solver always checks whether a package contains a library before using it to satisfy a build-depends dependency. If a version of a package doesn't contain a library, the solver can try other versions. Associating each dependency with a component also moves towards the design for component-based dependency solving described in issue haskell#4087.
This commit generalizes the fix for issue #4781 (e86f838) by tracking dependencies on components instead of dependencies on executables. That means that the solver always checks whether a package contains a library before using it to satisfy a build-depends dependency. If a version of a package doesn't contain a library, the solver can try other versions. Associating each dependency with a component also moves towards the design for component-based dependency solving described in issue #4087.
This commit generalizes the fix for issue #4781 (e86f838) by tracking dependencies on components instead of dependencies on executables. That means that the solver always checks whether a package contains a library before using it to satisfy a build-depends dependency. If a version of a package doesn't contain a library, the solver can try other versions. Associating each dependency with a component also moves towards the design for component-based dependency solving described in issue #4087. (cherry picked from commit 6efb5e2)
Consider the following specification,
when invoking
new-build
, this silently succeeds. And also,plan.json
doesn't record anyexe-depends
fromdummypkg-0-inplace
onmtl
as it would ifbuild-tool-depends
referred to an actually existing executable:For a
build-tool-depends
declaration, I'd expect the solver to require the existence of that executable in the respective package as a constraint to solve for. The reason being is that packages may start out as a library, and in later releases start adding an executable. Or sometimes executables may get renamed or removed./cc @grayjay @Ericson2314
The text was updated successfully, but these errors were encountered: