MyNixOS website logo
Description

Console program used to fix Stack build errors automatically.

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.

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.
Metadata

Version

0.1.0.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows