diff --git a/sequential/installing/README.md b/sequential/installing/README.md index 1991961..1e373cd 100644 --- a/sequential/installing/README.md +++ b/sequential/installing/README.md @@ -9,10 +9,54 @@ In this exercise we will setup our environment before we start our real coding. We will need some software: -- Check how to install [Erlang](https://www.erlang.org/). -- Install the main build tool [Rebar3](https://github.com/erlang/rebar3). -- Ensure that you have [Make](https://en.wikipedia.org/wiki/Make_(software)) - installed and running. +- Erlang 27. +- Make (probably already installed on your system). +- Rebar. + +We suggest 2 ways to install Erlang + Rebar: asdf or nix. + +### ASDF + +First, we need to install ASDF: +```sh +git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1 +``` +Then we'll have to add this to your bash or zsh config file: +```sh +. "$HOME/.asdf/asdf.sh" +``` +Or, if you're using fish: +```fish +source ~/.asdf/asdf.fish +``` + +Be sure to check asdf's website, since there are some extra goodies to config +like shell completions. + +```sh +asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git +``` + +And finally, install erlang 27.0.1: +```sh +asdf install erlang 27.0.1 && asdf global erlang 27.0.1 +``` + +The global command is just to tell your environment to always use erlang 27, you +can use `asdf local` instead to have distinct versions base on which folder you're currently in. + +### Nix + +Clone the repo: +```sh +git clone https://github.com/lambdaclass/erlings.git +``` +cd into this folder and eval the nix shell: +```sh +cd erlings/sequential/install && nix-shell +``` +This will drop you into a bare-bones bash shell with erlang and rebar installed, +which you can use for the exercises. ## Checking environment @@ -27,16 +71,11 @@ $> make You should get the following output: ~~~ -rebar3 eunit +rebar3 ct ===> Verifying dependencies... +===> Analyzing applications... ===> Compiling installing -===> Performing EUnit tests... -. - -Top 1 slowest tests (0.000 seconds, 0.0% of total time): - installing_test:installing_test/0: module 'installing_test' - 0.000 seconds - -Finished in 0.032 seconds -1 tests, 0 failures +===> Running Common Test suites... +%%% installing_SUITE: . +All 1 tests passed. ~~~ diff --git a/sequential/installing/shell.nix b/sequential/installing/shell.nix new file mode 100644 index 0000000..46af1ef --- /dev/null +++ b/sequential/installing/shell.nix @@ -0,0 +1,9 @@ +let + pkgs = import { config = {}; overlays = []; }; +in +pkgs.mkShell { + packages = [ + (pkgs.erlang.override { version = "27.0.1"; }) + pkgs.beamPackages.rebar3 + ]; +}