This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 24 Mar, 2016 3 commits
    • Duncan Coutts's avatar
      InstallPlan util to replace a ready package with an installed one · e869d803
      Duncan Coutts authored
      There are two cases in which we replace source packages with ones that
      are already installed: during planning when we improve the plan by
      replacing configured source packages with pre-existing packages from the
      store, but also there's just the case of skipping over a local package
      that is already built and up to date. In the latter case we're replacing
      a package in the Configured state not with one in the PreExisting state,
      but with one in the Installed state, as if it had been built and
      installed (which in a sense of course it has).
      
      This new util is for the latter case.
      e869d803
    • Duncan Coutts's avatar
      Split out reusable lookupReadyPackage util in InstallPlan · 150c3189
      Duncan Coutts authored
      Used in the next patch.
      150c3189
    • Duncan Coutts's avatar
      Add new style project planning · 2d065c8c
      Duncan Coutts authored
      This implements the planning phase of the new nix-style package build and
      install system. In particular it includes the calculation of the
      nix-style package ids by hashing all the package configuration.
      
      Project planning is separated from project building.
      
      The planning phase starts with finding the packages in the project and
      then solving. We solve without looking at the installed packages in the
      store. This makes everything more deterministic. The only installed
      packages the solver looks at are the globally installed ones. This
      approach also means we don't have any need of solver options like
      --reinstall or --avoid-reinstalls etc.
      
      The bulk of the planning phase is elaboration. We take the project
      configuration and the solver's InstallPlan and elaborate the latter into
      an ElaboratedInstallPlan. This is intended to contain all the details
      needed for the build phase. For example all the "setup" command flags
      are calculated directly from the elaborated plan.
      
      The building phase is then intended to be much simpler and free of much
      logic or policy. All of the complicated logic and policy is supposed to
      be in the planning phase. This should also make things a lot easier to
      debug, we can look at the plan we calculate and see if we're producing
      the right build instructions, rather than debugging based on the actions
      we end up executing.
      
      Doing all the planning up front is also crucial to calculating nix-style
      package hashes. This means we have the package ids up front. This then
      allows us to have another up-front phase where we improve the plan by
      replacing source packages with installed packages from the store.
      
      All of this stuff is done in the Rebuild monad, with a few levels of
      caches, so most of the time we can avoid recomputing the plan. In
      particular we want to avoid re-running the solver unless we have to.
      
      There are still quite a number of TODOs, which are categorised.
      2d065c8c
  2. 19 Mar, 2016 2 commits
  3. 18 Mar, 2016 8 commits
  4. 17 Mar, 2016 1 commit
  5. 16 Mar, 2016 2 commits
  6. 13 Mar, 2016 9 commits
    • Duncan Coutts's avatar
      Add project config round trip QC tests · e36c0e7e
      Duncan Coutts authored
      Two kinds of round-trip test:
       * type conversion ProjectConfig -> LegcyProjectConfig and back
       * ProjectConfig -> print -> parse
      The latter goes out to the config file format and back.
      
      These tests uncovered a number of issues in our general config code.
      e36c0e7e
    • Duncan Coutts's avatar
      New module for new style project configuration files · 324b3240
      Duncan Coutts authored
      This defines the new cabal.project files and introduces the notion of a
      project root (and the logic for finding it). Also has support for
      implicit projects when no cabal.project file is defined.
      
      Supports both reading and writing project files or fragments. The
      printing & parsing round trips correctly. QC tests to follow.
      
      This is a key part of the new nix-local-build branch approach, based
      around projects with clear configuration state held in a project file
      (or extra files).
      
      This has support for file and dirs as packages within a project,
      including by glob. It supports both globs that much match a target, and
      optional globs that are allowed to match nothing. It has partial support
      for local tarball, remote http tarball and remote source repo packages.
      324b3240
    • Duncan Coutts's avatar
      Split FlagAssignment printer/parser out of UserConstraint ones · d0fb249e
      Duncan Coutts authored
      We want to reuse the FlagAssignment printer/parser for the config files.
      d0fb249e
    • Duncan Coutts's avatar
      Add a couple glob utils · 4365bcb1
      Duncan Coutts authored
      One for testing if globs are trivial, as in they're constant strings
      without the possibility of matching more than one thing. This can help
      with making better error messages.
      
      Another util for matching file globs in the rebuild monad, and
      automatically monitoring the glob.
      4365bcb1
    • Duncan Coutts's avatar
      Add new DistDirLayout module · 7907a55c
      Duncan Coutts authored
      This describes in one place the layout of the new dist dir, as used by
      the nix-local-build branch. Also a similar approach to describing the
      layout of the user-wide cabal directory.
      
      The idea is that this centralises the description and makes it easier
      to change and handle systematically (e.g. we have problems currently
      with some user-wide files not being reolocatable).
      7907a55c
    • Duncan Coutts's avatar
      New parse utils to help with subsections · 2f743b6d
      Duncan Coutts authored
      The existing approach has been to parse top level fields and then
      separately parse each top level section, and similarly for pretty
      printing. A better approach is to follow the pattern for fields and have
      a section description. Then we just parse or print fields+sections in
      one call. And as a bonus, secitons can have subsections (and could even
      do so recursively).
      
      This patch just adds the new functionality. No existing config parsing
      is switched over.
      2f743b6d
    • Duncan Coutts's avatar
      Refactor withRepoContext so it can takes args separately · 7b280cdd
      Duncan Coutts authored
      withRepoContext keeps its current type (using GlobalFlags). Added
      withRepoContext' that takes all the args seprately. Better name
      suggestions welcome.
      7b280cdd
    • Duncan Coutts's avatar
      Correct typos in the cli/config lenses · a82af445
      Duncan Coutts authored
      Getters and setters really need to match up.
      
      Detected by parse/print round trip QC tests.
      a82af445
    • Mikhail Glushenkov's avatar
      Merge pull request #3225 from ttuegel/issue-3157-1.24 · 01fa2a2e
      Mikhail Glushenkov authored
      Fix ConfigStateFileError messages
      01fa2a2e
  7. 12 Mar, 2016 3 commits
  8. 10 Mar, 2016 2 commits
  9. 09 Mar, 2016 1 commit
  10. 08 Mar, 2016 1 commit
    • gershomb's avatar
      update -prof Check message · 9d89cc70
      gershomb authored and Mikhail Glushenkov's avatar Mikhail Glushenkov committed
      The flag enable-executable-profiling warns to change it to just enable-profiling. So we'll fix that here too so we don't send people down an old path.
      (cherry picked from commit c69dfb82)
      9d89cc70
  11. 07 Mar, 2016 3 commits
  12. 05 Mar, 2016 3 commits
  13. 04 Mar, 2016 2 commits