Skip to content

Commit 0505de4

Browse files
committed
Merge branch 'next-major' into je/global-key
2 parents 80dfb33 + d1520c3 commit 0505de4

File tree

204 files changed

+25310
-14592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+25310
-14592
lines changed

.clang-format

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2+
# Don't try to format any languages not described by this file
3+
DisableFormat: true
24
BasedOnStyle: LLVM
35
AccessModifierOffset: -4
46
AlignAfterOpenBracket: Align
@@ -56,7 +58,6 @@ ConstructorInitializerIndentWidth: 4
5658
ContinuationIndentWidth: 4
5759
Cpp11BracedListStyle: true
5860
DerivePointerAlignment: false
59-
DisableFormat: false
6061
ExperimentalAutoDetectBinPacking: false
6162
FixNamespaceComments: true
6263
ForEachMacros:
@@ -125,5 +126,10 @@ StatementMacros:
125126
- QT_REQUIRE_VERSION
126127
TabWidth: 4
127128
UseTab: Never
129+
---
130+
Language: Cpp
131+
DisableFormat: false
132+
---
133+
Language: ObjC
134+
DisableFormat: false
128135
...
129-

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ CMakeScripts
2525
# Ignore build artifacts
2626
/build*
2727
/debug*
28+
/release*
2829

2930
# Ignore all user files except one which includes execution path for test
3031
*.user
@@ -97,3 +98,8 @@ compile_commands.json
9798
# Swift package manager
9899
/.swiftpm
99100
/.build
101+
102+
# Bindgen generated files and npm stuff
103+
/bindgen/generated/
104+
node_modules/
105+
tsconfig.tsbuildinfo

