Skip to content

Instantly share code, notes, and snippets.

@jamilbk
Last active April 28, 2020 06:29
Show Gist options
  • Save jamilbk/816abec30cbfb6f3d73b4d07d30720ec to your computer and use it in GitHub Desktop.
Save jamilbk/816abec30cbfb6f3d73b4d07d30720ec to your computer and use it in GitHub Desktop.
Vagrantfile demonstrating Elixir runtime issue when compiled from source on OpenBSD 6.6
Vagrant.configure("2") do |config|
config.vm.box = "generic/openbsd6"
config.vm.provision "shell", inline: <<~SCRIPT
#!/usr/bin/env bash
set -xe
orig_dir=`pwd`
OTP_VER="21.3.8.14"
ELIXIR_VER="1.10.2"
export AUTOCONF_VERSION=2.69
# Set encoding
export LC_CTYPE=en_US.UTF-8
echo "export LC_CTYPE=en_US.UTF-8" >> /etc/profile
# Install required software; force non-interactive mode
pkg_add -I autoconf-${AUTOCONF_VERSION}p2 gmake
# Download and unpack OTP
prefix=OTP-$OTP_VER
wget https://github.com/erlang/otp/archive/$prefix.tar.gz
tar -zxf $prefix.tar.gz
cd otp-$prefix
# Install OTP
./otp_build autoconf
./configure
gmake
sudo gmake install
# Download and unpack Elixir
cd $orig_dir
prefix=v$ELIXIR_VER
wget https://github.com/elixir-lang/elixir/archive/$prefix.tar.gz
tar -zxf $prefix.tar.gz
cd elixir-$ELIXIR_VER
# Install Elixir
gmake clean test
# Add Elixir binaries to PATH
cwd=`pwd`
echo "export PATH=$cwd/bin:$PATH" >> /etc/profile
# Is it working?
bin/elixir -e 'IO.puts("Hello World!")'
SCRIPT
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment