Skip to content

Commit

Permalink
fix: enable x86 for iOS and stop excluding x86 args on both platforms (
Browse files Browse the repository at this point in the history
  • Loading branch information
Johennes authored Dec 20, 2024
1 parent b0f07ca commit 8c6257a
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 24 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ jobs:

- name: Generate
run: |
yarn ubrn:clean
yarn ubrn:checkout
yarn ubrn:android
yarn generate:android
# Free up space for subsequent steps
rm -rf rust_modules
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios,aarch64-apple-ios-sim
targets: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios

- name: Write .xcode.env.local
run: |
Expand All @@ -35,10 +35,9 @@ jobs:
run: |
# Disabling NEON fixes linker error, see
# https://github.com/unomed-dev/react-native-matrix-sdk/issues/12
# TODO: Replace this with setting the reldbg profile once ubrn supports it
export CARGO_FEATURE_NO_NEON=1
yarn ubrn:clean
yarn ubrn:checkout
yarn ubrn:ios
yarn generate:ios
# Free up space for subsequent steps
rm -rf rust_modules
Expand Down
117 changes: 117 additions & 0 deletions example/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
drb (2.2.1)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.17.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.9.1)
logger (1.6.4)
minitest (5.25.4)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.4.0)
ruby-macho (2.5.1)
securerandom (0.4.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.6, < 4.0)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, != 7.1.0)
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 3.3.5p100

BUNDLED WITH
2.5.19
3 changes: 1 addition & 2 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ android.useAndroidX=true
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
# TODO: Add back x86 and x86_64 once we figured out how to build them
reactNativeArchitectures=armeabi-v7a,arm64-v8a
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
Expand Down
7 changes: 0 additions & 7 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,5 @@ target 'ReactNativeMatrixSdkExample' do
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)

# TODO: Remove (together with EXCLUDED_ARCHS build setting in workspace) once we've figured out how to build for x86
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
end
end
end
end
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,6 @@ SPEC CHECKSUMS:
unomed-react-native-matrix-sdk: bb06ecb9acb6a29b2d7887acf50e7db6d92f3eb9
Yoga: db69236006b8b1c6d55ab453390c882306cbf219

PODFILE CHECKSUM: f31d96f710b5116b3170327449261b387e616e6d
PODFILE CHECKSUM: 26c75fa7a8774e3435310ec3d6056a0c49f27cc8

COCOAPODS: 1.16.2
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@
CXX = "";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -636,7 +635,6 @@
CXX = "";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = x86_64;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
"!**/.*"
],
"scripts": {
"ubrn:android": "yarn ubrn:android:build --and-generate",
"ubrn:android:build": "CARGO_TARGET_X86_64_LINUX_ANDROID_RUSTFLAGS=\"-L$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/17/lib/linux\" ubrn build android --config ubrn.yaml",
"ubrn:android:build:release": "yarn ubrn:android:build --release",
"ubrn:ios": "yarn ubrn:ios:build --and-generate && (cd example/ios && pod install)",
"ubrn:ios:build": "ubrn build ios --config ubrn.yaml",
"ubrn:ios:build:release": "yarn ubrn:ios:build --release",
"ubrn:ios:generate": "ubrn generate all --config ubrn.yaml build/RnMatrixRustSdk.xcframework/ios-arm64/libmatrix_sdk_ffi.a && (cd example/ios && pod install)",
"ubrn:checkout": "ubrn checkout --config ubrn.yaml",
"ubrn:clean": "del-cli cpp android/src/main/java ios \"src/Native*\" src/generated \"src/index.ts*\"",
"ubrn:generate": "ubrn generate all --config ubrn.yaml build/RnMatrixRustSdk.xcframework/ios-arm64/libmatrix_sdk_ffi.a",
"generate": "yarn ubrn:clean && yarn ubrn:checkout && yarn ubrn:android && yarn ubrn:ios",
"generate:release": "yarn ubrn:clean && yarn ubrn:checkout && yarn ubrn:android:build:release && yarn ubrn:ios:build:release && yarn ubrn:generate && (cd example/ios && pod install)",
"generate": "yarn ubrn:clean && yarn ubrn:checkout && yarn ubrn:android:build && yarn ubrn:ios:build && yarn ubrn:ios:generate",
"generate:android": "yarn ubrn:clean && yarn ubrn:checkout && yarn ubrn:android:build --and-generate",
"generate:ios": "yarn ubrn:clean && yarn ubrn:checkout && yarn ubrn:ios:build && yarn ubrn:ios:generate",
"generate:release": "yarn ubrn:clean && yarn ubrn:checkout && yarn ubrn:android:build:release && yarn ubrn:ios:build:release && yarn ubrn:ios:generate",
"format": "prettier -w '**/*.{ts,tsx}'",
"example": "yarn workspace @unomed/react-native-matrix-sdk-example",
"typecheck": "tsc",
Expand Down
1 change: 1 addition & 0 deletions ubrn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ios:
targets:
- aarch64-apple-ios
- aarch64-apple-ios-sim
- x86_64-apple-ios
xcodebuildExtras: []
frameworkName: build/RnMatrixRustSdk
noOverwrite: []
Expand Down

0 comments on commit 8c6257a

Please sign in to comment.