channable / channable/vaultenv
Update and Fix Build System - Move from Stack to Cabal, Re-configure Nix Files
- Dominant language
- Haskell
- Stars
- 466
- Forks
- 29
- Avg merge
- 26m
- Merged PRs (30d)
- 1
Description
Most concerning problem is that the ghc of the dev-enviornment, and test enviornment are not necessarily synced up with the ghc of the release.
This is because we have to specify the [ghc version separately in the stack.yaml](https://github.com/channable/vaultenv/blob/c61036674d3a385523b38e5b30105148e91f6cfd/stack.yaml#L3) file, while the one for release,[ we get it (at the moment) implicitly from nixpkgs](https://github.com/channable/vaultenv/blob/c61036674d3a385523b38e5b30105148e91f6cfd/nix/release.nix#L5). A half-way fix would be to be use the [explicitly defined haskell package set](https://github.com/channable/vaultenv/blob/c61036674d3a385523b38e5b30105148e91f6cfd/nix/overlay.nix#L5) in the release.nix file.
It's a halfway fix, because we have to update the ghc version in 2 places, it's still error prone.
Not only this is a halfway fix, but also quite awkward to implement due to how we have arranged our nix files to accomodate stack.
- [The unusual way of specifying `haskellPackages` as a dependency for our `vaultenv` package](https://github.com/channable/vaultenv/blob/c61036674d3a385523b38e5b30105148e91f6cfd/vaultenv.nix#L1)
- [How we have a separate expression for specifying haskell dependencies
](https://github.com/channable/vaultenv/blob/c61036674d3a385523b38e5b30105148e91f6cfd/nix/haskell-dependencies.nix)
If we are going to go ahead with this fix, then we should use it as a chance to move to the simpler cabal based setup, something like we've seen @robbert-vdh do for an [icepeak release](https://github.com/channable/icepeak/releases/tag/v2.1.0).
This can fully fix the ghc syncing issue, simplify the nix files, simplify the haskell build process, and also pave the way to solve these issues:
- https://github.com/channable/vaultenv/issues/61
- https://github.com/channable/vaultenv/issues/92
We can make use of some of the code changes from this PR (it updated the nixpkgs pin) https://github.com/channable/vaultenv/pull/140
Contributor guide
No contributing guide indexed for this repository
Research direction
Compare stack.yaml with nix/release.nix, nix/overlay.nix, vaultenv.nix, and nix/haskell-dependencies.nix to understand the current GHC and dependency flow. Review the changes from pull request 140 and the referenced icepeak release for context. Done means the project uses a simpler Cabal-based setup, the release and development GHC versions stay synchronized, and the Nix expressions are simplified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system, release
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100