Closed maxkorp closed 2 years ago
Hey @maxkorp! TBH I'm pretty much in the same boat in terms of native OCaml experience: it's limited to a couple of PPXes, and that's it. I haven't looked yet into native OCaml + apple silicon. I'd appreciate any help since I'm not sure when I'll be able to look into it. But definitely, not earlier than my new mac arrives. Retailer estimated Jan/Feb next year.
Well previously I had to do some silly things to get esy working natively, although that appears to be fixed with the latest release (0.6.12
) that came out the other day. Using that, I'm able to get re-formality to build natively, which was much easier than anticipated.
I guess the tricky part here will be publishing, since theres no apple arm64 boxes for github actions that I know of (I've also never used actions so please bear with me here). I'm happy to provide builds, (or hardware we can use), whatever would work.
If I wanted to experiment with this on other machines, I'd want to publish the contents of ./lib
to a git repo to target in consuming projects, correct?
Just because I missed it, for other people who come across this post: this seems already fixed in the latest beta because of https://github.com/shakacode/re-formality/pull/106, just update the package and it should work :)
@happylinks so that allows it to work in rosetta (so running the x64 binary on arm via emulation). I'm talking about compiling it natively for arm64.
@maxkorp @happylinks I finally got my M1 and I'll look into it sometime next week.
@maxkorp Did you have issues compiling OCaml? I'm seeing this error:
$ which gcc
/nix/store/lrzpgjmdfw7m3w3hd2fa6aafwbg9526z-gcc-wrapper-11.2.0/bin/gcc
$ esy
info esy 0.6.12 (using esy.json)
info building ocaml@4.12.0@d41d8cd9
error: build failed with exit code: 1
build log:
# esy-build-package: building: ocaml@4.12.0
# esy-build-package: pwd: /Users/Alex/.esy/3/b/ocaml-4.12.0-3a04ec8f
# esy-build-package: running: './esy-configure' '--disable-cfi' '--prefix' '/Users/Alex/.esy/3___________________________________________________________________/s/ocaml-4.12.0-3a04ec8f'
[esy-configure] Detected OSX / Linux environment
configure: Configuring OCaml version 4.12.0
checking build system type... aarch64-apple-darwin21.3.0
checking host system type... aarch64-apple-darwin21.3.0
checking target system type... aarch64-apple-darwin21.3.0
checking for ld... ld
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/Alex/.esy/3/b/ocaml-4.12.0-3a04ec8f':
configure: error: C compiler cannot create executables
See `config.log' for more details
error: command failed: './esy-configure' '--disable-cfi' '--prefix' '/Users/Alex/.esy/3___________________________________________________________________/s/ocaml-4.12.0-3a04ec8f' (exited with 77)
esy-build-package: exiting with errors above...
building ocaml@4.12.0
esy: exiting due to errors above
config.log
Hi! I'm in the process of trying to get everything on my team moved from rosetta to full native m1 support. Is there anything planned already? I'm happy to dedicate work hours or other resources to this if that is helpful. I've not done much with PPXs or any ocaml native builds of anything, but my primary focus on the team now is our tooling, and we use re-formality ppx heavily so I'm happy to dive in.