All things related to Elixir on Windows.
Note: There's an alternative approach here that will allow you to skip using cygwin/msys, etc. in favor of executing Linux binaries directly - no VM required at all - on your Windows 10 machine. Skip to the section on WSL for more.
The recommended way to build Elixir on Windows is with tools provided by MinGW and MSYS. Although MinGW is used for building Elixir, it is not necessary for running Elixir. In addition to MinGW, you'll need Git and Erlang on your system.
First, if you don't already have the MinGW Installation Manager on your system, download mingw-get-setup.exe here and run it. This will provide a package manager interface from which you can install the necessary MinGW/MSYS components. In the interface, mark the following packages for installation:
Then, in the Installation menu, select Apply Changes.
Finally, you'll need to add the directory containing these packages to your system's Path environment variable. By default the path is C:\MinGW\msys\1.0\bin
. To do this:
Win
+ R
to open the Run dialogEnter
.If you don't already have Git installed, you can download it here and install it. A directory containing git.exe
needs to be in your Path environment variable (see above for how to add it). By default, the installation puts git.exe
in C:\Program Files (x86)\Git\cmd
.
If you don't already have Erlang installed, you can download it here and install it. A directory containing erl.exe
needs to be in your Path environment variable (see above for how to add it). By default, the installation puts erl.exe
in C:\Program Files\erlX.Y\bin
or C:\Program Files (x86)\erlX.Y\bin
.
Once you have the necessary tools, open up a Command Prompt in your favorite directory and follow these steps to compile Elixir:
git clone https://github.com/elixir-lang/elixir.git
cd elixir
make
.It's that simple!
Here are some snags you might run into while working with Elixir on Windows.
File.ln_s/2
will return {:error, :eperm}
if the associated erl.exe
or werl.exe
process is not running as an Administrator. You can allow creation of symlinks by normal users by following the steps on https://superuser.com/a/125981C:\Users\Chris
doesn't work, but C:/Users/Chris
or C:\\Users\\Chris
do.MAKE
in Makefile
- it causes this error during compilation:
PS C:\projects\elixir> make clean test
#cd lib/elixir && "/c/projects/elixir/rebar" clean
#==> elixir (clean)
#rm -rf ebin
#rm -rf lib/*/ebin
#/bin/sh: /c/projects/elixir/C:/MinGW/msys/1.0/bin/make.exe: No such file or directory
#make.exe": *** [clean] Error 127
The easiest workaround is to add line MAKE = make
to the beginning of Makefile
...stands for Windows Subsystem for Linux and is an implementation of Linux kernel syscalls directly in the Windows 10 kernel itself. This means fully compiled, native 64-bit Linux binaries will run directly on Windows without any VM!
As of this writing it's still considered "beta" by Microsoft, but don't let that scare you off: the vast majority of competent users have reported great success in using this feature. Early releases had not yet solved problems like binding to, say, localhost:8080
from a process launched under WSL/bash and being available from the browser running on the regular Windows side of things, but that seems to have been worked out for a while now. Some users have even been able to run X11 applications natively on Windows 10! (And some of them have been doing it since WSL's very first early releases!)
Quick walk-through:
WIN+X
key combo (yes, X, that's not a typo) and find the option to run Windows PowerShell as an AdministratorEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Let it finish its thing, then run this (also as an admin user in PowerShell - same shell session should be fine)
Now you'll be prompted to agree to some crazy legal terms so just accept it blindly like everybody does and it'll perform the full installation of WSL. When that's done you'll be asked to create a user and a password. These are totally SEPARATE from your normal Windows user account/password. As long as your dev box is secure (say, a full desktop in your home which just happens to be an underground bunker or something), you can just make this "dev/dev" if you want.
But don't forget that password. You'll need it to install packages because you'll still have to sudo apt ...
to administer the Linux side of things.
Yeah so you done that? Great. Now if it says reboot, then reboot. However don't be surprised if you don't have to.
When that's done, just launch a regular terminal process (WIN+R
, then type cmd
and hit enter, or WIN+X
and click the non-admin PowerShell option), then type bash
and hit enter. In fact, you might...haha, "bash" that enter key, if you know what I mean. ๐ ๐
Congratulations, you're now running Linux NATIVELY on the Windows 10 kernel!
For kicks, try installing neofetch!
$ sudo add-apt-repository ppa:dawidd0811/neofetch && sudo apt update && sudo apt install neofetch -y $ neofetch
You should see output similar to what the author of neofetch shows on the project's GitHub readme.
Links + Info
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4