# haskellPackages.stm-containers fails to build

**URL:** https://discourse.nixos.org/t/haskellpackages-stm-containers-fails-to-build/5416
**Category:** Uncategorized
**Created:** [January 10, 2020, 2:04am UTC](https://discourse.nixos.org/t/haskellpackages-stm-containers-fails-to-build/5416 "2020-01-10T02:04:18Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![cdepillabout](https://discourse.nixos.org/user_avatar/discourse.nixos.org/cdepillabout/32/410_2.png) [@cdepillabout](https://discourse.nixos.org/u/cdepillabout)
#### Post date: [January 10, 2020, 4:02am UTC](https://discourse.nixos.org/t/haskellpackages-stm-containers-fails-to-build/5416/4 "2020-01-10T04:02:05Z")

</div>

@CMCDragonkai Sorry you’re having some trouble with the Haskell package set. Let me try to answer some of your questions.

> It shows that `stm-containers` fails because `stm-hamt` fails, and `stm-hamt` fails because it’s dependency constraint is not met specifically `primitive` and `primitive-extras` which is still on an older version.

I believe your diagnosis here is correct:

[https://hydra.nixos.org/build/98648183/nixlog/2](https://hydra.nixos.org/build/98648183/nixlog/2)

> As a general question I’m quite confused how haskell packages get updated.

The main tool for updating the Haskell package set is [`hackage2nix`](https://github.com/NixOS/cabal2nix/tree/master/hackage2nix).

Also, @peti has weekly streams where he goes through and actually updates the Haskell packages. I think he has uploaded some of them to YouTube as well, so I’d recommend actually watching through one:

> [@Please join the new weekly "Haskell Updates" video livestream](https://discourse.nixos.org/t/please-join-the-new-weekly-haskell-updates-video-livestream/4420):
>
> Fellow Nixpkgs hackers, about once per week I spend an hour cleaning up the [haskell-updates](https://hydra.nixos.org/jobset/nixpkgs/haskell-updates) branch to bring it into a state that’s ready to merge into master. That typically means going through the open PRs, reporting bugs upstream, disabling failing test suites, adding overrides and/or patches to Nixpkgs, and eventually marking all builds I can’t fix easily as broken. It’s actually somewhat entertaining work because I get to mess with a lot of different Haskell packages that exhibit a lot o…

I believe `hackage2nix` is run automatically at regular intervals (once a day)? It pushes an update to the `haskell-updates` branch. Here is an example of it running:

[https://github.com/NixOS/nixpkgs/pull/76982/commits/3741b43294b4d807fc982fa671d3c52065d1ef02](https://github.com/NixOS/nixpkgs/pull/76982/commits/3741b43294b4d807fc982fa671d3c52065d1ef02)

* * *

`hackage2nix` basically looks at two separate sets of information to decide what version of each Haskell package to use:

1. `haskellPackages` tracks package versions that are available in the latest Stackage LTS. You can see a list of packages and the corresponding versions here:

2. For Haskell packages not in the latest Stackage LTS, `hackage2nix` just generates the package from the latest version on Hackage.

* * *

You can probably see what the problem will be here. The `primitive` package is in Stackage LTS as version `0.6.4.0`, so `haskellPackages.primitive` is also `0.6.4.0`. However, `stm-hamt` is _not_ in Stackage LTS, and requires `primitive >= 7.0`.

There are a couple ways to get `stm-hamt` to build. You could send a PR to the `haskell-updates` branch that does any of the following:

1. Override `stm-hamt` to explicitly use the newest version of `primitive`. You might have to do something similar for `stm-containers`:

2. Create an older `stm-hamt` derivation.

3. Force `stm-hamt` (and `stm-containers`?) to be an older version.

4. Get `stm-hamt` and `stm-containers` into Stackage. Then we can be sure that they will compile with the existing version of `primitive` in Stackage/nixpkgs.

* * *

As you can see, Haskell packages in nixpkgs often break if they are not in Stackage LTS.

---

_[View the full topic](https://discourse.nixos.org/t/haskellpackages-stm-containers-fails-to-build/5416)._
