-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 support for NDK21 #6460
Add support for NDK21 #6460
Conversation
Fix merge from 9c0963 to next-major
# Conflicts: # CHANGELOG.md # version.txt
Fix merge from efb60f to next-major
Comparing NDK 21 - Default Linker (not LLD)Analyzing Base... Analyzing ObjectServer... NDK r10eAnalyzing Base... Analyzing ObjectServer... Flag notesAdding |
@nhachicha this PR is now ready for review. But I don't think they should stop us from merging this PR as NDK21 support is required to adopt any of the new datatypes being developed in Core/ObjectStore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor things 👍
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") | ||
#-ggdb doesn't play well with -flto | ||
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -Oz") | ||
# -ggdb doesn't play well with -flto | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -Og") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly, should we suppress optimisation for glldb
as well?
@@ -157,8 +157,8 @@ JNIEXPORT jboolean JNICALL Java_io_realm_SyncSession_nativeWaitForDownloadComple | |||
static JavaClass java_sync_session_class(env, "io/realm/SyncSession"); | |||
static JavaMethod java_notify_result_method(env, java_sync_session_class, "notifyAllChangesSent", | |||
"(ILjava/lang/Long;Ljava/lang/String;)V"); | |||
JavaGlobalRef java_session_object_ref(env, session_object); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw JavaGlobalRef
has move assignment operator so
session->wait_for_download_completion([java_session_object_ref=std::move(java_session_object_ref), callback_id](std::error_code error) {
should work I think, since the moved java_session_object_ref
will be deleted inside the callback scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting the following error no matter what I do. Even using your approach. I'm suspecting it is somehow related to how the JavaGlobalRef
class is defined, but no idea how to fix it
/Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_SyncSession.cpp:194:49: note: candidate constructor (the implicit move constructor) not viable: 1st argument ('const (lambda at /Users/cm/Realm/realm-java/realm/realm-library/src/main/cpp/io_realm_SyncSession.cpp:194:49)') would lose const qualifier
@@ -291,7 +291,7 @@ JNIEXPORT jstring JNICALL Java_io_realm_internal_OsRealmConfig_nativeCreateAndSe | |||
case ECONNABORTED: error_code = 113; break; | |||
default: | |||
/* Do nothing */ | |||
error_code = error_code; | |||
(void)0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use REALM_UNREACHABLE();
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't unreachable, you might end up here, but if there is no code here it will trigger a warning which breaks compilation
@@ -300,7 +300,7 @@ JNIEXPORT jstring JNICALL Java_io_realm_internal_OsRealmConfig_nativeCreateAndSe | |||
case util::MiscExtErrors::delim_not_found: error_code = 3; break; | |||
default: | |||
/* Do nothing */ | |||
error_code = error_code; | |||
(void)0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -38,6 +38,9 @@ | |||
* @return | |||
*/ | |||
public static Permission findOrCreatePermissionForRole(RealmObject container, RealmList<Permission> permissions, String roleName) { | |||
if (roleName == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (roleName == null) { | |
if (Util.isEmptyString(roleName)) { |
.../realm-library/src/syncIntegrationTest/java/io/realm/objectserver/ProgressListenerTests.java
Outdated
Show resolved
Hide resolved
# To run it: | ||
# 1. Make sure that $D8 is defined in your environment, e.g. `D8="$ANDROID_SDK_ROOT/build-tools/29.0.2/d8"` | ||
# 2. Make sure that you have built the library artifacts using `./gradlew assembleRelease` from the realm folder. | ||
# 3. Run the script: `> sh ./analyze_realm_metrics.sh` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, running this from tools
or <root>
or <root/realm>
always report cat: ./unzippedBase/classes.dex: No such file or directory
Analyzing Base...
AAR size: 2476366
cat: ./unzippedBase/classes.dex: No such file or directory
5641248 ./unzippedBase/jni/x86/librealm-jni.so
Analyzing ObjectServer...
AAR size: 3476405
cat: ./unzippedObjectServer/classes.dex: No such file or directory
This PR bumps the NDK support from
r10e
tor21
Closes #6408
Closes #3506
Closes #3623
It has the following impact:
minSdk
is bumped from 9 to 16 (This will impact ~1% of current users)TODO
See https://github.com/realm/openssl-android-termux