Comments (21)
@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.
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.
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.
@MrJackdaw I also tried setting the experimental big sur virtualisation in docker settings, didn't do a trick for me unfortunately.
from reach-lang.
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.
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.
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.
Right now, we're waiting/working on Haskell Stack support --- https://github.com/commercialhaskell/stack
from reach-lang.
@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.
Yes, essentially you want to go to the hs
directory and type make hs-build
from reach-lang.
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.
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.
As you expected once the REACH_DOCKER variable was set to 0 things worked perfectly without any additional steps. Thanks @jeapostrophe.
from reach-lang.
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.
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:
- Install Stack.
- Clone this repo if you haven't already.
- Follow the instructions from the README
- Build the app with
make hs build
- Set the REACH_DOCKER environment variable to 0
At this point it worked as expected for me following the tutorial.
from reach-lang.
@phoniks thank you! Will try it out!
from reach-lang.
@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.
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.
@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?
Line 1 in 745d693
Did you manually override the lts
compiler version somehow and forced the compilation on one of the supported GHC versions?
from reach-lang.
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.
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)
- Getting Error("no log for ".concat(o_lab)) when using remote call HOT 3
- "logic eval error: fee too small" when upgrading to latest Reach (f33abc3d) HOT 11
- While creating ASA in algorand using stdlib.launchToken(), opts.metaDataHash value is ignored and not set in the asset. HOT 4
- Feature Request: Add manager address in opts for stdlib.launchToken() for Alogrand network HOT 1
- WalletConnect producing undefined importKey error HOT 2
- Feature Request: Use algod for asset information if reading is allowed. HOT 2
- Reach Compiler Error HOT 2
- Reach seems to produce impossible values for counter-example to failed "check" statement HOT 2
- launchToken does not set manager address in Algorand TestNet HOT 2
- Compiler error when using .fromObject HOT 1
- Pera wallet connect not working HOT 2
- Unable to import stdlib in Vite HOT 1
- Reach run gives error on latest version
- Reach run gives error on latest version HOT 2
- Not able to import modules in versions after 0.1.13rc0 (f79282c4)
- Remote object call triggers an assumption error
- Sqrt fails formal verification HOT 5
- feat: integrate algorand community's use-wallet HOT 1
- fix: please upgrade Reach's Walletconnect from v1 to v2
- test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reach-lang.