Skip to content

Commit

Permalink
Make OSS libhermes ABI compatible with RN
Browse files Browse the repository at this point in the history
Summary:
We removed a method that RN currently uses, which means that Hermes 0.2.x can not be used with RN <=0.60.5. See #109

This diff adds a dummy passthrough method for linking compatibility.

Reviewed By: mhorowitz

Differential Revision: D17351288

fbshipit-source-id: 7d98af7065064dd47f66dba9ca82ac1192dff133
  • Loading branch information
willholen authored and facebook-github-bot committed Sep 12, 2019
1 parent da4e30b commit 5b6c59e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions API/hermes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
set(LLVM_OPTIONAL_SOURCES
hermes.cpp
hermes_tracing.cpp
hermes_tracing_compat.cpp
DebuggerAPI.cpp
SynthTrace.cpp
SynthTraceParser.cpp
Expand All @@ -17,6 +18,7 @@ set(LLVM_OPTIONAL_SOURCES
set(api_sources
hermes.cpp
DebuggerAPI.cpp
hermes_tracing_compat.cpp
)

add_llvm_library(hermesapi
Expand Down
24 changes: 24 additions & 0 deletions API/hermes/hermes_tracing_compat.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*/
#include "hermes_tracing.h"
#include "llvm/Support/ErrorHandling.h"

namespace facebook {
namespace hermes {

// This function is here for ABI linking compatibility.
std::unique_ptr<jsi::Runtime> makeTracingHermesRuntime(
std::unique_ptr<HermesRuntime> hermesRuntime,
const ::hermes::vm::RuntimeConfig &runtimeConfig) {
if (!runtimeConfig.getTraceEnvironmentInteractions()) {
return hermesRuntime;
}
llvm_unreachable("Invoked compat makeTracingHermesRuntime!");
}

} // namespace hermes
} // namespace facebook

0 comments on commit 5b6c59e

Please sign in to comment.