Skip to content

Add project-plan command #6885

Open
Open

Description

@phadej

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).

cc @angerman @bgamari

I suspect that this will require some non-trivial changes inside cabal-install, but I do think they will be for better, making implicits explicit.

Activity

  1. self-assigned this
    on Jun 8, 2020
  2. hasufell commented on Dec 12, 2020

    @hasufell
    Member

    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

  3. jneira commented on Nov 6, 2021

    @jneira
    Member
    • for hie-bios to get as well the ghc of a project and gives it to tooling using the lib (like haskell-language-server)
    • it think this should be part of cabal info (Add status command to cabal #7500)
  4. andreabedini commented on Jun 25, 2023

    @andreabedini
    Collaborator

    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.

  5. phadej commented on Jun 25, 2023

    @phadej
    CollaboratorAuthor

    @andreabedini

    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.

  6. andreabedini commented on Jun 25, 2023

    @andreabedini
    Collaborator

    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.

  7. phadej commented on Jun 26, 2023

    @phadej
    CollaboratorAuthor

    but I am not sure to what purpose.

    If you say

    other-extensions: SomethingFancy

    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).

  8. self-assigned this
    on Jun 26, 2023
  9. andreabedini commented on Aug 30, 2023

    @andreabedini
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions