Backport PR #2226 to cabal 1.20