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
You can force project planning by using cabal build --dry. That command is however requires that you in fact have build environment set up. The project-plan should be able to take all required information as separate input (compiler information, installed package info db, pkgconfig db, ...).
project-plan would both useful for system independent testing (simulating various scenarios, where setting up environment is just too tricky for CI), and we can use it to produce plans for cabal's new bootstrap (#6700).
Late to the party but it turns out I had a go a this. I requires moving few things around but IIRC no roadblocks. I had a version of ProjectPlanning.hs that takes compiler, platform and arch as parameters.
The only issue was with pkg-config, as we cannot know in advance which packages might be relevant for the plan. Perhaps we could overapproximate the set of relevant pkgconfig entries and report that to the user? I am not sure how this would work.
relevant pkgconfig entries and report that to the user?
cabal-installs solver takes the whole pkgconfig database as the input.
EDIT: Note that my original request was asking to take the whole global package db as an input as well. E.g. on linux you don't have Win32, but on Windows you do (but don't have unix). Nor you cannot really predict their versions either.
cabal-installs solver takes the whole pkgconfig database as the input.
That might be the only solution.
Note that my original request was asking to take the whole global package db as an input as well.
Good point.
Now I remember another thing that wasn't entirely trivial: cabal-install wants to know a lot about the compiler (it calls --info). I think it mostly end up using the list of supported extensions and languages; but I am not sure to what purpose.
and the compiler doesn't know it, solver will take that into account. (E.g. say you want QuantifiedConstraints, or OverloadedRecordDot...)
i.e. a capability based compiler support. (It would been better if extensions didn't change, but that works well for things like QuantifiedConstraints or TypeApplications, which are more-or-less perfect in the first GHC they were added).
Activity
hasufell commentedon Dec 12, 2020
Another use case might be ghcup using this to figure out a suitable GHC version for a project: https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/99
jneira commentedon Nov 6, 2021
cabal info(Addstatuscommand to cabal #7500)andreabedini commentedon Jun 25, 2023
Late to the party but it turns out I had a go a this. I requires moving few things around but IIRC no roadblocks. I had a version of ProjectPlanning.hs that takes compiler, platform and arch as parameters.
The only issue was with pkg-config, as we cannot know in advance which packages might be relevant for the plan. Perhaps we could overapproximate the set of relevant pkgconfig entries and report that to the user? I am not sure how this would work.
Let me know if there's still interest.
phadej commentedon Jun 25, 2023
@andreabedini
cabal-installs solver takes the whole pkgconfig database as the input.EDIT: Note that my original request was asking to take the whole global package db as an input as well. E.g. on linux you don't have
Win32, but on Windows you do (but don't haveunix). Nor you cannot really predict their versions either.andreabedini commentedon Jun 25, 2023
That might be the only solution.
Good point.
Now I remember another thing that wasn't entirely trivial: cabal-install wants to know a lot about the compiler (it calls
--info). I think it mostly end up using the list of supported extensions and languages; but I am not sure to what purpose.phadej commentedon Jun 26, 2023
If you say
other-extensions: SomethingFancyand the compiler doesn't know it, solver will take that into account. (E.g. say you want
QuantifiedConstraints, orOverloadedRecordDot...)i.e. a capability based compiler support. (It would been better if extensions didn't change, but that works well for things like
QuantifiedConstraintsorTypeApplications, which are more-or-less perfect in the first GHC they were added).andreabedini commentedon Aug 30, 2023
I have made a poc https://github.com/andreabedini/cabal-solver-plan
Note that this is only the (per-package) solver plan and not the (per-component) elaborated plan.