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
{{ message }}
Repository navigation
new-freeze freezes the dependencies of unused components. #5136
I reproduced this issue by adding an executable to a package that is used only as a library dependency in one of the tests in #5135: sebright@abba0dc. The new executable has a dependency on the package exe-dependency. Since exe-dependency isn't required by any other component, new-build shouldn't need to build it. However, new-freeze adds a constraint on the package. (The commit adds an assertion checking for the constraint, and it passes.) I think that this type of constraint shouldn't be necessary in new-build, especially once we implement component-based dependency solving, and the solver doesn't need to choose dependencies for unused components.
I think this is related to the old-freeze issue #1896.
The solver always solves for all components of every dependency, because it doesn't yet have a way to determine which components are needed. That is a big part of #4087. I had assumed that new-build immediately pruned the solver's install plan to remove unnecessary components, but it looks like that isn't true. I just checked plan.json for the small example, and it also contains the exe dependency.
Activity
phadej commentedon Feb 12, 2018
By playing with
cabal-planI noticed that executables of dependencies end up in the plan. For example:note the
exe:warpabove the red line. I think it shouldn't be there.I don't know how this works regarding store. Do we optimistically† solve for exes too, so they end up in the plan?
EDIT But then it has a side-effect of executable showing in the plan:
† so solver is free to turn them off, if their deps get in the way
sebright commentedon Feb 12, 2018
The solver always solves for all components of every dependency, because it doesn't yet have a way to determine which components are needed. That is a big part of #4087. I had assumed that new-build immediately pruned the solver's install plan to remove unnecessary components, but it looks like that isn't true. I just checked plan.json for the small example, and it also contains the exe dependency.