google / ghc-source-gen

Library for generating Haskell source files and code fragments.
BSD 3-Clause "New" or "Revised" License
91 stars 29 forks source link

Make Cabal 3.7 happy #95

Closed Bodigrim closed 2 years ago

Bodigrim commented 2 years ago

Cabal 3.7 (built from HEAD) has a stricter validation for conditionals and complains about duplicate modules:

$ cabal build
Resolving dependencies...
Build profile: -w ghc-8.10.6 -O1
In order, the following will be built (use -v for more details):
 - ghc-source-gen-0.4.3.0 (lib) (first run)
Configuring library for ghc-source-gen-0.4.3.0..
Error: cabal: Duplicate modules in library: GHC.Driver.Monad,
GHC.Driver.Session, GHC.Hs.Type, GHC.Plugins, GHC.Tc.Types.Evidence,
GHC.Types.Basic, GHC.Utils.Outputable

It seems this stricter validation contradicts hpack's efforts to normalise conditional blocks, so I had to use verbatim.

CC @sol @gbaz @jinwoo

blackgnezdo commented 2 years ago

Thanks for the fix, @Bodigrim!

This looks good to me, but I'm confused by this CI error:

Unpacking GHC into /home/circleci/.stack/programs/x86_64-linux/ghc-9.0.1.temp/ ...
Received ExitFailure (-15) when running
Raw command: /bin/tar Jxf /home/circleci/.stack/programs/x86_64-linux/ghc-9.0.1.tar.xz
Run from: /home/circleci/.stack/programs/x86_64-linux/ghc-9.0.1.temp/

Error: Error encountered while unpacking GHC with
         tar Jxf /home/circleci/.stack/programs/x86_64-linux/ghc-9.0.1.tar.xz
         run in /home/circleci/.stack/programs/x86_64-linux/ghc-9.0.1.temp/

       The following directories may now contain files, but won't be used by stack:
         - /home/circleci/.stack/programs/x86_64-linux/ghc-9.0.1.temp/
         - /home/circleci/.stack/programs/x86_64-linux/ghc-9.0.1/

       For more information consider rerunning with --verbose flag

Exited with code exit status 1
CircleCI received exit code 1

Also, CLA.

Bodigrim commented 2 years ago

This looks good to me, but I'm confused by this CI error:

This fails before an actual build starts, so unlikely caused by my changes. Maybe upgrade Stackage snapshot to the latest nightly?

blackgnezdo commented 2 years ago

This looks good to me, but I'm confused by this CI error:

This fails before an actual build starts, so unlikely caused by my changes. Maybe upgrade Stackage snapshot to the latest nightly?

Yes, you are right. Maybe you can pick up the one line change from blackgnezdo:stack-9.0-new-nightly into this PR?

Bodigrim commented 2 years ago

Fixed in #96