Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Michael Snoyman
Got it, thanks. Mikhail: thank you for the feedback too. If you want me to review any updates, let me know. On Tue, Feb 20, 2018 at 10:19 PM, Oleg Grenrus wrote: > Good point. There aren't ReadP-parser for SPDX.License, so no Text > instance either. > But there is

Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Herbert Valerio Riedel
On Tue, Feb 20, 2018 at 2:47 PM, Michael Snoyman wrote: > If I could make a request, it would be that, in > the future, new runtime behavior come with a new function name, to convert > runtime errors into compile time errors. Well, this is one of the primary reasons we have

Upgrading Stack to Cabal 2.2

2018-02-20 Thread Michael Snoyman
Hi all, Oleg mentioned to me on Reddit that a 2.2 branch has been cut for Cabal, and recommended we try to upgrade Stack to it. I'm sharing information here on that process in case it's useful to others, either as feedback on the API changes, or help for others going through similar upgrades. If

Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Oleg Grenrus
Hi Michael, thanks for your comments! - The allBuildInfo change is https://github.com/haskell/cabal/commit/8fc10320a5dc4898927c84ad6a2dce7965ef30db, I agree with Herbert on this. New `allBuildInfo` implementation is correct given the name. There was even a TODO to make that change.

Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Michael Snoyman
I'm sorry, I'm not quite sure I understand your recommendation. Are you saying that I should ideally replace all usages of `License` in the Stack codebase with `Either SPDX.License License`? That _should_ be possible, the only questions I'd have are: 1. We additionally grab license info from the

Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Oleg Grenrus
1. The InstalledPackageInfo license field is also `Either SPDX.License License` [1] and you can get a list of IPIs conviently with `HcPkg.dump` [2] 2. It's up to you, if `Text` is enough, go for it. In the future you might want to provide some license reports, where you'll need structured license

Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Michael Snoyman
Alright, I've updated the PR to use `Either SPDX.License License`: https://github.com/commercialhaskell/stack/pull/3878/commits/6679aafe99a087dd6aac341fce965f4067e1be77 The only difference from your description that I ran into is that there's no Text instance for SPDX.License, meaning instead

Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Mikhail Glushenkov
Hi, On 20 February 2018 at 13:47, Michael Snoyman wrote: > Hi all, > > Oleg mentioned to me on Reddit that a 2.2 branch has been cut for Cabal, and > recommended we try to upgrade Stack to it. I'm sharing information here on > that process in case it's useful to others,

Re: Upgrading Stack to Cabal 2.2

2018-02-20 Thread Oleg Grenrus
Good point. There aren't ReadP-parser for SPDX.License, so no Text instance either. But there is `Distribution.Pretty.Pretty` instance (`prettyShow`). - Oleg On 20.02.2018 20:28, Michael Snoyman wrote: > Alright, I've updated the PR to use `Either SPDX.License License`: > >