Android.bp

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ cc_defaults {
148148
"-fPIC",
149149
"-DREALM_NO_CONFIG",
150150
"-DREALM_HAVE_OPENSSL=1",
151+
"-DREALM_INCLUDE_CERTS=1",
151152
"-DREALM_ENABLE_ENCRYPTION=1",
152153
"-DREALM_ENABLE_SYNC=1",
153154
"-DREALM_ENABLE_GEOSPATIAL=1",

CHANGELOG.md

+102
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
* Fixed equality queries on a Mixed property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. ([6407](https://github.com/realm/realm-core/issues/6407) since v11.0.0-beta.5).
1313
* If you have more than 8388606 links pointing to one specific object, the program will crash. ([#6577](https://github.com/realm/realm-core/issues/6577), since v6.0.0)
1414
* Query for NULL value in Dictionary<Mixed> would give wrong results ([6748])(https://github.com/realm/realm-core/issues/6748), since v10.0.0)
15+
* A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). ([PR # 6670](https://github.com/realm/realm-core/pull/6670), since 2.0.0-rc7 for indexes, and since since the introduction of sets in v10.2.0)
1516

1617
### Breaking changes
1718
* Support for upgrading from Realm files produced by RealmCore v5.23.9 or earlier is no longer supported.
1819
* Remove `set_string_compare_method`, only one sort method is now supported which was previously called `STRING_COMPARE_CORE`.
1920
* BinaryData and StringData are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for BinaryData is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use `mixed = bin('xyz')` or `mixed = binary('xyz')`. ([6407](https://github.com/realm/realm-core/issues/6407)).
2021
* In the C API, `realm_collection_changes_get_num_changes` and `realm_dictionary_get_changes` have got an extra parameter to receive information on the deletion of the entire collection.
22+
* Sorting order of strings has changed to use standard unicode codepoint order instead of grouping similar english letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". ([2573](https://github.com/realm/realm-core/issues/2573))
2123

2224
### Compatibility
2325
* Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10. If you want to upgrade from an earlier file format version you will have to use RealmCore v13.x.y or earlier.
@@ -29,6 +31,106 @@
2931

3032
----------------------------------------------
3133

34+
# 13.23.2 Release notes
35+
36+
### Enhancements
37+
* None.
38+
39+
### Fixed
40+
* Deleting an object in an asymmetric table would cause a crash. Likely to solve [#1537](https://github.com/realm/realm-kotlin/issues/1537), since v12.1.0.
41+
* Implement BIO_CTRL_GET_KTLS_SEND and BIO_CTRL_GET_KTLS_RECV as OpenSSL versions < 3.0.4 depend on it.
42+
43+
### Breaking changes
44+
* Added separate enum for callback handler result values in the platform networking C API. ([PR #7015](https://github.com/realm/realm-core/pull/7015))
45+
* Platform networking CAPI now uses different callback types depending on where callback is used. ([PR #7015](https://github.com/realm/realm-core/pull/7015))
46+
47+
### Compatibility
48+
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
49+
50+
-----------
51+
52+
### Internals
53+
* Update JSON library from 3.7.3 to 3.11.2.
54+
* Updated async_write_binary in the Default Socket Provider to properly return a status to the callback handler. ([PR #7015](https://github.com/realm/realm-core/pull/7015))
55+
56+
----------------------------------------------
57+
58+
# 13.23.1 Release notes
59+
60+
### Enhancements
61+
* Empty commits no longer trigger an extra invocation of the sync progress handler reporting the exact same information as the previous invocation ([PR #7031](https://github.com/realm/realm-core/pull/7031)).
62+
63+
### Fixed
64+
* `SyncManager::path_for_realm()` would return `/<path>/filename.realm.realm` if `custom_file_name` was set to `filename.realm` and the file didn't exist. It would correctly return `/<path>/filename.realm` if the file already existed. After this fix `/<path>/filename.realm` is returned in all cases. ([#7038](https://github.com/realm/realm-core/issues/7038))
65+
* Fixed a bug preventing SSL handshake from completing successfuly due to failed hostname verification when linking against BoringSSL. (PR [#7034](https://github.com/realm/realm-core/pull/7034))
66+
* Updating subscriptions did not trigger Realm autorefreshes, sometimes resulting in async refresh hanging until another write was performed by something else ([PR #7031](https://github.com/realm/realm-core/pull/7031)).
67+
* Fix interprocess locking for concurrent realm file access resulting in a interprocess deadlock on FAT32/exFAT filesystems ([PR #6959](https://github.com/realm/realm-core/pull/6959)).
68+
69+
### Breaking changes
70+
* None.
71+
72+
### Compatibility
73+
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
74+
75+
-----------
76+
77+
### Internals
78+
* None.
79+
80+
----------------------------------------------
81+
82+
# 13.23.0 Release notes
83+
84+
### Enhancements
85+
* Allow collections of non-embedded links in asymmetric objects. ([PR #7003](https://github.com/realm/realm-core/pull/7003))
86+
* Flexible sync API improvements:
87+
- Erase Subscriptions by class type for C API.
88+
- `MutableSubscriptionSet::erase(iterator)` now runs in constant time.
89+
- Introduce `MutableSubscriptionSet::erase_by_id()`.
90+
- Introduce `MutableSubscriptionSet::erase_by_class_name()`.
91+
([PR #7008](https://github.com/realm/realm-core/pull/7008))
92+
* Filtering by user-defined functions (PR [#7020](https://github.com/realm/realm-core/pull/7020))
93+
94+
### Fixed
95+
* Fixed an issue where Android.bp builds would fail with SSL certificate validation errors because we didn't include the trusted CA roots bundle. (PR [#7022](https://github.com/realm/realm-core/pull/7022))
96+
97+
### Breaking changes
98+
* None.
99+
100+
### Compatibility
101+
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
102+
103+
-----------
104+
105+
### Internals
106+
* Update tests to use global logger. ([PR #6917](https://github.com/realm/realm-core/pull/6917))
107+
* TableView::get_num_results_excluded_by_limit() has been removed. Hopefully not used by any SDK.
108+
* bindgen is now part of the release
109+
110+
----------------------------------------------
111+
112+
# 13.22.0 Release notes
113+
114+
### Enhancements
115+
* None.
116+
117+
### Fixed
118+
* Fixed issue with double delete when using the CAPI for timers in platform networking ([#6993](https://github.com/realm/realm-core/issues/6993), since v13.3.0).
119+
* Receiving a write_not_allowed error from the server would have led to a crash. ([#6978](https://github.com/realm/realm-core/issues/6978), since v13.2.0)
120+
121+
### Breaking changes
122+
* Platform Networking CAPI has been updated to provide separate functions (instead of 1) for executing callback handlers depending on purpose ([PR #6994](https://github.com/realm/realm-core/pull/6994)).
123+
124+
### Compatibility
125+
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
126+
127+
-----------
128+
129+
### Internals
130+
* None.
131+
132+
----------------------------------------------
133+
32134
# 13.21.0 Release notes
33135

34136
### Enhancements

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ if(REALM_NEEDS_OPENSSL OR REALM_FORCE_OPENSSL)
285285
set(OPENSSL_USE_STATIC_LIBS ON)
286286
find_package(OpenSSL REQUIRED)
287287
set(REALM_HAVE_OPENSSL ON)
288-
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" OPENSSL_VERSION_MAJOR_MINOR ${OPENSSL_VERSION})
288+
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" OPENSSL_VERSION_MAJOR_MINOR "${OPENSSL_VERSION}")
289289
elseif(APPLE)
290290
set(REALM_HAVE_SECURE_TRANSPORT "1")
291291
endif()
@@ -331,6 +331,7 @@ include_directories(src)
331331
include_directories(${CMAKE_CURRENT_BINARY_DIR}/src) # For generated files (like config.h)
332332

333333
add_subdirectory(src)
334+
add_subdirectory(bindgen)
334335

335336
# Install the licence and changelog files
336337
install(FILES LICENSE CHANGELOG.md DESTINATION "doc/realm" COMPONENT devel)

Package.swift

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import PackageDescription
44
import Foundation
55

6-
let versionStr = "13.21.0"
6+
let versionStr = "13.23.2"
77
let versionPieces = versionStr.split(separator: "-")
88
let versionCompontents = versionPieces[0].split(separator: ".")
99
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
@@ -16,7 +16,7 @@ var cxxSettings: [CXXSetting] = [
1616
.define("REALM_ENABLE_ASSERTIONS", to: "1"),
1717
.define("REALM_ENABLE_ENCRYPTION", to: "1"),
1818
.define("REALM_ENABLE_SYNC", to: "1"),
19-
.define("REALM_ENABLE_GEOSPATIAL", to: "0"),
19+
.define("REALM_ENABLE_GEOSPATIAL", to: "1"),
2020

2121
.define("REALM_VERSION_MAJOR", to: String(versionCompontents[0])),
2222
.define("REALM_VERSION_MINOR", to: String(versionCompontents[1])),
@@ -64,7 +64,6 @@ let notSyncServerSources: [String] = [
6464
"realm/cluster.cpp",
6565
"realm/cluster_tree.cpp",
6666
"realm/collection.cpp",
67-
"realm/collection_list.cpp",
6867
"realm/collection_parent.cpp",
6968
"realm/column_binary.cpp",
7069
"realm/db.cpp",
@@ -73,6 +72,7 @@ let notSyncServerSources: [String] = [
7372
"realm/disable_sync_to_disk.cpp",
7473
"realm/error_codes.cpp",
7574
"realm/exceptions.cpp",
75+
"realm/geospatial.cpp",
7676
"realm/global_key.cpp",
7777
"realm/group.cpp",
7878
"realm/group_writer.cpp",
@@ -397,14 +397,13 @@ let package = Package(
397397
] + cxxSettings) as [CXXSetting]),
398398
.target(
399399
name: "RealmCore",
400-
dependencies: ["Bid"],
400+
dependencies: ["Bid", "s2geometry"],
401401
path: "src",
402402
exclude: ([
403403
"CMakeLists.txt",
404404
"external",
405405
"realm/CMakeLists.txt",
406406
"realm/exec",
407-
"realm/geospatial.cpp",
408407
"realm/object-store/CMakeLists.txt",
409408
"realm/object-store/c_api",
410409
"realm/object-store/impl/epoll",

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<p align="right">
2+
<a href='https://github.com/realm/realm-core/releases'><img src='https://img.shields.io/github/v/release/realm/realm-core' alt='Latest Release' /></a>
3+
<a href='https://coveralls.io/github/realm/realm-core'><img src='https://coveralls.io/repos/github/realm/realm-core/badge.svg' alt='Coverage Status' /></a>
4+
<a href='https://github.com/realm/realm-core'><img src='https://img.shields.io/github/license/realm/realm-core' alt='Source License' /></a>
5+
</p>
6+
17
![Realm](doc/logo.png)
28

39
Realm is a mobile database that runs directly inside phones, tablets or wearables - check out [realm.io](https://realm.io).

bindgen/.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
realm-bindgen.ts

bindgen/.eslintrc.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"extends": [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:prettier/recommended"
8+
],
9+
"rules": {
10+
"@typescript-eslint/explicit-function-return-type": "off",
11+
"no-case-declarations": "off"
12+
},
13+
"env": {
14+
"node": true
15+
}
16+
}

bindgen/.mocharc.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"loader": "tsx",
3+
"enable-source-maps": true,
4+
"no-warnings": true,
5+
"spec": "src/tests/*.test.ts"
6+
}

bindgen/.prettierrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
trailingComma: all
2+
printWidth: 120

bindgen/CMakeLists.txt

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
file(GLOB_RECURSE BINDGEN_LIB_TS_FILES
2+
LIST_DIRECTORIES false
3+
CONFIGURE_DEPENDS
4+
${CMAKE_CURRENT_SOURCE_DIR}/src/*.ts
5+
)
6+
list(FILTER BINDGEN_LIB_TS_FILES EXCLUDE REGEX "tests/[^/]*\.ts$")
7+
8+
# Ninja buffers output so we need to tell tools to use colors even though stdout isn't a tty.
9+
if(CMAKE_GENERATOR MATCHES "^Ninja")
10+
set(NODE_FORCE_COLOR ${CMAKE_COMMAND} -E env FORCE_COLOR=1)
11+
endif()
12+
set(NPX ${NODE_FORCE_COLOR} npx --prefix .) # without a prefix, npx changes the current directory and that is really confusing and hard to debug
13+
14+
# This path is hard coded in the reader, and referred to in the specs to inform yaml-language-server of the schema
15+
set(SCHEMA_FILE ${CMAKE_CURRENT_SOURCE_DIR}/generated/spec.schema.json)
16+
add_custom_command(
17+
OUTPUT ${SCHEMA_FILE}
18+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
19+
COMMAND ${NPX} typescript-json-schema ${CMAKE_CURRENT_SOURCE_DIR}/tsconfig.json RelaxedSpec --include ${CMAKE_CURRENT_SOURCE_DIR}/src/spec/relaxed-model.ts --out ${SCHEMA_FILE} --required --noExtraProps --aliasRefs
20+
VERBATIM
21+
MAIN_DEPENDENCY src/spec/relaxed-model.ts
22+
DEPENDS
23+
# Note: The json-schema generation task is extremely slow so we don't want to rerun it any time any TS file is modified.
24+
# Instead we assume that it will only transitively import the listed files.
25+
# (Right now there are no imports)
26+
)
27+
28+
add_custom_target(BindgenSpecJsonSchema DEPENDS ${SCHEMA_FILE})
29+
30+
# Stash these variables as properties so they can be read from the bindgen() function.
31+
# Using the BindgenSpecJsonSchema target for scoping, not because it actually has anything to do with that.
32+
set_property(TARGET BindgenSpecJsonSchema PROPERTY BINDGEN_LIB_TS_FILES "${BINDGEN_LIB_TS_FILES}")
33+
set_property(TARGET BindgenSpecJsonSchema PROPERTY NPX "${NPX}")
34+
35+
function(bindgen)
36+
set(options)
37+
set(oneValueArgs TEMPLATE OUTDIR OPTIN)
38+
set(multiValueArgs OUTPUTS SPECS SOURCES)
39+
cmake_parse_arguments(PARSE_ARGV 0 BINDGEN "${options}" "${oneValueArgs}" "${multiValueArgs}")
40+
41+
if(BINDGEN_UNPARSED_ARGUMENTS)
42+
message(FATAL_ERROR "Unexpected arguemnts to bindgen()" ${BINDGEN_UNPARSED_ARGUMENTS})
43+
endif()
44+
45+
foreach(ARG TEMPLATE OUTDIR OUTPUTS) # SOURCES and SPECS are optional.
46+
if (NOT BINDGEN_${ARG})
47+
message(FATAL_ERROR "Argument ${ARG} is required to bindgen()")
48+
endif()
49+
endforeach()
50+
51+
# Don't want to set cmake_minimum_required() here because it has other effects and needs to be done early.
52+
# Remove this once https://github.com/realm/realm-core/issues/6537 bumps realm-core's minimum.
53+
if(NOT CMAKE_CURRENT_FUNCTION_LIST_DIR)
54+
message(FATAL_ERROR "bindgen() requires cmake 3.17+")
55+
endif()
56+
57+
get_property(BINDGEN_LIB_TS_FILES TARGET BindgenSpecJsonSchema PROPERTY BINDGEN_LIB_TS_FILES)
58+
get_property(NPX TARGET BindgenSpecJsonSchema PROPERTY NPX)
59+
60+
set(CORE_SPEC_FILE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/spec.yml)
61+
62+
add_custom_command(
63+
OUTPUT ${BINDGEN_OUTPUTS}
64+
WORKING_DIRECTORY ${CMAKE_CURRENT_FUNCTION_LIST_DIR}
65+
COMMAND ${NPX} tsx -- "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/realm-bindgen.ts"
66+
--spec "$<JOIN:${CORE_SPEC_FILE};${BINDGEN_SPECS},;--spec;>"
67+
"$<$<BOOL:${BINDGEN_OPTIN}>:--opt-in;${BINDGEN_OPTIN}>"
68+
--template "${BINDGEN_TEMPLATE}"
69+
--output "${BINDGEN_OUTDIR}"
70+
COMMAND_EXPAND_LISTS
71+
VERBATIM
72+
MAIN_DEPENDENCY ${BINDGEN_TEMPLATE}
73+
DEPENDS
74+
# from bindgen-lib
75+
${CORE_SPEC_FILE}
76+
BindgenSpecJsonSchema
77+
${BINDGEN_LIB_TS_FILES}
78+
79+
# from sdk
80+
${BINDGEN_SPECS}
81+
${BINDGEN_SOURCES}
82+
${BINDGEN_OPTIN}
83+
)
84+
85+
foreach(FILE ${BINDGEN_OUTPUTS})
86+
set_property(SOURCE ${FILE} PROPERTY INCLUDE_DIRECTORIES "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src>")
87+
endforeach()
88+
endfunction()

bindgen/realm-bindgen.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env -S npx tsx --
2+
import { program } from "./src/program";
3+
program.parse(process.argv);

0 commit comments

Comments
 (0)