Giter Club home page Giter Club logo

Comments (21)

aorumbayev avatar aorumbayev commented on May 28, 2024 1

@MrJackdaw yes i believe I run the update command via reach cli. I assume it pulled the latest version as of now.

from reach-lang.

DanBurton avatar DanBurton commented on May 28, 2024 1

I'm pleased to say that we now support using reach on m1 machines!

Docker makes it a little trickier than simply using Rosetta, unfortunately.
Gladly, we were able to develop a release process that leverages docker manifests in order to support arm64.

You can take a look at our images on docker hub and notice that two architectures are now listed under each newly-released tag:

https://hub.docker.com/r/reachsh/reach/tags?name=2021-12-10

from reach-lang.

MrJackdaw avatar MrJackdaw commented on May 28, 2024

Hello! Thought I might jump in and help. I'm also on a mac

Are you using the latest version of the @reach-sh/stdlib library? Current version (at time of writing) is 0.1.2-rc.56.

from reach-lang.

aorumbayev avatar aorumbayev commented on May 28, 2024

@MrJackdaw I also tried setting the experimental big sur virtualisation in docker settings, didn't do a trick for me unfortunately.

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 28, 2024

Right now, we don't support Apple Silicon. This is because we use packages X, Y, and Z, and they don't support it. It might be possible to use emulation and the existing x86 version --- https://docs.docker.com/docker-for-mac/apple-silicon/

If you'd like we can leave this issue open for you to track when we support it, but be assured, we'll make a big deal about it when we support the new Macs :)

from reach-lang.

aorumbayev avatar aorumbayev commented on May 28, 2024

Thank you for the update @jeapostrophe ! Yes, please keep the issue open, would love to track the progress.

Reach has amazing potential, so the more platforms + frontend clients you'll eventually support, the more people will contribute and make codebase more mature. I also personally think if you guys could add a python frontend client (instead of current RPC option), that would be a great boost for projects in the ecosystem, I think a lot of people rely on python based algo sdks and pyteal, so giving a native client for python backends for reach would be amazing.

Keep up the great work, and thank you ! :-)

from reach-lang.

AwolDes avatar AwolDes commented on May 28, 2024

Hey @jeapostrophe just checking in on this - with the recent updates to Reach has anything changed? Is there a particular dependency that is blocking Reach working on apple silicon devices?

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 28, 2024

Right now, we're waiting/working on Haskell Stack support --- https://github.com/commercialhaskell/stack

from reach-lang.

phoniks avatar phoniks commented on May 28, 2024

@jeapostrophe I've been able to get stack compiled on my M1 Macbook - should it theoretically be possible to build my own images from the dockerfiles and run Reach?

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 28, 2024

Yes, essentially you want to go to the hs directory and type make hs-build

from reach-lang.

phoniks avatar phoniks commented on May 28, 2024

Cool, that worked. Is there a contributors guide or something like that that might help me get it configured correctly? I got an error: Unset REACH_EX environment variable, but I'm not sure how to set it.

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 28, 2024

Even if you build yourself, you still need to use the reach script. You can set REACH_DOCKER variable to 0 to use a locally built version. This is not supported, but it may work fairly easily for you.

from reach-lang.

phoniks avatar phoniks commented on May 28, 2024

As you expected once the REACH_DOCKER variable was set to 0 things worked perfectly without any additional steps. Thanks @jeapostrophe.

from reach-lang.

aorumbayev avatar aorumbayev commented on May 28, 2024

Great to hear that it worked for you @phoniks! Any chance you could share a very generic step by step guide on how you made it up and running?

from reach-lang.

phoniks avatar phoniks commented on May 28, 2024

