Skip to content

Clarify installation instructions on macOS (M1) #2233

Open
@ornamentist

Description

@ornamentist

When following the standard installation instructions there are a few gotchas for installation on macOS with an M1 processor:

Using homebrew brew install idris2 is currently not working:

brew install idris2
Running `brew update --preinstall`...
...
Error: idris2: no bottle available!
You can try to install from source with:
  brew install --build-from-source idris2
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

I understand this is an issue for the Homebrew maintainer of that brew and not one for the official project, although it does have a bearing on what comes next.

Moving to installation from source with Chez scheme, the formula is also currently not working:

brew install chezscheme
Error: chezscheme: no bottle available!
You can try to install from source with:
  brew install --build-from-source chezscheme
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

Again this is not the responsibility of the Idris2 developers, but it leads to installing from source with Racket.

brew search racket
==> Formulae
minimal-racket           rack                     tracker                  packetq

==> Casks
brackets                                           racket ✔
Warning: Use minimal-racket instead of deprecated racket

It's not clear whether minimal racket is enough to build Idris2 so I went with the full racket install. I cloned the Idris2 repository and did a gmake bootstrap-racket which now complains about a missing gmp.h.

GMP is installed via Homebrew but the make commands are not finding gmp.h so I modified the config.mk file to add -I/opt/homebrew/include to the CFLAGS variable. This allowed the build to complete.

A gmake install installed everything in the local directory and not the config.mk prefix, so I changed the PREFIX make variable to /Users/stu/.idris2 which did work. This may be because I'm running fish shell and not bash.

Finally, when I run the idris2 script I get a idris2 -o hello hello.idr env: scheme: No such file or directory error. I'm guessing there's a make variable somewhere that points to a scheme executable which Racket doesn't provide? I tried linking the racket executable to scheme too:

~> ln -s (which racket) ~/.local/bin/scheme
~> scheme
Welcome to Racket v8.3 [cs].
> ^D
~> idris2 -o hello hello.idr
build/exec/hello_app/compileChez:1:0: #%top-interaction: unbound identifier;
 also, no #%app syntax transformer is bound
  at: #%top-interaction
  in: (#%top-interaction parameterize ((optimize-level 3) (compile-file-message #f)) (compile-program "/Users/stu/projects/numerous/idris/build/exec/hello_app/hello.ss"))
  location...:
   build/exec/hello_app/compileChez:1:0

Which looks like idris2 wants the Chez scheme executable even though it was built with Racket?

Should I treat the macos/M1/homebrew/racket combination as unsupported just for now? I suspect the maintainers have enough on their plate already.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions