someodd,
@someodd@fosstodon.org avatar

Please share with me your wisdom on packaging and distributing software made with .

simonmic,
@simonmic@fosstodon.org avatar

@someodd, here's a few thoughts on packaging/distribution:

  • Support the widest range of GHC versions, deps, and all related tools you can reasonably manage, reducing unnecessary friction.

  • Get your packages and their dependencies into Stackage nightly and keep them there. From there they will trickle into Stackage LTS, which is a starting point for many packaging systems.

1/

simonmic,
@simonmic@fosstodon.org avatar
  • When you need to provide assets other than the executable, embed them eg with file-embed. The file lookup mechanism provided by Cabal is too fragile.

  • When you want to be cross platform: check your deps, avoid unix-only packages, avoid packages that require external C libs if possible.

2/

simonmic,
@simonmic@fosstodon.org avatar
  • Run linux/mac/windows CI workflows that generate release binaries, eg on Github. But not excessively, or without caching; think of the planet.

  • Document and automate as much as possible your processes, especially for changelogs/release notes/releasing. Improve them every time you use them.

3/

someodd,
@someodd@fosstodon.org avatar

@simonmic fantastic advice. I've been avoiding Stack and just using cabal, often with Nix. Do you feel Stack is important for being more productive and getting things released and distributed?

simonmic,
@simonmic@fosstodon.org avatar
  • @someodd In short: yes. For getting things released and distributed, stack's reproducibility focus and better UX and Windows support is more useful than cabal's dynamic install plan solving.
    (“ vs ” is an old and still slightly polarising debate so be warned. In 2024 people should be familiar with the strengths of each and keep both in their toolbox.)

4/

simonmic, (edited )
@simonmic@fosstodon.org avatar

5/

someodd,
@someodd@fosstodon.org avatar

@simonmic Thank you for all this stellar advice. I will try some of it out when I try making a plugin for @dillo, since that should be a relatively small project.

jaror,
jaror avatar

@someodd Also note that the advice is about Stackage and not Stack. You can use Stackage snapshots with Cabal. E.g. you can create a cabal.project file with a line like this: import: https://www.stackage.org/lts-22.16/cabal.config. It still has a lot of rough edges, for example it is not possible to override specific constraints from the snapshots, but it is usable.

@simonmic

  • All
  • Subscribed
  • Moderated
  • Favorites
  • haskell
  • kavyap
  • InstantRegret
  • ethstaker
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • GTA5RPClips
  • slotface
  • Durango
  • khanakhh
  • rosin
  • everett
  • provamag3
  • vwfavf
  • tacticalgear
  • osvaldo12
  • cisconetworking
  • cubers
  • modclub
  • ngwrru68w68
  • Leos
  • anitta
  • normalnudes
  • tester
  • megavids
  • JUstTest
  • All magazines