cd /news/developer-tools/buck2-build-system-for-cabal-project… · home › topics › developer-tools › article
[ARTICLE · art-145960] src=discourse.haskell.org ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Buck2 build system for Cabal projects

Simon Marlow opened draft pull request #12410 against the Haskell Cabal repository on 5 October 2026, proposing Buck2 as a build system for Cabal projects via the haskell-buck2 tool. Marlow said the originally AI-generated code has been cleaned up and refactored and does not appear to abuse Cabal APIs, but the PR is not ready for merging and lacks support for the new build hooks, asm-sources, cmm-sources, js-sources, frameworks, c2hs and foreign-library, plus a shipping and versioning story for haskell-buck2 and Buck2 itself. The draft asks Cabal maintainers whether the approach is worth polishing as is or should be done differently.

read2 min views1 publishedOct 6, 2026

master ← simonmar:buck2

      opened 10:40AM - 05 Oct 26 UTC

I'm creating this as a draft for now, for discussion. It's not ready for merging… yet, but before I spend the time to write docs etc. I'd like to get a sense of whether the Cabal maintainers think this is worth polishing as is or whether we should do something different. Background:

  * See the [README for haskell-buck2](https://github.com/simonmar/haskell-buck2) for what this is
  * [Discussion on discourse](https://discourse.haskell.org/t/buck2-build-system-for-cabal-projects/14770/29)

I've done a round of cleaning up and refactoring the (originally AI-generated) code, so it's in not bad shape. The internals are pretty well factored into distinct pieces and the effects are reasonably localised. It doesn't look to be abusing any Cabal APIs. Someone more familiar with the Cabal internals might be able to find ways to factor things better though. Main outstanding issues

*  We need to have a story for shipping/deploying [haskell-buck2](https://github.com/simonmar/haskell-buck2), which needs to be cloned (or copied) into the root of the Cabal project. It needs to be versioned somehow. Ship a tarball with Cabal or clone it on demand? One branch per Cabal release? Should there be a submodule in the Cabal repo, as in this PR? There's also a versioning issue with Buck2 itself, which moves in sync with its prelude so only certain releases of Buck2 will work with a particular prelude.
* No support for the new build hooks yet
* Some other missing features: `asm-sources`, `cmm-sources`, `js-sources`, `frameworks`, `c2hs`, `foreign-library`.
* Some tidying up of code/comments still needed.
* [X] Patches conform to the [coding conventions](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#other-conventions).
* [NOT YET] Any changes that could be relevant to users [have been recorded in the changelog](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#changelog).
  * [X] [Is the change significant?](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#is-my-change-significant) If so, remember to add `significance: significant` in the changelog file.
* [NOT YET] The documentation has been updated, if necessary.
* [NOT YET] [Manual QA notes](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#qa-notes) have been included.
* [X] Tests have been added. (*Ask for help if you don’t know how to write them! Ask for an exemption if tests are too complex for too little coverage!*)
── more in #developer-tools 4 stories · sorted by recency
── more on @simon marlow 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/buck2-build-system-f…] indexed:0 read:2min 2026-10-06 · —