Coder Social home page Coder Social logo

support m1 about mariana-trench HOT 4 OPEN

facebook avatar facebook commented on April 25, 2024
support m1

from mariana-trench.

Comments (4)

nanashili avatar nanashili commented on April 25, 2024 1

I tried building the binary but for some reason i can't get past building for Regex

from mariana-trench.

wyu0hop avatar wyu0hop commented on April 25, 2024

CRITICAL Unexpected error:
Traceback (most recent call last):
File "/Users/ba1yu2/.venvs/mariana-trench/lib/python3.9/site-packages/mariana_trench/shim/shim.py", line 583, in main
output = subprocess.run(command)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/Users/ba1yu2/.venvs/mariana-trench/bin/mariana-trench-binary'

from mariana-trench.

yuhshin avatar yuhshin commented on April 25, 2024

Hi @wyu0hop, thanks for reaching out!

Mac m1 is not currently supported with the pip install (assuming that is what you have set up).

A workaround for now would be to build from source: https://mariana-tren.ch/docs/contribution#building-from-source

from mariana-trench.

chenguangshen avatar chenguangshen commented on April 25, 2024

Hey Mariana Trench team, hope you all are doing well :)

It looks like some workaround are needed for building from source on M1 Mac. Sharing here in case others ran into similar issues:

  1. For building Redex from source (https://mariana-tren.ch/docs/contribution/#building-redex), one of its required dependency, zlib, is keg-only for Homebrew on Mac, and therefore the path to the static/shared library needed to be passed in explicitly for cmake to work:
cmake -DCMAKE_INSTALL_PREFIX="$MT_INSTALL_DIRECTORY" -DZLIB_STATIC_LIB=/opt/homebrew/opt/zlib/lib/libz.a -DZLIB_SHARED_LIB=/opt/homebrew/opt/zlib/lib/libz.1.2.12.dylib ..
  1. Mariana Trench requires the fmt library 7.1.2. However it looks like the latest version on Homebrew is 9.1.0 and version 9 introduced additional requirements on formatting user defined types (https://fmt.dev/latest/api.html#udt), which will cause a build error for Mariana Trench's fmt usage in Log.h. I had to build fmt version 7.1.2 from source (https://github.com/fmtlib/fmt/tree/7.1.2), then passing in the library path for cmake to work.
  2. Small nit: in Mariana Trench's CMakeLists.txt, it searches for $ANDROID_SDK but only $ANDROID_DX is used by cmake and should be set. https://github.com/facebook/mariana-trench/blob/main/CMakeLists.txt#L177

Based on 2 and 3, the cmake command for Mariana Trench that worked for me:

cmake -DREDEX_ROOT="$MT_INSTALL_DIRECTORY" -DCMAKE_INSTALL_PREFIX="$MT_INSTALL_DIRECTORY" -DANDROID_DX=/path/to/sdk/build-tools/33.0.0/d8 -Dfmt_DIR=/path/to/fmt/build ..

from mariana-trench.

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.