For sure @aorumbayev - I was going to with my last post but I'm not sure exactly how I got stack working, which is the key. If I remember correctly, I attempted two different approaches to getting Stack. One was with homebrew (as recommended by the readme) and the other was a release candidate binary. I think it was the release candidate that did the trick. Either way, the first step is to make sure you have Stack, and the rest is pretty straight forward I'll try and retrace my steps to figure it out where I found the link to the release candidate, and if I can, then I'll update this post, but in the meantime, these are the rough steps:

  1. Install Stack.
  2. Clone this repo if you haven't already.
  3. Follow the instructions from the README
  4. Build the app with make hs build
  5. Set the REACH_DOCKER environment variable to 0

At this point it worked as expected for me following the tutorial.

from reach-lang.

aorumbayev avatar aorumbayev commented on May 28, 2024

@phoniks thank you! Will try it out!

from reach-lang.

phoniks avatar phoniks commented on May 28, 2024

@jeapostrophe - I've got reach running on my M1, and I'd be interested in submitting a PR to resolve this issue, but I'm not sure where to begin. If I understand correctly, it's an issue of Haskell Stack not being officially available yet but since I have it working on my machine would it just be a matter of including the new M1 compatible docker images?

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 28, 2024

Thanks @phoniks

We know that you can install stack and then go into hs and run make hs-build and get a working version of Reach.

The issue is that we don't distribute Reach as platform-specific binaries built this way, nor do we expect users to compile it themselves. Instead, we distribute Reach via Docker. Specifically the Dockerfiles here --- https://github.com/reach-sh/reach-lang/blob/master/hs/Dockerfile.haskell-build-artifacts --- https://github.com/reach-sh/reach-lang/blob/master/hs/Dockerfile.reachc --- https://github.com/reach-sh/reach-lang/blob/master/hs/Dockerfile.reach-cli --- are used to build images that the reach script --- https://github.com/reach-sh/reach-lang/blob/master/reach --- uses to invoke the compiler.

This Docker-based set up is so that users don't need to manage any dependencies (other than Docker.) The problem is that the main Dockerfile --- https://github.com/reach-sh/reach-lang/blob/master/hs/Dockerfile.haskell-build-artifacts --- is based on Alpine Linux and Stack (the Haskell build tool) does not yet support Alpine on any platform other than X86-64 --- https://github.com/commercialhaskell/stack/blob/255cd830627870cdef34b5e54d670ef07882523e/etc/scripts/get-stack.sh#L327 --- in fact, they don't support anything but X86-64.

Stack only works on M1s, because the CPU translation system (Rosetta 2?) is running using the X86-64 binary, but that's not possible on Linux or (I believe) with Docker. Once you've got Stack running, then GHC (the Haskell compiler) can effectively build an AARCH64 version of Reach.

from reach-lang.

tuomohopia avatar tuomohopia commented on May 28, 2024

@phoniks & @jeapostrophe would either one of you be able to give a bit more detailed instructions on how to compile Reach successfully on Mac M1 with Haskell Stack?

For me, I get the following error when having haskell-stack installed via brew and attempting to run make hs-build in the hs/ folder:

I don't know how to install GHC for (OSX,AArch64), please install manually
make: *** [hs-build] Error 1

I suppose it's because lts-17.4 would use ghc-8.10.4 compiler which is unsupported for M1 right now?

resolver: lts-17.4

Did you manually override the lts compiler version somehow and forced the compilation on one of the supported GHC versions?

from reach-lang.

jeapostrophe avatar jeapostrophe commented on May 28, 2024

We (Reach) don't support this path, but are working on it. I don't know why the error you're seeing shows up.

from reach-lang.

phoniks avatar phoniks commented on May 28, 2024

I think the key is to use Rosetta. When tying to help someone else set this up we did run into this problem - I'm not sure if she ever overcame it, but when I did this process I never ran into that error. My thinking at this point is that you should just switch to an i386 terminal and run the install process normally. I'd love to hear if that works for you because even if it's not supported yet it would be great to come up with a repeatable set of steps that people can use to set up Reach on their M1s.

For reference this is the version of Haskell Stack that's installed and working with Reach on my M1:
Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4

from reach-lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.