Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CircleCI tests for use frameworks #35497

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,11 @@ jobs:
description: Whether Flipper is enabled. Must be one of "WithFlipper", "WithoutFlipper".
type: enum
enum: ["WithFlipper", "WithoutFlipper"]
use_frameworks:
default: "StaticLibraries"
description: Which kind of option we want to use for `use_frameworks!`
type: enum
enum: ["StaticLibraries", "StaticFrameworks"] #TODO: Add "DynamicFrameworks"
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root
Expand All @@ -831,6 +836,24 @@ jobs:
steps:
- run:
command: circleci-agent step halt # this interrupts the job successfully.
# use_frameworks! does not works with Flipper enabled
- when:
condition:
and:
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
- equal: [ << parameters.flipper >>, "WithFlipper" ]
steps:
- run:
command: circleci-agent step halt # this interrupts the job successfully.
# use_frameworks! does not works with the New Architecture enabled
- when:
condition:
and:
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
- equal: [ << parameters.architecture >>, "NewArch" ]
steps:
- run:
command: circleci-agent step halt # this interrupts the job successfully.
# Valid configuration, we can continue
- checkout_code_with_cache
- run_yarn
Expand Down Expand Up @@ -878,6 +901,10 @@ jobs:
export NO_FLIPPER=1
fi
if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
export USE_FRAMEWORKS=static
fi
bundle exec pod install
- run:
name: Build template project
Expand Down Expand Up @@ -1565,6 +1592,7 @@ workflows:
flavor: ["Debug", "Release"]
jsengine: ["Hermes", "JSC"]
flipper: ["WithFlipper", "WithoutFlipper"]
use_frameworks: [ "StaticLibraries", "StaticFrameworks" ] #TODO: make it works with DynamicFrameworks
- test_ios_rntester:
requires:
- build_hermes_macos
Expand Down
2 changes: 0 additions & 2 deletions ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ Pod::Spec.new do |s|

s.subspec "core" do |ss|
ss.dependency folly_dep_name, folly_version
ss.dependency "React-jsidynamic", version
ss.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
ss.source_files = "react/renderer/core/**/*.{m,mm,cpp,h}"
ss.exclude_files = "react/renderer/core/tests"
Expand Down Expand Up @@ -303,7 +302,6 @@ Pod::Spec.new do |s|

s.subspec "uimanager" do |ss|
ss.dependency folly_dep_name, folly_version
ss.dependency "React-jsidynamic", version
ss.compiler_flags = folly_compiler_flags
ss.source_files = "react/renderer/uimanager/**/*.{m,mm,cpp,h}"
ss.exclude_files = "react/renderer/uimanager/tests"
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/ReactCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Pod::Spec.new do |s|
ss.subspec "core" do |sss|
sss.source_files = "react/nativemodule/core/ReactCommon/**/*.{cpp,h}",
"react/nativemodule/core/platform/ios/**/*.{mm,cpp,h}"
sss.dependency "React-jsidynamic", version
sss.exclude_files = "react/nativemodule/core/ReactCommon/{LongLivedObject,CallbackWrapper}.h"
end

ss.subspec "samples" do |sss|
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/hermes/React-hermes.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Pod::Spec.new do |s|
}.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {})
s.header_dir = "reacthermes"
s.dependency "React-cxxreact", version
s.dependency "React-jsidynamic", version
s.dependency "React-jsiexecutor", version
s.dependency "React-jsinspector", version
s.dependency "React-perflogger", version
Expand Down
19 changes: 16 additions & 3 deletions ReactCommon/jsi/React-jsi.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ else
source[:tag] = "v#{version}"
end

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
folly_version = '2021.07.22.00'
boost_compiler_flags = '-Wno-documentation'

Pod::Spec.new do |s|
s.name = "React-jsi"
s.version = version
Expand All @@ -30,18 +34,27 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "12.4" }
s.source = source

s.header_dir = "jsi"
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }

s.dependency "boost", "1.76.0"
s.dependency "DoubleConversion"
s.dependency "RCT-Folly", folly_version
s.dependency "glog"

if js_engine == :jsc
s.source_files = "**/*.{cpp,h}"
s.exclude_files = [
"jsi/JSIDynamic.{h,cpp}",
"jsi/jsilib-posix.cpp",
"jsi/jsilib-windows.cpp",
"**/test/*"
]
s.header_dir = "jsi"

elsif js_engine == :hermes
# JSI is provided by hermes-engine when Hermes is enabled
s.source_files = ""
# Just need to provide JSIDynamic in this case.
s.source_files = "jsi/JSIDynamic.{cpp,h}"
s.dependency "hermes-engine"
end
end
42 changes: 0 additions & 42 deletions ReactCommon/jsi/React-jsidynamic.podspec

This file was deleted.

1 change: 0 additions & 1 deletion ReactCommon/jsiexecutor/React-jsiexecutor.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Pod::Spec.new do |s|

s.dependency "React-cxxreact", version
s.dependency "React-jsi", version
s.dependency "React-jsidynamic", version
s.dependency "React-perflogger", version
s.dependency "RCT-Folly", folly_version
s.dependency "DoubleConversion"
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/react/bridging/CallbackWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

#include <jsi/jsi.h>
#include <react/bridging/LongLivedObject.h>
#include "LongLivedObject.h"

#include <memory>

Expand Down
11 changes: 11 additions & 0 deletions ReactCommon/react/nativemodule/core/ReactCommon/CallbackWrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#pragma once

// This header is left here for compatibility reasons.
#include <react/bridging/CallbackWrapper.h>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include <jsi/jsi.h>

#include <ReactCommon/CallInvoker.h>
#include <react/bridging/CallbackWrapper.h>
#include <react/bridging/LongLivedObject.h>
#include <ReactCommon/CallbackWrapper.h>

namespace facebook {
namespace react {
Expand Down
2 changes: 1 addition & 1 deletion scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def use_react_native! (
else
setup_jsc!(:react_native_path => prefix, :fabric_enabled => fabric_enabled)
end
pod 'React-jsidynamic', :path => "#{prefix}/ReactCommon/jsi"

pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor"
pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector"

Expand Down
6 changes: 6 additions & 0 deletions template/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ prepare_react_native_project!

flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end

target 'HelloWorld' do
config = use_native_modules!

Expand Down