From 987b902dc09fb67bf3d96565262a0dd78a208ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ramos?= Date: Fri, 20 Mar 2020 15:32:50 -0700 Subject: [PATCH] Fix `test_android`: Remove references to fbsource cell (#28363) Summary: Fixes https://github.com/facebook/react-native/issues/28361. ## Changelog [Internal] [CI] - Fix test_android Pull Request resolved: https://github.com/facebook/react-native/pull/28363 Test Plan: Prior to fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.5 sec Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK: IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl' Call stack: File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1 load("//tools/build_defs:platform_defs.bzl", "ANDROID") File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped return func(*args, **kwargs) This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport' ``` After fix: ``` react-native $ ./scripts/circleci/buck_fetch.sh + buck fetch ReactAndroid/src/test/java/com/facebook/react/modules Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version. Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini Invalidating internal cached state: Watchman failed to start. This may cause slower builds. Parsing buck files: finished in 1.1 sec Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'. When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation. ``` > Note: I don't have the Android SDK configured in this machine. Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link Reviewed By: cpojer Differential Revision: D20564934 Pulled By: hramos fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290 --- .../src/main/java/com/facebook/fbreact/specs/BUCK | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK index 967cd685626485..677b8b374dc77e 100644 --- a/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK @@ -1,5 +1,4 @@ -load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID") -load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "FBJNI_TARGET", "react_native_dep", "react_native_target", "react_native_xplat_target", "rn_android_library", "rn_xplat_cxx_library") +load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "FBJNI_TARGET", "IS_OSS_BUILD", "react_native_dep", "react_native_target", "react_native_xplat_target", "rn_android_library", "rn_xplat_cxx_library") rn_android_library( name = "FBReactNativeSpec", @@ -45,13 +44,14 @@ rn_xplat_cxx_library( ], deps = [ FBJNI_TARGET, - "fbsource//xplat/folly:molly", - "fbsource//xplat/jsi:JSIDynamic", + "//xplat/folly:molly", + "//xplat/jsi:JSIDynamic", react_native_target("jni/react/jni:jni"), react_native_xplat_target("cxxreact:bridge"), ], - exported_deps = [ - "fbsource//xplat/jsi:jsi", + exported_deps = ([ react_native_xplat_target("turbomodule/core:core"), - ], + ]) + ([ + "//xplat/jsi:jsi" + ]) if not IS_OSS_BUILD else [], )