Skip to content
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

show-build-info (exe:cabal part plus tests) #6241

Closed
wants to merge 24 commits into from

Commits on Jul 7, 2020

  1. Add show-build-info command

    This allows users to get a JSON representation of various information
    about how Cabal would go about building a package. The output of this
    command is intended for external tools and therefore the format should
    remain stable.
    bgamari authored and lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    c183666 View commit details
    Browse the repository at this point in the history
  2. Rebase work of cfraz89 and bgamari

    Add (currently nonfunctional) new-show-build-info
    Fix compile error
    Make new-show-build-info functional
    Use silent verbosity by default on showBuildInfo commands to keep output json clean
    Make show-build-info commands hidden
    Implement write-autogen-files
    Make new-write-autogen-files work
    Make new-write-autogen-files configure if necessary
    Use target selectors for new-show-build-info
    Don't prune plan for new-show-build-info
    Only configure in new-show-build-info and new-write-autogen-files if no persist build info file is found
    Wrap multiple target output of new-show-build-info in json list
    fendor authored and lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    26c3d91 View commit details
    Browse the repository at this point in the history
  3. Improve s-b-i frontend command and add tests

    Also, rename new-show-build-info to show-build-info in ShowBuildInfo
    fendor authored and lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    5338fdc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6faaac9 View commit details
    Browse the repository at this point in the history
  5. Fix typo

    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    d0cf8d7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b17c1cc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    815a16d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3a956b1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    947a908 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f3bafbe View commit details
    Browse the repository at this point in the history
  11. Tidy up imports

    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    781695b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fe2bab9 View commit details
    Browse the repository at this point in the history
  13. Cosmetic fixes

    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    af54a71 View commit details
    Browse the repository at this point in the history
  14. Modernize CmdShowBuildInfo

    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    9708c4b View commit details
    Browse the repository at this point in the history
  15. Rework show-build-info command to avoid wrapper

    This means that cabal-install now extracts the LocalBuildInfo etc.
    itself for each component, and now assembles the JSON without the need
    for writing to temporary files. It also means that one build info JSON
    object can be returned instead of an array. It works by configuring each
    component separately as before, and instead of making its own build info
    object, it just collects the component information.
    
    This one build info object now reports the compiler used with the
    ElaboratedSharedConfig, which is shared across all components.
    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    7a59fd4 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    554f679 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    08a5e93 View commit details
    Browse the repository at this point in the history
  18. Update .prod/.zinz templates

    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    4c1978f View commit details
    Browse the repository at this point in the history
  19. Silence Haddock output

    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    6180494 View commit details
    Browse the repository at this point in the history
  20. Add AmbiguityResolver to decide how to resolve ambiguty

    Every other command defaults to what they used to do. show-build-info
    now just chooses the first choice, since it doesn't care about
    ambiguity.
    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    6daaa52 View commit details
    Browse the repository at this point in the history
  21. Add --pick-first-target flag

    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    d52bdde View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    23b8870 View commit details
    Browse the repository at this point in the history
  23. Generate autogen files

    These are needed by tooling to setup GHC sessions.
    lukel97 committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    25aef99 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. Rework show-build-info to use ProjectPlanning/Building infrastructure

    This fixes a lot of edge cases for example where the package db wasn't
    created at the time of configuring. Manually doing the setup.hs wrapper
    stuff was hairy.
    
    It also changes the internal representation of JSON to Text rather than
    String, and introduces the buildinfo-components-only flag in the Cabal
    part to make it easier to stitch back the JSON into an array in
    cabal-install.
    
    Turns out we do need to keep the show-build-info part inside Cabal as we
    rely on LocalBuildInfo which can change between versions, and we would
    need to do this anyway if we wanted to utilise the
    ProjectPlanning/Building infrastructure.
    lukel97 committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    84aa560 View commit details
    Browse the repository at this point in the history