juhp / cabal-rpm

Haskell Cabal RPM packaging tool
https://hackage.haskell.org/package/cabal-rpm
GNU General Public License v3.0
25 stars 8 forks source link

Crash on fromJust if no library is specified #61

Closed dminuoso closed 3 years ago

dminuoso commented 4 years ago

If the project uses no library (or a sub-library instead of a library), the code crashes with

cabal-rpm: Maybe.fromJust: Nothing

triggered by https://github.com/juhp/cabal-rpm/blob/master/src/Commands/Spec.hs#L344

I'm not intimately familiar with the internals, so I can't say what the right cause of action is. Either the README.md should document that a libraryis mandatory, or it should consult sub libraries as well. Why does this need a library at all?

juhp commented 4 years ago

Thanks for reporting this. It would help me to have more details or an example of how to reproduce this. Does commit 1c7760c help?

I think current support for internal libraries is incomplete: they get listed as package dependencies - I will try to improve that later.

juhp commented 3 years ago

Going to close this, assuming it is okay now. But if not please comment or (re)open issue, thanks