I recently published a very small package, partially to learn a bit more of the ecosystem. Although I succeeded I wanted to share some paper-cuts in the process in case they are worth improving from a developer experience for new-comers. I’m not sure if this is the right place to discuss them.
I used cabal-install 3.10.3.0
and ghc 9.4.8
since those are the recommended versions at this time.
The cabal init
generated a build-depends: base ^>=4.17.2.1
.
I uploaded a candidate package as suggested. Everything looked good enough. The first thing that struck me here is that the uploaded candidate was not getting documentation. I wondered if that was a limitation of the candidate workflow or if there was something wrong with my package. Some other candidates seem to have documentation but it is not clear to me if those were manually uploaded.
I proceeded then to publish the real package at 0.1.0.0. There was no read flag in the candidate upload from what I could see.
After publishing I got a build error. Having base ^>=4.17.2.1
as a restriction seems that is too restrictive for hackage, but this was created by cabal init using all recommended versions.
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: tinyapp-0.1.0.0 (user goal)
[__1] next goal: base (dependency of tinyapp)
[__1] rejecting: base-4.18.1.0/installed-4.18.1.0 (conflict: tinyapp =>
base^>=4.17.2.1)
[__1] skipping: base-4.20.0.1, base-4.20.0.0, base-4.19.1.0, base-4.19.0.0,
base-4.18.2.1, base-4.18.2.0, base-4.18.1.0, base-4.18.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '^>=4.17.2.1' from 'tinyapp')
[__1] rejecting: base-4.17.2.1, base-4.17.2.0, base-4.17.1.0, base-4.17.0.0,
base-4.16.4.0, base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0,
base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0,
base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0,
base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0,
base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0,
base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1,
base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1
(constraint from non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: base, tinyapp)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, tinyapp
I then proceed to publish a couple of new versions until the build succeeded. I settle on base >=4.17.2.1 && <5.0
and luckily a couple of hours later the docs were also built. In hindsight maybe I should have edited the package metadata instead of publishing new versions.
What I would have liked to have:
- For
cabal init
to generate something that is compatible with hackage build process. Not sure if this is more on cabal or on hackage side. - In candidate upload know if the dependencies were in good terms with hackage build process
- In candidate upload have clear expectation if docs will be built or not
- When uploading a package that only differs in metadata with respect latest version, warn/reject it unless the bump is forced. This is more to avoid increasing the index in such situations.
- Be able to know how far in the different queues the package is.
Before submitting issues to either cabal or hackage I wondered you think about this and if they are improvements worth pursuing.