-
Notifications
You must be signed in to change notification settings - Fork 644
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
.
Seems to work with 'Stack' now. The below was tested on a clean machine. Stack works by installing a specific compiler and accompanying tools under the build directory.
- Download and install Git 64-bit
- Download and install Haskell Platform FULL 64 bit - you can follow the final instructions on the page (step 3 adding to cabal config file) but you're not using cabal for this example.
- Go someplace and clone
git clone https://github.com/idris-lang/Idris-dev.git
cd idris-dev
-
stack setup
(installs a stack-local GHC) stack init
-
stack exec -- pacman -Sy make
(need a make tool on your path half way through, this gives you one) -
stack build
orstack install
If you did stack install
idris.exe will be on your path (~\AppData\Roaming\Local\Bin)
The installation instructions assume that GHC has already been installed.
-
Download and install MSYS2. Choose the 64-bit version.
-
Open an MSYS2 shell by starting
mingw64.exe
, located in the directory you installed MSYS2 in, by defaultC:\msys64
.-
If you have a space in your windows account name, this will fail to make necessary configs
-
If so, set your Windows environment variable HOME to c:\Ming64\Home\YourNameHereNoSpaces
-
You'll still have a problem with spaces at the end of make-install process copying header files - consider another account
-
In your new account edit .bash_profile, and add something that can get you to GHC and Cabal important: make sure there are no hidden newlines when pasting this
if [ -d "/c/Program Files/Haskell Platform/8.0.2/bin/" ] ; then PATH="/c/Program Files/Haskell Platform/8.0.2/bin/:${PATH}" fi if [ -d "/c/Program Files/Haskell Platform/8.0.2/lib/extralibs/bin/" ] ; then PATH="/c/Program Files/Haskell Platform/8.0.2/lib/extralibs/bin/:${PATH}" fi
-
-
Update MSYS2 packages by running
pacman -Syu
- May have to run this a few times, killing console window between runs until you see no action
-
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
. -
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. -
run
cabal update
(echo $PATH
andwhich cabal
are useful for determining whether cabal can be found) -
Start the build with
make
- If you have a space in your username, this will fail late in the build/install copying C header files to your windows account; but I think the initial and final EXE will have been built (really just dodge the account with the space).
Building for 32-bit follows the same procedure as for 64-bit, just using the i686
packages and mingw32.exe
in MSYS2 instead.
The build can fail on some packages with long names (data-default-instances-*
) due to https://github.com/haskell/cabal/issues/2502. This has been fixed in cabal-install 1.22.6.0, which can be installed with cabal install cabal-install
.
Binary Packages
Tool Support
Community
- Libraries, available elsewhere
- Idris Developer Meetings
- The Zen of Idris
- Non English Resources
Development