stack-fix: Console program used to fix Stack build errors automatically

[ agpl, development, program ] [ Propose Tags ]

Stack fix works by running `stack build` and by parsing and interpreting the build errors/suggestions it applies any build fixes required to the stack.yaml, .cabal, etc. These fixes usually involve specifying build dependencies versions or adding new build dependencies.


[Skip to Readme]
Versions [faq] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.12.0.0 && <4.13), options (==1.2.1.1), text (==1.2.3.1), turtle (==1.5.14) [details]
License AGPL-3.0-only
Author Răzvan Flavius Panda
Maintainer razvan.panda@gmail.com
Category Development
Home page https://github.com/razvan-panda/haskell-stack-fix
Source repo head: git clone https://github.com/razvan-panda/haskell-stack-fix.git
Uploaded by freeman42x at Tue Aug 27 13:59:55 UTC 2019
Distributions NixOS:0.1.0.0
Executables stack-fix
Downloads 57 total (16 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
Last success reported on 2019-08-27 [all 2 reports]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for stack-fix-0.1.0.0

[back to package description]

Haskell Stack Fix

Console program used to fix Stack build errors automatically

How it works

Stack fix works by running stack build and by parsing and interpreting the build errors/suggestions it applies any build fixes required to the stack.yaml, .cabal, etc. These fixes usually involve specifying build dependencies versions or adding new build dependencies.

To use stack-fix:

  • run stack-fix in the root of your stack project
  • enjoy not having to waste countless hours on fixing build issues which can be fixed automatically by stack-fix

Contributing

To contribute:

  • Fork the project
  • Pick any ticket you wish to work on from the project roadmap kanban board that is in the To Do column
  • Assign the ticket to yourself and if it makes sense leave a comment detailing at high level what approach you will take
  • Implement the feature
  • Submit a pull request

Project roadmap kanban board: https://github.com/razvan-panda/haskell-stack-fix/projects/1

Setting up operating system

Windows

We do not support building the project on Windows since many Haskell packages have issues building on Windows.

If you are a Windows user the recommended method is to use WSL or a Linux VMWare virtual machine for your development. The virtual machine option is preffered over WSL since WSL is currently much slower when building stuff than a virtual machine.

Linux or MacOS

The project should build fine on these operating systems.

Setting up build tools

The recommended way to install cabal-install is by using the Nix package manager.

To install Nix run:

    curl https://nixos.org/nix/install | sh

To install GHC, cabal-install and stack, create the file ~/.nixpkgs/config.nix.

Copy paste this into the file:

let
  config = {
    allowUnfree = true;

    packageOverrides = pkgs: with pkgs;
      let jdk = openjdk11; in rec {
      unstable = import <nixpkgs> { inherit config; };

      all = pkgs.buildEnv {
        name = "all";

        paths = [
          haskell.compiler.ghc864
          haskellPackages.cabal-install
          unstable.haskellPackages.stack
          binutils.bintools # required on WSL
        ];
      };
    };
  };
in config

And run following command to install the packages:

nix-env -i all

Run this to update the cabal pacakges:

cabal v1-update

Setting up your development tools

The recommended editors are Atom and VSCode together with the Haskell IDE Enginer extension.

To install the HIE executable required by the editor extensions via ~/.nixpkgs/config.nix make changes reflected in the following:

let
  all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {};
  config = {
    allowUnfree = true;

    packageOverrides = pkgs: with pkgs;
      let jdk = openjdk11; in rec {
      unstable = import <nixpkgs> { inherit config; };

      all = pkgs.buildEnv {
        name = "all";

        paths = [
          haskell.compiler.ghc864
          haskellPackages.cabal-install
          unstable.haskellPackages.stack
          binutils.bintools # required on WSL
          (all-hies.selection { selector = p: { inherit (p) ghc864; }; })
        ];
      };
    };
  };
in config

Then install the HIE extension inside Atom or VSCode.

Building the project

  • open a shell window in the haskell-stack-fix project root.
  • run cabal v1-install --dependencies-only
  • run the command cabal v1-build