-
Notifications
You must be signed in to change notification settings - Fork 643
Idris on Windows
Idris works well on Windows using MSYS2. Installation requires several steps but is straightforward.
(See also: Windows Binaries)
There is a PowerShell script that performs an automated build of Idris. It will download MSYS2 and GHC and perform the necessary configuration of MSYS. It requires Powershell 3.0.
To use it create an empty directory to be used for the installation, place the script get-idris.ps1 there and run it from PowerShell. By default it builds a 64-bit Idris, which can be changed in the script. When the script has finished, Idris can be run by starting the mingw32_shell.bat
or mingw64_shell.bat
(choose the same as the bitness you built with, 64 if you haven't changed anything) and running idris
from the shell prompt. The Idris source is in msys/home/<your user name>/idris
. It can be updated with git pull
and rebuilt with make
.
If you want to use Idris outside of the MSYS shell you need to put the Idris executable and gcc in your Windows path environment variable. Idris.exe
is in <Your windows home dir>\AppData\Roaming\cabal\bin
, gcc is in msys/mingw32/bin
or msys/mingw64/bin
.
- Install MinGHC, choose 7.8.4 and 64-bits. There is still a bug for Cabal in 7.10.1 making it hard to install (see note below). Choose to add GHC to the PATH.
- Download and install MSYS2. Choose the 64-bit version.
- Open an MSYS2 shell by starting
mingw64_shell.bat
- Update MSYS2 packages by running
pacman -Syu
- Install the needed tools with
pacman -S make binutils msys2-w32api-runtime mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libffi
- Install alex with
cabal install alex
- Idris needs the CC environment variable to be set to find the C compiler. Add
export CC=gcc
to~/.bash_profile
. Rerunmingw64_shell.bat
to pick up the change or enter the same export on the command line to get it in your currect session. - Clone the Idris repo in a place to your liking and cd to that directory.
- Say that you want libffi support by making a
custom.mk
containingCABALFLAGS += -f FFI
in the Idris-dev directory. This flag enables use of the FFI from the REPL. - Start the build with
make
Building for 32-bit follows mostly the same procedure as for 64-bit, just using the i686
packages and mingw32_shell.bat
in MSYS2 instead. Unfortunately the network package fails to build correctly on MSYS2, so you'll have to build that using the msys provided with MinGHC and then switch to MSYS2.
The build can fail on some packages with long names (data-default-instances-*
) due to https://github.com/haskell/cabal/issues/2502. A workaround is to install these packages from a local directory: go outside your Idris-dev directory; unpack the affected packages with cabal unpack <package name>
; then install them with cabal install <path to dir of the unpacked package>
. You have to do the cabal install
from inside the Idris-dev directory if you're building in a sandbox.
Binary Packages
Tool Support
Community
- Libraries, available elsewhere
- Idris Developer Meetings
- The Zen of Idris
- Non English Resources
Development