Remove i386 arch check for Hermes (#40656)

Summary:
Since https://github.com/facebook/react-native/commit/21763e85e39e17a19a1cf7a9026ef74517464749, `min_ios_version_supported` is `13.4`. So `i386` is no longer supported as `iOS`(maybe tvOS) target architecture

## Changelog:

[IOS] [INTERNAL] - remove exclude_i386_architecture_while_using_hermes

Pull Request resolved: https://github.com/facebook/react-native/pull/40656

Test Plan: None

Reviewed By: cortinico

Differential Revision: D50117517

Pulled By: cipolleschi

fbshipit-source-id: 774faf82c4cfae45d77d37e471fb883ad775e5cc
This commit is contained in:
Sunbreak
2023-10-10 03:19:26 -07:00
committed by Facebook GitHub Bot
parent 04c501fa4a
commit 39bbf8c53c
4 changed files with 2 additions and 116 deletions
@@ -219,94 +219,6 @@ class UtilsTests < Test::Unit::TestCase
assert_nil(hermes_engine_release_config.build_settings[build_setting])
end
# ============================ #
# Test - Exclude Architectures #
# ============================ #
def test_excludeArchitectures_whenHermesEngineIsNotIncluded_withNoValue_leaveUnset
# Arrange
user_project_mock = prepare_empty_user_project_mock()
pods_projects_mock = PodsProjectMock.new()
installer = InstallerMock.new(PodsProjectMock.new(), [
AggregatedProjectMock.new(user_project_mock)
])
# Act
ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
# Assert
user_project_mock.build_configurations.each do |config|
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], nil)
end
assert_equal(user_project_mock.save_invocation_count, 0)
assert_equal(pods_projects_mock.save_invocation_count, 0)
end
def test_excludeArchitectures_whenHermesEngineIsNotIncluded_withExistingValue_preserveExistingValue
# Arrange
user_project_mock = prepare_empty_user_project_mock()
user_project_mock.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
pods_projects_mock = PodsProjectMock.new()
installer = InstallerMock.new(pods_projects_mock, [
AggregatedProjectMock.new(user_project_mock)
])
# Act
ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
# Assert
user_project_mock.build_configurations.each do |config|
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "arm64")
end
assert_equal(user_project_mock.save_invocation_count, 0)
assert_equal(pods_projects_mock.save_invocation_count, 0)
end
def test_excludeArchitectures_whenHermesEngineIsIncluded_withNoValue_onlyExcludeI386
# Arrange
user_project_mock = prepare_empty_user_project_mock()
pods_projects_mock = PodsProjectMock.new([], {"hermes-engine" => {}})
installer = InstallerMock.new(pods_projects_mock, [
AggregatedProjectMock.new(user_project_mock)
])
# Act
ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
# Assert
user_project_mock.build_configurations.each do |config|
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "i386")
end
assert_equal(user_project_mock.save_invocation_count, 1)
assert_equal(pods_projects_mock.save_invocation_count, 1)
end
def test_excludeArchitectures_whenHermesEngineIsIncluded_withExistingValue_appendI386
# Arrange
user_project_mock = prepare_empty_user_project_mock()
user_project_mock.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
pods_projects_mock = PodsProjectMock.new([], {"hermes-engine" => {}})
installer = InstallerMock.new(pods_projects_mock, [
AggregatedProjectMock.new(user_project_mock)
])
# Act
ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
# Assert
user_project_mock.build_configurations.each do |config|
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "arm64 i386")
end
assert_equal(user_project_mock.save_invocation_count, 1)
assert_equal(pods_projects_mock.save_invocation_count, 1)
end
# ================= #
# Test - Fix Config #
# ================= #
@@ -61,31 +61,6 @@ class ReactNativePodsUtils
end
end
def self.exclude_i386_architecture_while_using_hermes(installer)
is_using_hermes = self.has_pod(installer, 'hermes-engine')
if is_using_hermes
key = "EXCLUDED_ARCHS[sdk=iphonesimulator*]"
projects = self.extract_projects(installer)
projects.each do |project|
project.build_configurations.each do |config|
current_setting = config.build_settings[key] || ""
excluded_archs_includes_I386 = current_setting.include?("i386")
if !excluded_archs_includes_I386
# Hermes does not support 'i386' architecture
config.build_settings[key] = "#{current_setting} i386".strip
end
end
project.save()
end
end
end
def self.set_use_hermes_build_setting(installer, hermes_enabled)
Pod::UI.puts("Setting USE_HERMES build settings")
projects = self.extract_projects(installer)
@@ -264,7 +264,6 @@ def react_native_post_install(
if hermes_enabled
ReactNativePodsUtils.set_gcc_preprocessor_definition_for_React_hermes(installer)
ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
end
ReactNativePodsUtils.fix_library_search_paths(installer)
@@ -896,7 +896,7 @@
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -1000,7 +1000,7 @@
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;