Awesome
elixir
Elixir is a dynamic, functional language designed for building scalable and maintainable applications. Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems. See documentation
Maintainers
- The Core Planners: chef-core-planners@chef.io
Type of Package
Binary package
Use as Dependency
Binary packages can be set as runtime or build time dependencies. See Defining your dependencies for more information.
To add core/elixir as a dependency, you can add one of the following to your plan file.
Buildtime Dependency
pkg_build_deps=(core/elixir)
Runtime dependency
pkg_deps=(core/elixir)
Use as Tool
Installation
To install this plan, you should run the following commands to first install, and then link the binaries this plan creates.
hab pkg install core/elixir --binlink
will add the following binaries to the PATH:
- /bin/elixir
- /bin/elixirc
- /bin/iex
- /bin/mix
For example:
$ hab pkg install core/elixir --binlink
» Installing core/elixir
☁ Determining latest version of core/elixir in the 'stable' channel
→ Found newer installed version (core/elixir/1.10.0/20200826114756) than remote version (core/elixir/1.10.0/20200404122517)
→ Using core/elixir/1.10.0/20200826114756
★ Install of core/elixir/1.10.0/20200826114756 complete with 0 new packages installed.
» Binlinking mix from core/elixir/1.10.0/20200826114756 into /bin
★ Binlinked mix from core/elixir/1.10.0/20200826114756 to /bin/mix
» Binlinking elixirc from core/elixir/1.10.0/20200826114756 into /bin
★ Binlinked elixirc from core/elixir/1.10.0/20200826114756 to /bin/elixirc
» Binlinking elixir from core/elixir/1.10.0/20200826114756 into /bin
★ Binlinked elixir from core/elixir/1.10.0/20200826114756 to /bin/elixir
» Binlinking iex from core/elixir/1.10.0/20200826114756 into /bin
★ Binlinked iex from core/elixir/1.10.0/20200826114756 to /bin/iex
Additional Steps
Before using core/elixir stand alone binaries, the runtime environment requires erlang on the $PATH and locale set to UTF-8 encoding. Fortunately habitat takes care of all this: Preceed all binary commands with hab pkg exec core/elixir
and the binaries will work as expected.
For example, calling mix
with the above prefix returns a successful response:
[8][default:/src/elixir:127]# hab pkg exec core/elixir mix --version
Erlang/OTP 21 [erts-10.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Mix 1.10.0 (compiled with Erlang/OTP 21)
[9][default:/src/elixir:0]#
However, running mix
without the prefix means the erlang executable is included in the runtime environment and an error is returned like
[7][default:/src/elixir:0]# mix --version
/bin/elixir: line 230: exec: erl: not found