haskell-hvr / cabal-plan

Library and utility for processing cabal's plan.json file
https://hackage.haskell.org/package/cabal-plan
GNU General Public License v2.0
38 stars 25 forks source link

Fix: Macro version was broken (Cabal) #88

Closed andys8 closed 2 years ago

andys8 commented 2 years ago

Solves https://github.com/haskell-hvr/cabal-plan/issues/87

andys8 commented 2 years ago

This in turn doesn't work if compiled against CAbal

What does this mean exactly?

I don't know if I fully understand what's going on with that condition. The way I interpreted it, is that only the if flag(license-report) part containes a Cabal/Cabal-syntax dependency.

https://github.com/andys8/cabal-plan/blob/63b5c003074a3bd5bea4b6e9d7f3d06eefed20fc/cabal-plan.cabal#L129-L134

And therefore #if defined(MIN_VERSION_Cabal[_syntax]) is only a guard to make sure the flag was activated. Therefore it otherwise results in

Please recompile/reinstall cabal-plan with the license-report Cabal flag activated.

https://github.com/andys8/cabal-plan/blob/63b5c003074a3bd5bea4b6e9d7f3d06eefed20fc/src-exe/LicenseReport.hs#L12

So, how are users installing it against Cabal? Is this a compat thing I don't know of? Or if cabal-plan is used as library? And most important: How can it be fixed - since I think the current state is broken?

phadej commented 2 years ago

Squashed in https://github.com/haskell-hvr/cabal-plan/pull/89, thanks.

phadej commented 2 years ago

Release https://hackage.haskell.org/package/cabal-plan-0.7.2.3