macOS Development - Contributing to tools/hermes-parser/js
#1680
Replies: 3 comments 8 replies
-
Perhaps more importantly, would this not suggest that these tests are not run in CI? |
Beta Was this translation helpful? Give feedback.
-
The good news is that looking at I will pass this to them, I am sure they will want to help. |
Beta Was this translation helpful? Give feedback.
-
So first, we have moved our source of truth to the
buildWasmParser.sh builds the WASM binary and returns the path to it. Internally we use buck for this so i don't believe we have a working CMake version. However i saw https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/CMakeLists.txt, this at least includes all the emscripten options we use to build.
This builds all the header files and returns the path for use by https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/scripts/genNodeDeserializers.js#L29 and https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/scripts/genESTreeJSON.js#L53. This allows the build scripts to access the AST structure defined in hermes/include/hermes/AST/ESTree.def Line 4 in 4eb6132 But you only need to regenerate these files if you change the parser's AST structure, if you don't need that you can comment out those parts of the build script. Let me know if you have any other questions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR: Any chance anybody has been able to run
yarn test
intools/hermes-parser/js
on Mac OS?Hoping someone else running on macOS (Apple Silicon) may have successfully gotten a dev env running.
The following sections of the
build.sh
file intools/hermes-parser/js/scripts
: https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/scripts/build.sh#L24-L44 give me a bit of pause, since well... I don't work at facebook 🤣.However, I have created a small script: (
prepare.sh
) that does what I think needs to be done:What lies ahead is simply a story of a man trying so hard just to get this working. It is possible that he has already gone too far and is missing something simple. Feel free to read to understand what I've done.
This (almost) works, but fails with a missing dependency which I can work-around by adding:
HermesParserDiagHandler.cpp
to theadd_hermes_tool
definition intools/hermes-parser/CMakeLists.txt
at which point I have
hermes-parser-wasm.js
inbuild/bin
, which I believe is the file that is expected to be generated from:https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/scripts/build.sh#L25
and the
INCLUDE_PATH
used inbuild.sh
I presume should behermes/include
which I can set, and end up getting slightly further:yarn build $PATH_TO_HERMES_PARSER_WASM $PATH_TO_INCLUDE
then breaks one more time!These two find / exec commands are non macOS compliant (illegal options etc...)
https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/scripts/build.sh#L65-L68
Which I can modify as well to keep moving until we hit the final boss:
Beta Was this translation helpful? Give feedback.
All reactions