Skip to content

Commit

Permalink
Merge branch 'main' into replace-travis-with-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fkrause98 committed Sep 4, 2024
2 parents e4dc237 + 47c98de commit 093e5a6
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 14 deletions.
67 changes: 53 additions & 14 deletions sequential/installing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
~~~
9 changes: 9 additions & 0 deletions sequential/installing/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let
pkgs = import <nixpkgs> { config = {}; overlays = []; };
in
pkgs.mkShell {
packages = [
(pkgs.erlang.override { version = "27.0.1"; })
pkgs.beamPackages.rebar3
];
}

0 comments on commit 093e5a6

Please sign in to comment.