From da5596c97deb4fe79e1f4837ca22fe17d32fdd37 Mon Sep 17 00:00:00 2001 From: Konstantin Raev Date: Sat, 19 Mar 2016 02:14:22 -0700 Subject: [PATCH] fixed flow error on Travis Summary: Closes https://github.com/facebook/react-native/pull/6530 Differential Revision: D3071277 fb-gh-sync-id: e2cfd2d2a8cbf5a862dcdb79fe834b1fdbcba107 shipit-source-id: e2cfd2d2a8cbf5a862dcdb79fe834b1fdbcba107 --- .flowconfig | 2 -- .travis.yml | 7 +++---- ReactAndroid/src/main/jni/react/Bridge.cpp | 14 ++++++++------ .../src/main/jni/third-party/folly/Android.mk | 1 - bots/code-analysis-bot.js | 3 ++- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.flowconfig b/.flowconfig index b3b965f02985c0..789fe76baf8dda 100644 --- a/.flowconfig +++ b/.flowconfig @@ -58,8 +58,6 @@ .*/node_modules/joi/.*\.json .*/node_modules/isemail/.*\.json .*/node_modules/tr46/.*\.json -.*/build/.*\.json -.*/\.buckd/.* [include] diff --git a/.travis.yml b/.travis.yml index 7dff33567cab54..7b299d9eb45f84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ osx_image: xcode7.2 install: - brew reinstall nvm - - mkdir -p .nvm - - export NVM_DIR="$PWD/.nvm" + - mkdir -p /Users/travis/build/facebook/.nvm + - export NVM_DIR="/Users/travis/build/facebook/.nvm" - source $(brew --prefix nvm)/nvm.sh # testing with npm@2 for diversity, Circle tests with npm@3 - nvm install 4.4.0 @@ -17,8 +17,7 @@ install: script: - if [[ "$TEST_TYPE" = objc ]]; then travis_retry ./scripts/objc-test.sh; fi - if [[ "$TEST_TYPE" = e2e-objc ]]; then travis_retry ./scripts/e2e-test.sh --ios; fi - # temporarily disable flow check because it went mad on Travis -# - if [[ "$TEST_TYPE" = js ]]; then npm run flow check; fi + - if [[ "$TEST_TYPE" = js ]]; then npm run flow check; fi - if [[ "$TEST_TYPE" = js ]]; then npm test -- --maxWorkers=1; fi - if [[ "$TEST_TYPE" = js ]]; then ./scripts/e2e-test.sh --packager; fi diff --git a/ReactAndroid/src/main/jni/react/Bridge.cpp b/ReactAndroid/src/main/jni/react/Bridge.cpp index 41c389ddcac025..7b032bfd0f5f82 100644 --- a/ReactAndroid/src/main/jni/react/Bridge.cpp +++ b/ReactAndroid/src/main/jni/react/Bridge.cpp @@ -66,15 +66,16 @@ void Bridge::callFunction( systraceCookie); #endif + #ifdef WITH_FBSYSTRACE runOnExecutorQueue(executorToken, [moduleId, methodId, arguments, tracingName, systraceCookie] (JSExecutor* executor) { - #ifdef WITH_FBSYSTRACE FbSystraceAsyncFlow::end( TRACE_TAG_REACT_CXX_BRIDGE, tracingName.c_str(), systraceCookie); FbSystraceSection s(TRACE_TAG_REACT_CXX_BRIDGE, tracingName.c_str()); - #endif - + #else + runOnExecutorQueue(executorToken, [moduleId, methodId, arguments, tracingName] (JSExecutor* executor) { + #endif // This is safe because we are running on the executor's thread: it won't // destruct until after it's been unregistered (which we check above) and // that will happen on this thread @@ -91,15 +92,16 @@ void Bridge::invokeCallback(ExecutorToken executorToken, const double callbackId systraceCookie); #endif + #ifdef WITH_FBSYSTRACE runOnExecutorQueue(executorToken, [callbackId, arguments, systraceCookie] (JSExecutor* executor) { - #ifdef WITH_FBSYSTRACE FbSystraceAsyncFlow::end( TRACE_TAG_REACT_CXX_BRIDGE, "", systraceCookie); FbSystraceSection s(TRACE_TAG_REACT_CXX_BRIDGE, "Bridge.invokeCallback"); - #endif - + #else + runOnExecutorQueue(executorToken, [callbackId, arguments] (JSExecutor* executor) { + #endif executor->invokeCallback(callbackId, arguments); }); } diff --git a/ReactAndroid/src/main/jni/third-party/folly/Android.mk b/ReactAndroid/src/main/jni/third-party/folly/Android.mk index cc60258b80ea24..4cabadccb83c66 100644 --- a/ReactAndroid/src/main/jni/third-party/folly/Android.mk +++ b/ReactAndroid/src/main/jni/third-party/folly/Android.mk @@ -7,7 +7,6 @@ LOCAL_SRC_FILES:= \ folly/Conv.cpp \ folly/detail/FunctionalExcept.cpp \ folly/detail/MallocImpl.cpp \ - folly/Malloc.cpp \ folly/StringBase.cpp \ folly/dynamic.cpp \ diff --git a/bots/code-analysis-bot.js b/bots/code-analysis-bot.js index daf513b70a63e4..d22ffb29a7ffde 100644 --- a/bots/code-analysis-bot.js +++ b/bots/code-analysis-bot.js @@ -22,7 +22,8 @@ if (!process.env.GITHUB_TOKEN) { } if (!process.env.PULL_REQUEST_NUMBER) { console.error('Missing PULL_REQUEST_NUMBER. Example: 4687'); - process.exit(1); + // for master branch don't throw and error + process.exit(0); } var GitHubApi = require('github');