Skip to content

Commit

Permalink
Merge tag 'v13.27.0' into kb/sync_progress_estimate_api
Browse files Browse the repository at this point in the history
"Feature/bugfix release"
  • Loading branch information
kiburtse committed Mar 1, 2024
2 parents 1fcdfda + dcb6fac commit 87d946d
Show file tree
Hide file tree
Showing 112 changed files with 1,981 additions and 2,031 deletions.
1 change: 1 addition & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ cc_defaults {
"-fPIC",
"-DREALM_NO_CONFIG",
"-DREALM_HAVE_OPENSSL=1",
"-DREALM_USE_SYSTEM_OPENSSL_PATHS=0",
"-DREALM_INCLUDE_CERTS=1",
"-DREALM_ENABLE_ENCRYPTION=1",
"-DREALM_ENABLE_SYNC=1",
Expand Down
22 changes: 18 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# NEXT RELEASE
# 13.27.0 Release notes

### Enhancements
* <New feature description> (PR [#????](https://github.com/realm/realm-core/pull/????))
* Add support in the C API for receiving a notification when sync user state changes. ([#7302](https://github.com/realm/realm-core/pull/7302))
* Allow the query builder to construct >, >=, <, <= queries for string constants. This is a case sensitive lexicographical comparison. Improved performance of RQL (parsed) queries on a non-linked string property using: >, >=, <, <=, operators and fixed behaviour that a null string should be evaulated as less than everything, previously nulls were not matched. ([#3939](https://github.com/realm/realm-core/issues/3939), this is a prerequisite for https://github.com/realm/realm-swift/issues/8008).
* Updated bundled OpenSSL version to 3.2.0 (PR [#7303](https://github.com/realm/realm-core/pull/7303))
* Added `SyncSession::get_file_ident()` so you can trigger a client reset via the BAAS admin API ([PR #7203](https://github.com/realm/realm-core/pull/7203)).
* Audit event scopes containing zero events to save no longer open the audit realm unneccesarily ([PR #7332](https://github.com/realm/realm-core/pull/7332)).
* Added a method to check if a file needs upgrade. ([#7140](https://github.com/realm/realm-core/issues/7140))
* Use `clonefile()` when possible in `File::copy()` on Apple platforms for faster copying. ([PR #7341](https://github.com/realm/realm-core/pull/7341)).

### Fixed
* Fixed queries like `indexed_property == NONE {x}` which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches with `NONE` on a list of one item. If the constant list contained more than one value then it was working correctly. ([realm-js #7862](https://github.com/realm/realm-java/issues/7862), since v12.5.0)
* Uploading the changesets recovered during an automatic client reset recovery may lead to 'Bad server version' errors and a new client reset. ([#7279](https://github.com/realm/realm-core/issues/7279), since v13.24.1)
* Fixed invalid data in error reason string when registering a subscription change notification after the subscription has already failed. ([#6839](https://github.com/realm/realm-core/issues/6839), since v11.8.0)

* Fixed crash in fulltext index using prefix search with no matches ([#7309](https://github.com/realm/realm-core/issues/7309), since v13.18.0)
* Fix compilation and some warnings when building with Xcode 15.3 ([PR #7297](https://github.com/realm/realm-core/pull/7297)).
* util::make_dir_recursive() attempted to create a directory named "\0" if the path did not have a trailing slash ([PR #7329](https://github.com/realm/realm-core/pull/7329)).
* Fixed a crash with `Assertion failed: m_initiated` during sync session startup ([#7074](https://github.com/realm/realm-core/issues/7074), since v10.0.0).
* Fixed a TSAN violation where the user thread could race to read `m_finalized` with the sync event loop ([#6844](https://github.com/realm/realm-core/issues/6844), since v13.15.1)
* Fix a minor race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. ([PR #7341](https://github.com/realm/realm-core/pull/7341)).

### Breaking changes
* None.
* SyncManager no longer supports reconfiguring after calling reset_for_testing(). SyncManager::configure() has been folded into the constructor, and reset_for_testing() has been renamed to tear_down_for_testing(). ([PR #7351](https://github.com/realm/realm-core/pull/7351))

### Compatibility
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Expand All @@ -22,6 +33,9 @@
* Refactored version resolution for the `build-apple-device.sh` script. ([#7263](https://github.com/realm/realm-core/pull/7263))
* Remove SyncUser::binding_context() and related things, which were not actually used by any SDKs.
* (bindgen) Upgrade `eslint-config-prettier` & `eslint-plugin-prettier` and add a missing peer dependency on `prettier`.
* The minimum CMake version has changed from 3.15 to 3.22.1. ([#6537](https://github.com/realm/realm-core/issues/6537))
* Update Catch2 to v3.5.2 ([PR #7297](https://github.com/realm/realm-core/pull/7297)).
* The unused `partition` and `user_local_uuid()` fields have been removed from `FileActionMetadata`. ([PR #7341](https://github.com/realm/realm-core/pull/7341)).

----------------------------------------------

Expand Down
110 changes: 51 additions & 59 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.22.1)
message(STATUS "CMake version: ${CMAKE_VERSION}")

set(CMAKE_BUILD_TYPE Debug CACHE STRING "")
Expand Down Expand Up @@ -137,12 +137,6 @@ else()
add_compile_options(-Wunreachable-code -Wshorten-64-to-32 -Wconditional-uninitialized -Wextra-semi -Wno-nested-anon-types -Wdocumentation -Wthread-safety -Wthread-safety-negative -Wmissing-prototypes)
endif()

if(CMAKE_CXX_STANDARD EQUAL 20)
# std::is_pod was deprecated in c++20, but is still used by 3rd party json parser.
# TODO remove this once we upgrade it.
add_cxx_flag_if_supported(-Wno-deprecated-declarations)
endif()

# By default GCC warns that it changed how it passes bitfields by value as
# function arguments on arm64 every time this happens. This warning is just
# an FYI and not pointing out a problem, so just disable it.
Expand All @@ -154,6 +148,10 @@ else()
# compilers that we still support. It is also harmless, unlike pessimizing moves.
add_cxx_flag_if_supported(-Wno-redundant-move)

# For backwards compatibility libc++ public headers have some transitive
# includes which they don't use. Disabling this improves build times a bit.
add_compile_definitions(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)

# Ninja buffers output so we need to tell the compiler to use colors even though stdout isn't a tty.
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_cxx_flag_if_supported(-fdiagnostics-color)
Expand Down Expand Up @@ -223,7 +221,9 @@ if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /OPT:NOREF /OPT:NOICF")
else()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

Expand Down Expand Up @@ -279,19 +279,7 @@ if(CMAKE_USE_PTHREADS_INIT)
endif()

find_package(Backtrace)
if(Backtrace_FOUND)
add_library(Backtrace::Backtrace INTERFACE IMPORTED)
if(Backtrace_LIBRARIES AND NOT CMAKE_GENERATOR STREQUAL Xcode)
# Apple platforms always have backtrace. We disregard the `Backtrace_*` variables
# because their paths are hardcoded to one SDK within Xcode (e.g. macosx),
# whereas we build for several different SDKs and thus we can't use the include path from one in the other.
# Otherwise if CMake found that the backtrace facility is provided by an external library and not built-in
# we need to configure the interface target with the library include and link path.
target_include_directories(Backtrace::Backtrace INTERFACE ${Backtrace_INCLUDE_DIRS})
target_link_libraries(Backtrace::Backtrace INTERFACE ${Backtrace_LIBRARIES})
endif()
set(REALM_HAVE_BACKTRACE ON)
endif()
set(REALM_HAVE_BACKTRACE ${Backtrace_FOUND})

if(REALM_ENABLE_SYNC)
option(REALM_FORCE_OPENSSL "Always use OpenSSL for SSL needs, regardless of target platform." OFF)
Expand All @@ -306,18 +294,19 @@ elseif(REALM_ENABLE_ENCRYPTION AND CMAKE_SYSTEM_NAME MATCHES "Linux|Android")
endif()

if(REALM_NEEDS_OPENSSL OR REALM_FORCE_OPENSSL)
option(REALM_USE_SYSTEM_OPENSSL "Look for an external OpenSSL installation instead of using prebuilt one." OFF)
set(_REALM_USE_OPENSSL_DEFAULT_VERIFY_PATHS ON)
if(NOT REALM_USE_SYSTEM_OPENSSL AND (ANDROID OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux"))
# Use our own prebuilt OpenSSL
realm_acquire_dependency(openssl ${DEP_OPENSSL_VERSION} OPENSSL_CMAKE_INCLUDE_FILE)

include(${OPENSSL_CMAKE_INCLUDE_FILE})
set(_REALM_USE_OPENSSL_DEFAULT_VERIFY_PATHS OFF)
endif()

if(NOT DEFINED OPENSSL_USE_STATIC_LIBS)
set(OPENSSL_USE_STATIC_LIBS ON)
endif()
find_package(OpenSSL REQUIRED)
set(REALM_HAVE_OPENSSL ON)
option(REALM_USE_SYSTEM_OPENSSL_PATHS "Use the system OpenSSL certificate store (specified by the OPENSSLDIR environment variable) at runtime for TLS handshake." ${_REALM_USE_OPENSSL_DEFAULT_VERIFY_PATHS})
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" OPENSSL_VERSION_MAJOR_MINOR "${OPENSSL_VERSION}")
elseif(APPLE)
set(REALM_HAVE_SECURE_TRANSPORT "1")
Expand All @@ -330,8 +319,11 @@ endif()
# Emscripten does provide Zlib, but it doesn't work with find_package and is handled specially
if(NOT APPLE AND NOT EMSCRIPTEN AND NOT TARGET ZLIB::ZLIB)
if(WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND REALM_LINUX_TOOLCHAIN))
realm_acquire_dependency(zlib ${DEP_ZLIB_VERSION} ZLIB_CMAKE_INCLUDE_FILE)
include(${ZLIB_CMAKE_INCLUDE_FILE})
find_package(ZLIB)
if (NOT ZLIB_FOUND)
realm_acquire_dependency(zlib ${DEP_ZLIB_VERSION} ZLIB_CMAKE_INCLUDE_FILE)
include(${ZLIB_CMAKE_INCLUDE_FILE})
endif()
elseif(ANDROID)
# On Android FindZLIB chooses the static libz over the dynamic one, but this leads to issues
# (see https://github.com/android/ndk/issues/1179)
Expand Down Expand Up @@ -369,6 +361,39 @@ add_subdirectory(bindgen)
# Install the licence and changelog files
install(FILES LICENSE CHANGELOG.md DESTINATION "doc/realm" COMPONENT devel)

# Make the project importable from the build directory
set(REALM_EXPORTED_TARGETS
Storage
QueryParser
ObjectStore
RealmFFI
RealmFFIStatic
)
if(REALM_ENABLE_SYNC)
list(APPEND REALM_EXPORTED_TARGETS Sync)
endif()
export(TARGETS ${REALM_EXPORTED_TARGETS} NAMESPACE Realm:: FILE RealmTargets.cmake)
configure_file(tools/cmake/RealmConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/RealmConfig.cmake @ONLY)
configure_file(tools/cmake/AcquireRealmDependency.cmake ${CMAKE_CURRENT_BINARY_DIR}/AcquireRealmDependency.cmake @ONLY)

# Make the project importable from the install directory
install(EXPORT realm
NAMESPACE Realm::
FILE RealmTargets.cmake
DESTINATION share/cmake/Realm
COMPONENT devel
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/RealmConfig.cmake
DESTINATION share/cmake/Realm
COMPONENT devel
)

install(FILES tools/cmake/AcquireRealmDependency.cmake
DESTINATION share/cmake/Realm
COMPONENT devel
)

# Only prepare test/install/package targets if we're not a submodule
if(REALM_CORE_SUBMODULE_BUILD)
return()
Expand Down Expand Up @@ -400,39 +425,6 @@ if (REALM_BUILD_TEST_CLIENT)
add_subdirectory(test/client)
endif()

# Make the project importable from the build directory
set(REALM_EXPORTED_TARGETS
Storage
QueryParser
ObjectStore
RealmFFI
RealmFFIStatic
)
if(REALM_ENABLE_SYNC)
list(APPEND REALM_EXPORTED_TARGETS Sync)
endif()
export(TARGETS ${REALM_EXPORTED_TARGETS} NAMESPACE Realm:: FILE RealmTargets.cmake)
configure_file(tools/cmake/RealmConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/RealmConfig.cmake @ONLY)
configure_file(tools/cmake/AcquireRealmDependency.cmake ${CMAKE_CURRENT_BINARY_DIR}/AcquireRealmDependency.cmake @ONLY)

# Make the project importable from the install directory
install(EXPORT realm
NAMESPACE Realm::
FILE RealmTargets.cmake
DESTINATION lib/cmake/Realm
COMPONENT devel
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/RealmConfig.cmake
DESTINATION lib/cmake/Realm
COMPONENT devel
)

install(FILES tools/cmake/AcquireRealmDependency.cmake
DESTINATION lib/cmake/Realm
COMPONENT devel
)

# CPack
set(CPACK_GENERATOR "TGZ")
set(CPACK_PACKAGE_VERSION ${REALM_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription
import Foundation

let versionStr = "13.26.0"
let versionStr = "13.27.0"
let versionPieces = versionStr.split(separator: "-")
let versionCompontents = versionPieces[0].split(separator: ".")
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
Expand Down
8 changes: 8 additions & 0 deletions bindgen/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,12 @@ records:
reason: std::string
primary_key: Mixed

SaltedFileIdent:
cppName: sync::SaltedFileIdent
fields:
ident: uint64_t
salt: int64_t

opaqueTypes:
- Schema
- Group
Expand Down Expand Up @@ -685,6 +691,7 @@ classes:
# Converts char* and length to a combined string_view argument to callback.
# TODO: Consider making preverify_ok a bool.
make_ssl_verify_callback: '(callback: (server_address: const std::string&, server_port: int, pem_data: std::string_view, preverify_ok: int, depth: int) off_thread -> bool) -> SSLVerifyCallback'
needs_file_format_upgrade: '(config: const RealmConfig&) -> bool'

Logger:
cppName: util::Logger
Expand Down Expand Up @@ -1304,6 +1311,7 @@ classes:
force_close: ()
shutdown_and_wait: ()
update_configuration: '(config: SyncConfig)'
get_file_ident: '() -> SaltedFileIdent'

SSLVerifyCallback:
cppName: std::function<SyncConfig::SSLVerifyCallback>
Expand Down
5 changes: 5 additions & 0 deletions bindgen/src/realm_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ struct Helpers {
return callback(server_address, server_port, std::string_view(pem_data, pem_size), preverify_ok, depth);
};
}

static bool needs_file_format_upgrade(const RealmConfig& config)
{
return config.needs_file_format_upgrade();
}
};

struct ObjectChangeSet {
Expand Down
4 changes: 2 additions & 2 deletions dependencies.list
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PACKAGE_NAME=realm-core
VERSION=13.26.0
OPENSSL_VERSION=3.0.8
VERSION=13.27.0
OPENSSL_VERSION=3.2.0
ZLIB_VERSION=1.2.13
# https://github.com/10gen/baas/commits
# 5087f is 2024 Jan 13
Expand Down
Loading

0 comments on commit 87d946d

Please sign in to comment.