{"slug": "buck2-build-system-for-cabal-projects", "title": "Buck2 build system for Cabal projects", "summary": "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.", "body_md": "`master` ← `simonmar:buck2`\n\n          opened 10:40AM - 05 Oct 26 UTC\n\n \n \n \nI'm creating this as a draft for now, for discussion. It's not ready for merging[…](https://github.com/haskell/cabal/pull/12410) 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.\nBackground:\n  * See the [README for haskell-buck2](https://github.com/simonmar/haskell-buck2) for what this is\n  * [Discussion on discourse](https://discourse.haskell.org/t/buck2-build-system-for-cabal-projects/14770/29)\nI'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.\nMain outstanding issues\n*  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.\n* No support for the new build hooks yet\n* Some other missing features: `asm-sources`, `cmm-sources`, `js-sources`, `frameworks`, `c2hs`, `foreign-library`.\n* Some tidying up of code/comments still needed.\n* [X] Patches conform to the [coding conventions](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#other-conventions).\n* [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).\n  * [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.\n* [NOT YET] The documentation has been updated, if necessary.\n* [NOT YET] [Manual QA notes](https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#qa-notes) have been included.\n* [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!*)", "url": "https://wpnews.pro/news/buck2-build-system-for-cabal-projects", "canonical_source": "https://discourse.haskell.org/t/buck2-build-system-for-cabal-projects/14770?page=2#post_31", "published_at": "2026-10-06 09:58:51+00:00", "updated_at": "2026-10-06 10:19:40.904771+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Simon Marlow", "Cabal", "Buck2", "haskell-buck2", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/buck2-build-system-for-cabal-projects", "markdown": "https://wpnews.pro/news/buck2-build-system-for-cabal-projects.md", "text": "https://wpnews.pro/news/buck2-build-system-for-cabal-projects.txt", "jsonld": "https://wpnews.pro/news/buck2-build-system-for-cabal-projects.jsonld"}}