Skip to content

Commit

Permalink
Merge pull request #55 from input-output-hk/cad-2023-remove-stack
Browse files Browse the repository at this point in the history
CAD-2023: remove stack.
  • Loading branch information
Denis Shevchenko committed Oct 13, 2020
2 parents 32ffcb5 + d657821 commit 3e5b390
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 161 deletions.
5 changes: 0 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ steps:
agents:
system: x86_64-linux

- label: 'stack-cabal-sync'
command: 'nix-shell ./nix -A iohkNix.stack-cabal-sync-shell --run scripts/buildkite/stack-cabal-sync.sh'
agents:
system: x86_64-linux

# - label: 'Check Stylish Haskell'
# command: 'nix-shell --run ./.buildkite/check-stylish.sh nix/stack-shell.nix'
# agents:
Expand Down
38 changes: 31 additions & 7 deletions doc/getting-started/building-rt-view-from-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RTView is a program implemented in the Haskell programming language. There are different ways how to build it from scratch, but this guide describes two recommended methods:

1. Using `stack`;
1. Using `cabal`;
2. Using `nix`.

## Prerequisites
Expand All @@ -21,25 +21,49 @@ Clone RTView repository:
git clone https://github.com/input-output-hk/cardano-rt-view.git
```

## Building using stack
## Building using cabal

Stack is a cross-platform program for developing Haskell projects. Please install it on your platform following [these instructions](https://docs.haskellstack.org/en/stable/README/#how-to-install).
### Install GHC and cabal

Go to the repository directory and run:
It is recommended to use [ghcup](https://www.haskell.org/ghcup/) to install GHC and cabal on your computer. Run this command (as a user other than `root`):

```
stack build
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
```

and follow the onscreen instructions. Please do not forget to restart your terminal to activate changes in your `PATH` variable.

Now install and activate the required GHC version:

```
ghcup install ghc 8.6.5
ghcup set ghc 8.6.5
```

Check GHC version:

```
ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
```

### Building RTView

Now go to the repository directory and run:

```
cabal build all
```

After the build is finished, you can run RTView using this command:

```
stack exec -- cardano-rt-view
cabal exec -- cardano-rt-view
```

## Building using nix

Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please note that you **cannot** use `nix` on Windows (use `stack` instead).
Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please note that you **cannot** use `nix` on Windows (use `cabal` instead).

The quickest way to install Nix is to run the following command (as a user other than `root` with `sudo` permission):

Expand Down
9 changes: 0 additions & 9 deletions nix/stack-shell.nix

This file was deleted.

26 changes: 0 additions & 26 deletions scripts/buildkite/stack-cabal-sync.sh

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/cabal-inside-nix-shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

cabal_project="$(git rev-parse --show-toplevel)"/cabal.project

set -x
sed -i 's_^ -- ../_ ../_' "$cabal_project"
sed -ni '1,/--- 8< ---/ p' "$cabal_project"
113 changes: 0 additions & 113 deletions stack.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Run `./runTest.sh <options> PATH_TO_SELENIUM_SERVER_JAR` script which launches:
3. `selenium-server-standalone` process (in the background),
4. `analyzer` process.

(<options> can be something like `--stack-nix` or `--nix` to select the builder)
(<options> can be something like `--nix` to select the builder)

`analyzer` process launches Firefox web browser and sends corresponding web-commands to it. The results returned by `analyzer` are the results of the test.

Expand Down

0 comments on commit 3e5b390

Please sign in to comment.