<div dir="ltr"><div>Hi all,</div><div><br></div><div>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 anyone would rather that I do or do not post such reports in the future, let me know.</div><div><br></div><div>I've opened a PR for this change[1], which currently is a single commit[2]. As you can see from the change to stack.yaml[3], I needed to refer to the commit of Cabal in question, and turn on `allow-newer` for some packages (cabal-doctest and http-api-data) with restrictive upper bounds on Cabal. Both of these packages compiled without issue.</div><div><br></div><div>No change was necessary to Stack's Setup.hs file.</div><div><br></div><div>Most of the changes so far were compile-time errors, which is a Good Thing. Changes I had to make:</div><div><br></div><div>* The build type is no longer a Maybe field. (As a user: this is a nice change, no longer a need to guess about what a Nothing value means.)</div><div>* There are now two License types, the original one and the SPDX variant. I don't understand what this change is about, some further explanation in the docs or the ChangeLog would definitely be appreciated. But hacking my way through the types seems to have worked.</div><div>* Parsing a package description now works on a ByteString instead of a String. This allowed me to remove some UTF8 conversion and BOM-stripping code, which is very nice.</div><div>* The new parsing API exposes the cabal file version when that prevented the parse (at least, that's my understanding). The changes to accommodate the new API were relatively trivial, so another +1 here.</div><div>* Also: getting file position information for warnings and errors is _very_ nice. +1</div><div><br></div><div>I haven't done extensive testing yet, but I've so far only found one bug due to runtime changes: the behavior of allBuildInfo has changed to now include non-buildable components. This resulted in some confusion until I reviewed the changelog more closely. 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. This was _not_ a particularly difficult issue to work around though, in large part thanks to the changelog.</div><div><br></div><div>I'll continue testing this branch of Stack. Our plans are to merge this to master, and release Stack 1.7.0 close to the Cabal 2.2 release date.</div><div><br></div><div>Michael<br></div><div><br></div><div>[1] <a href="https://github.com/commercialhaskell/stack/pull/3878/files">https://github.com/commercialhaskell/stack/pull/3878/files</a></div><div>[2] <a href="https://github.com/commercialhaskell/stack/pull/3878/commits/a101341d04213d6dd8e0cf16d2f2fef8e7ed5cd5">https://github.com/commercialhaskell/stack/pull/3878/commits/a101341d04213d6dd8e0cf16d2f2fef8e7ed5cd5</a></div><div>[3] <a href="https://github.com/commercialhaskell/stack/pull/3878/commits/a101341d04213d6dd8e0cf16d2f2fef8e7ed5cd5#diff-fafd0cdcd559a7b124cc61c29413fb54">https://github.com/commercialhaskell/stack/pull/3878/commits/a101341d04213d6dd8e0cf16d2f2fef8e7ed5cd5#diff-fafd0cdcd559a7b124cc61c29413fb54</a><br></div></div>