Skip to content
  • Herbert Valerio Riedel's avatar
    Implement better defaulting for `build-type` · 9fb03d73
    Herbert Valerio Riedel authored
    This implements the following defaulting rules:
    
     * For `cabal-version:2.0` and below, default to the `Custom`
       build-type unconditionally (legacy defaulting)
    
     * Otherwise, if a `custom-setup` stanza is defined, default to
       the `Custom` build-type; else default to `Simple` build-type.
    
    This gets us better defaults for the two most popular use-cases, and
    which can be statically inferred by only looking at the `.cabal` file.
    
    This allows us to bring down the minimal (modern) trivial cabal
    package definition down to a single file with 4 lines:
    
        cabal-version: 2.1
        name: mu
        version: 0
        library
    
    NB: We don't need any `Setup.hs` file, as `cabal sdist` will magically
    generate one on the fly.
    9fb03d73