Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. Jan 29, 2024
    • Rodrigo Mesquita's avatar
      Don't build unnecessary targets of legacy-fallback deps. · e8c9d194
      Rodrigo Mesquita authored
      The refactor in f70fc980 solved an
      inconsistency in `buildAndInstallUnpackedPackage`. Namely, before the
      refactor, we didn't pass `hsSetupBuildArgs` to the build invocations,
      and afterwards we did.
      
      The result is that build targets of (legacy) package `B`, that a package
      `A` depends on, are now passed to the ./Setup build invocation of
      package `B` (e.g. `./Setup build lib:openapi3` rather than just `./Setup
      build`).
      
      This means we no longer /build always all targets of a legacy-package/
      (for example, the lib, the testsuites and the executables).
      Instead only the required target (just the lib) will be built.
      
      However, despite now passing the build args to `./Setup build`, we
      weren't passing the same arguments to the `./Setup copy` invocation.
      Therefore, `./Setup copy` would also try to copy targets of the package
      that weren't built, resulting in a failure.
      
      This fixes that failure by correctly passing the build targets to the
      `./Setup copy` invocation, just like we do for the `./Setup build` one.
      
      Fixes #9640
      e8c9d194
    • Andrea Bedini's avatar
      Drop sub-component targets (#8966) · 3f4c81fd
      Andrea Bedini authored
      This change removes support for building sub-component targets in
      cabal-install, since no versions of Cabal support this feature.
      
      The test RunMainBad is also dropped because without the concept of a
      file target, RunMainBad is the same test as ScriptBad.
  2. Jan 19, 2024
  3. Jan 18, 2024
  4. Jan 12, 2024
    • Rodrigo Mesquita's avatar
      Stop logging to file when build inplace · 83aaa637
      Rodrigo Mesquita authored
      In f70fc980, while refactoring
      buildInplaceUnpackedPackage and buildAndInstallUnpackedPackage, we
      started logging into a file on both cases, instead of logging to a file
      only for buildAndInstallUnpackedPackage.
      
      When building a package inplace, it is much more useful to be able to
      see the GHC invocation directly outside of a log file.
      
      This is especially relevant for Cabal developers working inplace.
      
      Fixes #9606
      83aaa637
  5. Jan 08, 2024
    • Rodrigo Mesquita's avatar
      Refactor ProjectBuilding into Package Phases · f70fc980
      Rodrigo Mesquita authored
      This refactor of Distribution.Client.ProjectBuilding does the following:
      
      * Moves package file monitoring logic to
        Distribution.Client.ProjectBuilding.PackageFileMonitor
      
      * Moves the `buildInplaceUnpackedPackage` and
        `buildAndInstallUnpackedPackage` with auxiliary functions to
        Distribution.Client.ProjectBuilding.UnpackedPackage
      
      * Refactors the common bits of `buildInplaceUnpackedPackage` and
        `buildAndInstallUnpackedPackage` to remove considerable code
        duplication while simplifying and making both functions more
        structured.
      
      Namely, to better structure build inplace vs build and install, I've
      introduced:
      
      * `PackageBuildingPhase` describes the various phases of processing the
        unpacked package both inplace and on install
          * Configure
          * Build
          * Install (copy + register)
          * Test
          * Bench
          * Repl
          * Haddock
      
      * Then, `buildAndRegisterUnpackedPackage` implements the common logic
        between the two functions (such as calls to ./Setup and the order of
        the phases) but delegates the logic specific to each phase to an
        argument function which maps `PackageBuildingPhase` to `IO` actions.
      
      * Now, build inplace and build and install functions are comprised as:
          * A wrapper around `buildAndRegisterUnpackedPackage` which does
            things specific to each before and after the main phases are
            processed
          * A delegate function which maps an action to each package
            processing phase
      
      Fixes #9499
      f70fc980
Loading