diff --git a/.clang-format b/.clang-format
index 6562bcd597f..f62fb6dce57 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,19 +1,19 @@
---
-# Don't try to format any languages not described by this file
-DisableFormat: true
-BasedOnStyle: LLVM
+Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
-AlignConsecutiveMacros: false
-AlignConsecutiveAssignments: false
-AlignConsecutiveDeclarations: false
+AlignArrayOfStructures: None
+AlignConsecutiveMacros: None
+AlignConsecutiveAssignments: None
+AlignConsecutiveBitFields: None
+AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
-AlignOperands: true
+AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
-AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortEnumsOnASingleLine: true
+AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Empty
@@ -23,12 +23,14 @@ AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
+AttributeMacros:
+ - __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
- AfterControlStatement: false
+ AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
@@ -38,27 +40,39 @@ BraceWrapping:
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
+ BeforeLambdaBody: false
+ BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
+BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 118
CommentPragmas: '^ IWYU pragma:'
+QualifierAlignment: Leave
CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
+DeriveLineEnding: true
DerivePointerAlignment: false
+DisableFormat: false
+EmptyLineAfterAccessModifier: Never
+EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
+PackConstructorInitializers: BinPack
+BasedOnStyle: ''
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: true
ForEachMacros:
- foreach
@@ -68,68 +82,114 @@ ForEachMacros:
- TEST_CASE
- DYNAMIC_SECTION
- BENCHMARK
+IfMacros:
+ - KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
+ SortPriority: 0
+ CaseSensitive: false
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
+ SortPriority: 0
+ CaseSensitive: false
- Regex: '.*'
Priority: 1
+ SortPriority: 0
+ CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
+IncludeIsMainSourceRegex: ''
+IndentAccessModifiers: false
IndentCaseLabels: true
+IndentCaseBlocks: false
+IndentGotoLabels: true
IndentPPDirectives: None
+IndentExternBlock: AfterExternBlock
+IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
+InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
+LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
+ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
+PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
PointerAlignment: Left
+PPIndentWidth: -1
+ReferenceAlignment: Left
ReflowComments: true
-SortIncludes: false
-SortUsingDeclarations: true
+RemoveBracesLLVM: false
+SeparateDefinitionBlocks: Leave
+ShortNamespaceLines: 1
+SortIncludes: Never
+SortJavaStaticImport: Before
+SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
-SpaceBeforeParens: ControlStatementsExceptForEachMacros
+SpaceBeforeParens: ControlStatementsExceptControlMacros
+SpaceBeforeParensOptions:
+ AfterControlStatements: true
+ AfterForeachMacros: false
+ AfterFunctionDefinitionName: false
+ AfterFunctionDeclarationName: false
+ AfterIfMacros: false
+ AfterOverloadedOperator: false
+ BeforeNonEmptyParentheses: false
+SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
+SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
+SpacesInAngles: Never
+SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
+SpacesInLineCommentPrefix:
+ Minimum: 1
+ Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
-Standard: Cpp11
+SpaceBeforeSquareBrackets: false
+BitFieldColonSpacing: Both
+Standard: Latest
+StatementAttributeLikeMacros:
+ - Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
+UseCRLF: false
UseTab: Never
----
-Language: Cpp
-DisableFormat: false
----
-Language: ObjC
-DisableFormat: false
+WhitespaceSensitiveMacros:
+ - STRINGIZE
+ - PP_STRINGIZE
+ - BOOST_PP_STRINGIZE
+ - NS_SWIFT_NAME
+ - CF_SWIFT_NAME
...
+
diff --git a/.project b/.project
index 48555f2457f..ae4d3317790 100644
--- a/.project
+++ b/.project
@@ -25,15 +25,6 @@
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
-
- 1684928805201
- external
- 30
-
- org.eclipse.ui.ide.multiFilter
- 1.0-name-matches-false-false-catch
-
-
1684928848403
src/external
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31c6d9b9572..bd6304f6b54 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,7 @@
* Fixed an issue during a subsequent open of an encrypted Realm for some rare allocation patterns when the top ref was within ~50 bytes of the end of a page. This could manifest as a DecryptionFailed exception or as an assertion: `encrypted_file_mapping.hpp:183: Assertion failed: local_ndx < m_page_state.size()`. ([#7319](https://github.com/realm/realm-core/issues/7319))
* Non-streaming download sync progress notification is fixed for flexible sync Realms where before it was sometimes stopping to emit values right after the registration of the callback (PR [#7561](https://github.com/realm/realm-core/issues/7561)).
* Schema initialization could hit an assertion failure if the sync client applied a downloaded changeset while the Realm file was in the process of being opened ([#7041](https://github.com/realm/realm-core/issues/7041), since v11.4.0).
+* Queries using query paths on Mixed values returns inconsistent results ([#7587](https://github.com/realm/realm-core/issues/7587), since v14.0.0)
* Fix client reset failure during sync migration due to previous incomplete client reset. ([PR #7542](https://github.com/realm/realm-core/pull/7542), since v13.11.0)
### Breaking changes
@@ -58,6 +59,8 @@
* Sha-2 is no longer required as a submodule on Windows if linking with OpenSSL.
* The Catch2 submodule has moved to `test/external/catch`.
* Fix possible file corruption if using Transaction::copy_to if nested collections are present.
+* Evergreen config was udpated so most linux CI testing is done on ubuntu 22.04 on aarch64 with clang 18, upgrading from clang 11 on ubuntu 20.04 mostly on x86_64 ([PR #7475](https://github.com/realm/realm-core/pull/7475)).
+* Evergreen config was updated to move most MacOS testing to MacOS 14 on arm64 with Xcode 15.2, updating from Macos 11 on x86_64 with Xcode 13.1 ([PR #7618](https://github.com/realm/realm-core/pull/7618)).
----------------------------------------------
@@ -92,6 +95,7 @@
### Enhancements
* Introduce sync 'progress_estimate' parameter (value from 0.0 to 1.0) for existing sync 'ProgressNotifierCallback' api to report sync progress on current batch of upload/download until completion ([#7450](https://github.com/realm/realm-core/issues/7450))
+* Support assigning nested collections via templated API (PR [#7478](https://github.com/realm/realm-core/pull/7478))
### Fixed
* Fix an assertion failure "m_lock_info && m_lock_info->m_file.get_path() == m_filename" that appears to be related to opening a Realm while the file is in the process of being closed on another thread ([Swift #8507](https://github.com/realm/realm-swift/issues/8507)).
diff --git a/Visual Studio/uwp_demo/App.xaml b/Visual Studio/uwp_demo/App.xaml
deleted file mode 100644
index 6ebc1f22b7b..00000000000
--- a/Visual Studio/uwp_demo/App.xaml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
diff --git a/Visual Studio/uwp_demo/App.xaml.cpp b/Visual Studio/uwp_demo/App.xaml.cpp
deleted file mode 100644
index 2a87f84243a..00000000000
--- a/Visual Studio/uwp_demo/App.xaml.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// App.xaml.cpp
-// Implementation of the App class.
-//
-
-#include "pch.h"
-#include "MainPage.xaml.h"
-
-#include
-
-using namespace App1;
-
-using namespace Platform;
-using namespace Windows::ApplicationModel;
-using namespace Windows::ApplicationModel::Activation;
-using namespace Windows::Foundation;
-using namespace Windows::Foundation::Collections;
-using namespace Windows::UI::Xaml;
-using namespace Windows::UI::Xaml::Controls;
-using namespace Windows::UI::Xaml::Controls::Primitives;
-using namespace Windows::UI::Xaml::Data;
-using namespace Windows::UI::Xaml::Input;
-using namespace Windows::UI::Xaml::Interop;
-using namespace Windows::UI::Xaml::Media;
-using namespace Windows::UI::Xaml::Navigation;
-
-///
-/// Initializes the singleton application object. This is the first line of authored code
-/// executed, and as such is the logical equivalent of main() or WinMain().
-///
-App::App()
-{
- InitializeComponent();
- Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
-}
-
-///
-/// Invoked when the application is launched normally by the end user. Other entry points
-/// will be used such as when the application is launched to open a specific file.
-///
-/// Details about the launch request and process.
-void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e)
-{
- using namespace realm;
- using namespace std;
-
- {
- Table t;
- t.add_column(type_Int, "ints");
- t.add_empty_row();
- t.set_int(0, 0, 123);
- int64_t i = t.get_int(0, 0);
- }
-
- // For ARM, only Release mode is currently configured. Build Core in ARM Release mode too.
-
- // Enable when you have specified a valid tempdir for the target machine, else it will crash
- /*
- {
- SharedGroupOptions sgo = SharedGroupOptions(SharedGroupOptions::Durability::Full, nullptr, false, std::function(), "tempdir");
- SharedGroup sg_w("test.realm", false, sgo);
- WriteTransaction wt(sg_w);
- TableRef t = wt.add_table("table");
- size_t col_ndx = t->add_column(type_String, "column");
- t->add_empty_row(1);
- t->set_string(col_ndx, 0, StringData("string"));
- }
- */
-
-#if _DEBUG
- // Show graphics profiling information while debugging.
- if (IsDebuggerPresent())
- {
- // Display the current frame rate counters
- DebugSettings->EnableFrameRateCounter = true;
- }
-#endif
- auto rootFrame = dynamic_cast(Window::Current->Content);
-
- // Do not repeat app initialization when the Window already has content,
- // just ensure that the window is active
- if (rootFrame == nullptr)
- {
- // Create a Frame to act as the navigation context and associate it with
- // a SuspensionManager key
- rootFrame = ref new Frame();
-
- rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed);
-
- if (e->PreviousExecutionState == ApplicationExecutionState::Terminated)
- {
- // TODO: Restore the saved session state only when appropriate, scheduling the
- // final launch steps after the restore is complete
-
- }
-
- if (e->PrelaunchActivated == false)
- {
- if (rootFrame->Content == nullptr)
- {
- // When the navigation stack isn't restored navigate to the first page,
- // configuring the new page by passing required information as a navigation
- // parameter
- rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
- }
- // Place the frame in the current Window
- Window::Current->Content = rootFrame;
- // Ensure the current window is active
- Window::Current->Activate();
- }
- }
- else
- {
- if (e->PrelaunchActivated == false)
- {
- if (rootFrame->Content == nullptr)
- {
- // When the navigation stack isn't restored navigate to the first page,
- // configuring the new page by passing required information as a navigation
- // parameter
- rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
- }
- // Ensure the current window is active
- Window::Current->Activate();
- }
- }
-}
-
-///
-/// Invoked when application execution is being suspended. Application state is saved
-/// without knowing whether the application will be terminated or resumed with the contents
-/// of memory still intact.
-///
-/// The source of the suspend request.
-/// Details about the suspend request.
-void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)
-{
- (void) sender; // Unused parameter
- (void) e; // Unused parameter
-
- //TODO: Save application state and stop any background activity
-}
-
-///
-/// Invoked when Navigation to a certain page fails
-///
-/// The Frame which failed navigation
-/// Details about the navigation failure
-void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e)
-{
- throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name);
-}
\ No newline at end of file
diff --git a/Visual Studio/uwp_demo/App.xaml.h b/Visual Studio/uwp_demo/App.xaml.h
deleted file mode 100644
index a2bd4660bdd..00000000000
--- a/Visual Studio/uwp_demo/App.xaml.h
+++ /dev/null
@@ -1,27 +0,0 @@
-//
-// App.xaml.h
-// Declaration of the App class.
-//
-
-#pragma once
-
-#include "App.g.h"
-
-namespace App1
-{
- ///
- /// Provides application-specific behavior to supplement the default Application class.
- ///
- ref class App sealed
- {
- protected:
- virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
-
- internal:
- App();
-
- private:
- void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
- void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
- };
-}
diff --git a/Visual Studio/uwp_demo/App1.sln b/Visual Studio/uwp_demo/App1.sln
deleted file mode 100644
index 1d6736d7750..00000000000
--- a/Visual Studio/uwp_demo/App1.sln
+++ /dev/null
@@ -1,40 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26020.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "App1", "App1.vcxproj", "{2E10CEC7-325B-4EE0-917F-42C442BBC188}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|ARM = Debug|ARM
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|ARM = Release|ARM
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|ARM.ActiveCfg = Debug|ARM
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|ARM.Build.0 = Debug|ARM
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|ARM.Deploy.0 = Debug|ARM
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|Win32.ActiveCfg = Debug|Win32
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|Win32.Build.0 = Debug|Win32
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|Win32.Deploy.0 = Debug|Win32
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|x64.ActiveCfg = Debug|x64
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|x64.Build.0 = Debug|x64
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Debug|x64.Deploy.0 = Debug|x64
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|ARM.ActiveCfg = Release|ARM
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|ARM.Build.0 = Release|ARM
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|ARM.Deploy.0 = Release|ARM
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|Win32.ActiveCfg = Release|Win32
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|Win32.Build.0 = Release|Win32
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|Win32.Deploy.0 = Release|Win32
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|x64.ActiveCfg = Release|x64
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|x64.Build.0 = Release|x64
- {2E10CEC7-325B-4EE0-917F-42C442BBC188}.Release|x64.Deploy.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Visual Studio/uwp_demo/App1.vcxproj b/Visual Studio/uwp_demo/App1.vcxproj
deleted file mode 100644
index e9cb9256faa..00000000000
--- a/Visual Studio/uwp_demo/App1.vcxproj
+++ /dev/null
@@ -1,224 +0,0 @@
-
-
-
- {2e10cec7-325b-4ee0-917f-42c442bbc188}
- App1
- en-US
- 14.0
- true
- Windows Store
- 10.0.10586.0
- 10.0.10240.0
- 10.0
-
-
-
-
- Debug
- ARM
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- ARM
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- Application
- true
- v141
-
-
- Application
- true
- v141
-
-
- Application
- true
- v141
-
-
- Application
- false
- v141
-
-
- Application
- false
- v141
-
-
- Application
- false
- v141
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- App1_TemporaryKey.pfx
- True
- Always
- arm
-
-
-
- /bigobj -D_SCL_SECURE_NO_WARNINGS %(AdditionalOptions)
- 4453;28204
- $(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories); ..\..\..\realm-core\src
-
-
- "..\..\..\realm-core\Visual Studio\lib\Realm UWP Debug static lib x64.lib" %(AdditionalOptions)
-
-
-
-
- /bigobj -D_SCL_SECURE_NO_WARNINGS %(AdditionalOptions)
- 4453;28204
- $(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories); ..\..\..\realm-core\src
-
-
- "..\..\..\realm-core\Visual Studio\lib\Realm UWP Debug static lib x64.lib" %(AdditionalOptions)
-
-
-
-
- /bigobj -D_SCL_SECURE_NO_WARNINGS %(AdditionalOptions)
- 4453;28204
- $(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories); ..\..\..\realm-core\src
-
-
- "..\..\..\realm-core\Visual Studio\lib\Realm UWP Debug static lib x64.lib" %(AdditionalOptions)
-
-
-
-
- /bigobj %(AdditionalOptions)
- 4453;28204
- $(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories); ..\..\..\realm-core\src
- Default
- MultiThreadedDLL
- MaxSpeed
-
-
-
- "C:\D\realm-core\Visual Studio\lib\Realm UWP Release static lib x64.lib" %(AdditionalOptions)
-
-
-
-
- /bigobj %(AdditionalOptions)
- 4453;28204
- $(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories); ..\..\..\realm-core\src
- Default
- MultiThreadedDLL
- MaxSpeed
-
-
-
-
- "..\..\..\realm-core\Visual Studio\ARM\UWP Release static lib\Realm\Realm UWP Release static lib ARM.lib" %(AdditionalOptions)
-
-
-
-
- /bigobj %(AdditionalOptions)
- 4453;28204
- $(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories); ..\..\..\realm-core\src
- Default
- MultiThreadedDLL
- MaxSpeed
-
-
-
-
- "..\..\..\realm-core\Visual Studio\lib\Realm UWP Release static lib x64.lib" %(AdditionalOptions)
-
-
-
-
-
- App.xaml
-
-
- MainPage.xaml
-
-
-
-
- Designer
-
-
- Designer
-
-
-
-
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- App.xaml
-
-
- MainPage.xaml
-
-
- Create
- Create
- Create
- Create
- Create
- Create
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Visual Studio/uwp_demo/App1.vcxproj.filters b/Visual Studio/uwp_demo/App1.vcxproj.filters
deleted file mode 100644
index 7a6117afeda..00000000000
--- a/Visual Studio/uwp_demo/App1.vcxproj.filters
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
- 2e10cec7-325b-4ee0-917f-42c442bbc188
-
-
- 49d2eb57-246d-4aa4-850e-1ba48992da82
- bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Assets
-
-
- Assets
-
-
- Assets
-
-
- Assets
-
-
- Assets
-
-
- Assets
-
-
- Assets
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Visual Studio/uwp_demo/App1_TemporaryKey.pfx b/Visual Studio/uwp_demo/App1_TemporaryKey.pfx
deleted file mode 100644
index f76bba2f176..00000000000
Binary files a/Visual Studio/uwp_demo/App1_TemporaryKey.pfx and /dev/null differ
diff --git a/Visual Studio/uwp_demo/Assets/LockScreenLogo.scale-200.png b/Visual Studio/uwp_demo/Assets/LockScreenLogo.scale-200.png
deleted file mode 100644
index 735f57adb5d..00000000000
Binary files a/Visual Studio/uwp_demo/Assets/LockScreenLogo.scale-200.png and /dev/null differ
diff --git a/Visual Studio/uwp_demo/Assets/SplashScreen.scale-200.png b/Visual Studio/uwp_demo/Assets/SplashScreen.scale-200.png
deleted file mode 100644
index 023e7f1feda..00000000000
Binary files a/Visual Studio/uwp_demo/Assets/SplashScreen.scale-200.png and /dev/null differ
diff --git a/Visual Studio/uwp_demo/Assets/Square150x150Logo.scale-200.png b/Visual Studio/uwp_demo/Assets/Square150x150Logo.scale-200.png
deleted file mode 100644
index af49fec1a54..00000000000
Binary files a/Visual Studio/uwp_demo/Assets/Square150x150Logo.scale-200.png and /dev/null differ
diff --git a/Visual Studio/uwp_demo/Assets/Square44x44Logo.scale-200.png b/Visual Studio/uwp_demo/Assets/Square44x44Logo.scale-200.png
deleted file mode 100644
index ce342a2ec8a..00000000000
Binary files a/Visual Studio/uwp_demo/Assets/Square44x44Logo.scale-200.png and /dev/null differ
diff --git a/Visual Studio/uwp_demo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Visual Studio/uwp_demo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
deleted file mode 100644
index f6c02ce97e0..00000000000
Binary files a/Visual Studio/uwp_demo/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ
diff --git a/Visual Studio/uwp_demo/Assets/StoreLogo.png b/Visual Studio/uwp_demo/Assets/StoreLogo.png
deleted file mode 100644
index 7385b56c0e4..00000000000
Binary files a/Visual Studio/uwp_demo/Assets/StoreLogo.png and /dev/null differ
diff --git a/Visual Studio/uwp_demo/Assets/Wide310x150Logo.scale-200.png b/Visual Studio/uwp_demo/Assets/Wide310x150Logo.scale-200.png
deleted file mode 100644
index 288995b397f..00000000000
Binary files a/Visual Studio/uwp_demo/Assets/Wide310x150Logo.scale-200.png and /dev/null differ
diff --git a/Visual Studio/uwp_demo/MainPage.xaml b/Visual Studio/uwp_demo/MainPage.xaml
deleted file mode 100644
index 262743bf579..00000000000
--- a/Visual Studio/uwp_demo/MainPage.xaml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/Visual Studio/uwp_demo/MainPage.xaml.cpp b/Visual Studio/uwp_demo/MainPage.xaml.cpp
deleted file mode 100644
index 6e975ce14b7..00000000000
--- a/Visual Studio/uwp_demo/MainPage.xaml.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// MainPage.xaml.cpp
-// Implementation of the MainPage class.
-//
-
-#include "pch.h"
-#include "MainPage.xaml.h"
-#include "realm.hpp"
-using namespace App1;
-using namespace realm;
-
-using namespace Platform;
-using namespace Windows::Foundation;
-using namespace Windows::Foundation::Collections;
-using namespace Windows::UI::Xaml;
-using namespace Windows::UI::Xaml::Controls;
-using namespace Windows::UI::Xaml::Controls::Primitives;
-using namespace Windows::UI::Xaml::Data;
-using namespace Windows::UI::Xaml::Input;
-using namespace Windows::UI::Xaml::Media;
-using namespace Windows::UI::Xaml::Navigation;
-
-// For ARM, only Release mode is currently configured. Build Core in ARM Release mode too.
-
-Table* tbl = nullptr;
-
-MainPage::MainPage()
-{
- InitializeComponent();
-}
-
-void App1::MainPage::Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
-{
- if(!tbl) {
- tbl = new Table();
- tbl->add_column(type_String, "strings");
- tbl->add_empty_row();
- }
-
- Platform::String^ ps = MyTextBox->Text;
- std::wstring ws = ps->Data();
- StringData sd((char*)ws.data(), ws.size()*sizeof(wchar_t));
- tbl->set_string(0, 0, sd);
-
-}
-
-
-void App1::MainPage::TextBlock_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
-{
-
-}
-
-
-void App1::MainPage::Button_Click_1(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
-{
- StringData sd = tbl->get_string(0, 0);
- std::wstring s = std::wstring((wchar_t*)sd.data());
- Platform::String^ ps = ref new Platform::String(s.c_str());
- MyTextBlock->Text = ps;
-}
diff --git a/Visual Studio/uwp_demo/MainPage.xaml.h b/Visual Studio/uwp_demo/MainPage.xaml.h
deleted file mode 100644
index 362362aa82a..00000000000
--- a/Visual Studio/uwp_demo/MainPage.xaml.h
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// MainPage.xaml.h
-// Declaration of the MainPage class.
-//
-
-#pragma once
-
-#include "MainPage.g.h"
-
-namespace App1
-{
- ///
- /// An empty page that can be used on its own or navigated to within a Frame.
- ///
- public ref class MainPage sealed
- {
- public:
- MainPage();
-
- private:
- void Button_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
- void TextBlock_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
- void Button_Click_1(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
- };
-}
diff --git a/Visual Studio/uwp_demo/Package.appxmanifest b/Visual Studio/uwp_demo/Package.appxmanifest
deleted file mode 100644
index 9c14f9dd4c4..00000000000
--- a/Visual Studio/uwp_demo/Package.appxmanifest
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
- App1
- me
- Assets\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Visual Studio/uwp_demo/pch.cpp b/Visual Studio/uwp_demo/pch.cpp
deleted file mode 100644
index f3963b9b14c..00000000000
--- a/Visual Studio/uwp_demo/pch.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-//
-// pch.cpp
-// Include the standard header and generate the precompiled header.
-//
-
-#include "pch.h"
diff --git a/Visual Studio/uwp_demo/pch.h b/Visual Studio/uwp_demo/pch.h
deleted file mode 100644
index 5a9b86c7baf..00000000000
--- a/Visual Studio/uwp_demo/pch.h
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// pch.h
-// Header for standard system include files.
-//
-
-#pragma once
-
-#include
-#include
-
-#include "App.xaml.h"
diff --git a/bindgen/spec.yml b/bindgen/spec.yml
index 76284e08fa7..d874d6a9929 100644
--- a/bindgen/spec.yml
+++ b/bindgen/spec.yml
@@ -19,6 +19,7 @@ headers:
- "realm/object-store/sync/app.hpp"
- "realm/object-store/sync/sync_manager.hpp"
- "realm/object-store/sync/sync_session.hpp"
+ - "realm/object-store/sync/app_user.hpp"
- "realm/object-store/sync/sync_user.hpp"
- "realm/object-store/sync/mongo_collection.hpp"
- "realm/util/bson/bson.hpp"
@@ -231,7 +232,7 @@ enums:
values:
- NoEncryption
- Encryption
- - NoMetadata
+ - InMemory
LoggerLevel:
cppName: util::Logger::Level
@@ -301,7 +302,7 @@ enums:
- download
SyncUserState:
- cppName: UserState
+ cppName: SyncUser::State
values:
- LoggedOut
- LoggedIn
@@ -1215,12 +1216,12 @@ classes:
state: SyncUserState
sync_manager: SharedSyncManager
methods:
- access_token_refresh_required: bool
- request_log_out: '(cb: AsyncCallback<(err: std::optional)>&&)'
+ access_token_refresh_required: '() -> bool'
+# request_log_out: '(cb: AsyncCallback<(err: std::optional)>&&)'
request_refresh_user: '(cb: AsyncCallback<(err: std::optional)>&&)'
request_refresh_location: '(cb: AsyncCallback<(err: std::optional)>&&)'
request_access_token: '(cb: AsyncCallback<(err: std::optional)>&&)'
- track_realm: '(std::string_view)'
+ track_realm: '(path: std::string_view)'
create_file_action: '(action: SyncFileAction, original_path: std::string_view, requested_recovery_dir: std::optional, partition_value: std::string_view) -> std::string'
User:
@@ -1238,8 +1239,9 @@ classes:
app: SharedApp
methods:
log_out: ()
- subscribe: '(observer: (user: IgnoreArgument)) -> UserSubscriptionToken'
+ subscribe: '(observer: (user: IgnoreArgument)) -> UserSubscriptionToken'
unsubscribe: '(token: UserSubscriptionToken)'
+ path_for_realm: '(config: SyncConfig&, custom_file_name: std::optional&) -> std::string'
UserProfile:
cppName: app::UserProfile
@@ -1297,6 +1299,7 @@ classes:
make_streaming_request: '(user: SharedUser, name: std::string, args: bson::BsonArray, service_name: std::optional) -> Request'
update_base_url: '(base_url: std::optional, cb: AsyncCallback<(err: std::optional)>&&)'
get_base_url: '() const -> std::string'
+ immediately_run_file_actions: '(realm_path: std::string) -> bool'
WatchStream:
cppName: app::WatchStream
@@ -1357,7 +1360,7 @@ classes:
set_timeouts: '(timeouts: SyncClientTimeouts)'
reconnect: ()
wait_for_sessions_to_terminate: ()
- get_existing_active_session: '(path: const std::string&) -> SharedSyncSession'
+ get_existing_active_session: '(path: const std::string&) -> Nullable'
get_all_sessions_for: '(user: const SyncUser&) -> std::vector'
ThreadSafeReference: {}
diff --git a/doc/development/coding_style_guide.cpp b/doc/development/coding_style_guide.cpp
index df65db633c1..658fb16402d 100644
--- a/doc/development/coding_style_guide.cpp
+++ b/doc/development/coding_style_guide.cpp
@@ -3,7 +3,7 @@
//
/*
- * The layout of the code is enforced by the use of clang-format - currently in version 3.9. The layout is
+ * The layout of the code is enforced by the use of clang-format - currently in version 16. The layout is
* defined by the .clang-format configuration file in the project root. You can ensure that a code change
* complies with the formatting rules in the following ways:
*
diff --git a/evergreen/config.yml b/evergreen/config.yml
index 2e80eb87f58..2413fafd8e9 100644
--- a/evergreen/config.yml
+++ b/evergreen/config.yml
@@ -23,18 +23,27 @@ functions:
set -o pipefail
set -o verbose
- if [[ "$OS" = "Windows_NT" ]]; then
- curl -LsSo cmake_binaries.zip ${cmake_url}
- unzip -q cmake_binaries.zip
- else
- mkdir cmake_binaries && cd cmake_binaries
- curl -LsS ${cmake_url} | tar -xz --strip-components=1
- cd ..
+ if [[ -n "${cmake_url}" ]]; then
+ if [[ "$OS" = "Windows_NT" ]]; then
+ curl -LsSo cmake_binaries.zip ${cmake_url}
+ unzip -q cmake_binaries.zip
+ else
+ mkdir cmake_binaries && cd cmake_binaries
+ curl -LsS ${cmake_url} | tar -xz --strip-components=1
+ cd ..
+ fi
fi
if [[ -n "${clang_url|}" ]]; then
mkdir clang_binaries && cd clang_binaries
- curl -LsS ${clang_url} | tar -xJ --strip-components=1
+ curl -LsS "${clang_url}" -o clang_binaries.tar.xz
+ computed_sum=$(shasum -a 256 -b clang_binaries.tar.xz | awk '{ print $1 }')
+ if [[ $computed_sum != "${clang_sha256_sum}" ]]; then
+ echo "sha256 checksum mismatch for \"${clang_url}\". got checksum $computed_sum"
+ exit 1
+ fi
+ tar -xJf clang_binaries.tar.xz --strip-components=1
+ rm clang_binaries.tar.xz
cd ..
fi
@@ -63,7 +72,11 @@ functions:
fi
export CMAKE_VARS_DIR=$(./evergreen/abspath.sh cmake_vars)
source evergreen/cmake_vars_utils.sh
- export CMAKE=$(./evergreen/abspath.sh ${cmake_bindir}/cmake)
+ if [ -n "${cmake_bindir|}" ]; then
+ export CMAKE=$(./evergreen/abspath.sh ${cmake_bindir}/cmake)
+ else
+ export CMAKE="cmake"
+ fi
if [ -n "${xcode_developer_dir}" ]; then
export DEVELOPER_DIR="${xcode_developer_dir}"
@@ -173,7 +186,11 @@ functions:
target="--target ${target_to_build|}"
fi
- ${cmake_bindir}/cmake \
+ if [[ -n "${cmake_build_tool_options}" ]]; then
+ target="$target -- ${cmake_build_tool_options}"
+ fi
+
+ $CMAKE \
--build build \
--config ${cmake_build_type|Debug} \
-j ${max_jobs|$(grep -c proc /proc/cpuinfo)} \
@@ -221,7 +238,11 @@ functions:
script: |-
set -o errexit
set -o verbose
- CTEST=$(pwd)/${cmake_bindir}/ctest
+ if [ -n "${cmake_bindir|}" ]; then
+ CTEST=$(./evergreen/abspath.sh ${cmake_bindir}/ctest)
+ else
+ CTEST="ctest"
+ fi
if [ -n "${xcode_developer_dir}" ]; then
export DEVELOPER_DIR="${xcode_developer_dir}"
@@ -256,8 +277,10 @@ functions:
unset BAASAAS_START_MODE
fi
- if [[ -n "${llvm_symbolizer}" ]]; then
- export ASAN_SYMBOLIZER_PATH="$(./evergreen/abspath.sh ${llvm_symbolizer})"
+ if [[ -n "${c_compiler}" && "$(basename ${c_compiler})" = "clang" && -f "$(dirname ${c_compiler})/llvm-symbolizer" ]]; then
+ LLVM_SYMBOLIZER="$(dirname ${c_compiler})/llvm-symbolizer"
+ export ASAN_SYMBOLIZER_PATH="$(./evergreen/abspath.sh $LLVM_SYMBOLIZER)"
+ export TSAN_OPTIONS="external_symbolizer_path=$(./evergreen/abspath.sh $LLVM_SYMBOLIZER)"
fi
if [[ -n "${enable_llvm_coverage}" ]]; then
if [[ -z "${test_executable_name}" ]]; then
@@ -279,16 +302,20 @@ functions:
fi
fi
+ # on later MacOS's the system curl is built against an old version of openssl that
+ # can't talk to baasaas over TLS.
+ if [[ "$(uname -s)" = "Darwin" ]]; then
+ export CURL_SSL_BACKEND=Secure-Transport
+ fi
+
export UNITTEST_EVERGREEN_TEST_RESULTS="$(./evergreen/abspath.sh ${task_name}_results.json)"
if [[ -n "$UNITTEST_EVERGREEN_TEST_RESULTS" && -f "$UNITTEST_EVERGREEN_TEST_RESULTS" ]]; then
rm "$UNITTEST_EVERGREEN_TEST_RESULTS"
fi
export UNITTEST_PROGRESS=1
+ export UNITTEST_ENCRYPT_ALL="${run_with_encryption|0}"
- if [[ -n "${run_with_encryption}" ]]; then
- export UNITTEST_ENCRYPT_ALL=1
- fi
- export TSAN_OPTIONS="suppressions=$(pwd)/test/tsan.suppress history_size=4"
+ export TSAN_OPTIONS="suppressions=$(pwd)/test/tsan.suppress history_size=4 $TSAN_OPTIONS"
export UBSAN_OPTIONS="print_stacktrace=1"
cd build
@@ -715,10 +742,14 @@ tasks:
working_dir: realm-core
script: |-
set -o errexit
- cpack=$(pwd)/${cmake_bindir}/cpack
+ if [[ -n "${cmake_bindir}" ]]; then
+ CPACK="$(./evergreen/abspath.sh ${cmake_bindir}/cpack)"
+ else
+ CPACK="cpack"
+ fi
cd build
- $cpack -C ${cmake_build_type|Debug} -G TGZ -D "CPACK_PACKAGE_FILE_NAME=realm-core-artifacts" ${package_flags|}
+ $CPACK -C ${cmake_build_type|Debug} -G TGZ -D "CPACK_PACKAGE_FILE_NAME=realm-core-artifacts" ${package_flags|}
- command: s3.put
params:
aws_key: '${artifacts_aws_access_key}'
@@ -785,7 +816,7 @@ tasks:
find core/include/realm -name '*.hpp' -print0 | xargs -0 -P "${max_jobs}" -n 1 clang++ -c -o /dev/null -Icore/include -std=c++17
- name: test-on-exfat
- exec_timeout_secs: 2700
+ exec_timeout_secs: 3600
commands:
- func: "fetch source"
- func: "fetch binaries"
@@ -794,6 +825,8 @@ tasks:
params:
working_dir: realm-core/build
shell: /bin/bash
+ env:
+ UNITTEST_ENCRYPT_ALL: "${run_with_encryption|0}"
script: ../tools/run-tests-on-exfat.sh
- name: valgrind
@@ -815,108 +848,6 @@ tasks:
export UNITTEST_THREADS=1
valgrind --tool=memcheck --leak-check=full --undef-value-errors=yes --track-origins=yes --child-silent-after-fork=no --trace-children=yes --suppressions=$(pwd)/../../test/valgrind.suppress --error-exitcode=1 --max-threads=5000 ./RelWithDebInfo/realm-tests
-- name: bloaty
- exec_timeout_secs: 1800
- commands:
- - func: "fetch source"
- - func: "fetch binaries"
- - func: "compile"
- vars:
- target_to_build: RealmFFI
- - command: shell.exec
- params:
- working_dir: realm-core
- shell: /bin/bash
- script: |-
- #!/bin/bash
- set -o errexit
- set -o pipefail
-
- mkdir bloaty-binaries && cd bloaty-binaries
- curl --silent -L ${bloaty_url} | tar -xz --strip-components=1
- BLOATY=$(pwd)/bin/bloaty
- cd ..
-
- FILES_TO_ANALYZE="./build/src/realm/object-store/c_api/${cmake_build_type|Debug}/librealm-ffi.so"
-
- mkdir bloaty-results
- for input_path in $FILES_TO_ANALYZE; do
- input_file=$(basename $input_path)
- $BLOATY -d shortsymbols $input_path -n 0 --csv > "bloaty-results/$input_file-shortsymbols.csv"
- $BLOATY -d sections $input_path -n 0 --csv > "bloaty-results/$input_file-sections.csv"
- $BLOATY -d shortsymbols $input_path -n 0 > "bloaty-results/$input_file-shortsymbols.txt"
- $BLOATY -d sections $input_path -n 0 > "bloaty-results/$input_file-sections.txt"
- $BLOATY -d compileunits $input_path -n 0 > "bloaty-results/$input_file-compileunits.txt"
- $BLOATY -d compileunits $input_path -n 0 --csv > "bloaty-results/$input_file-compileunits.csv"
-
- echo "Bloaty sections output for $input_file"
- head -n 100 "bloaty-results/$input_file-sections.txt"
- echo
- echo "Bloaty compile units output for $input_file"
- head -n 100 "bloaty-results/$input_file-compileunits.txt"
- echo
- echo "Bloaty short symbols output for $input_file"
- head -n 100 "bloaty-results/$input_file-shortsymbols.txt"
-
- ${python3|} ./evergreen/bloaty_to_json.py \
- --short-symbols-input="bloaty-results/$input_file-shortsymbols.csv" \
- --sections-input="bloaty-results/$input_file-sections.csv" \
- --compileunits-input="bloaty-results/$input_file-compileunits.csv" \
- --analyzed-file=$input_file \
- --output "bloaty-results/$input_file-results.json" \
- --project=${project} \
- --execution=${execution} \
- --is-patch=${is_patch} \
- --build-variant=${build_variant} \
- --branch=${branch_name} \
- --revision=${revision} \
- --task-id=${task_id} \
- --task-name=${task_name} \
- --revision-order-id=${revision_order_id} \
- --version-id=${version_id}
-
- # TODO(JBR) This is pointing to a test application for now. When we have charts configured we can create
- # a real realm app to house them and this URL will change.
- curl \
- -H "Content-Type: application/json" \
- -d "@bloaty-results/$input_file-results.json" \
- https://us-east-1.aws.webhooks.mongodb-realm.com/api/client/v2.0/app/application-0-htnkr/service/http1/incoming_webhook/upload_bloaty_results?secret=${bloaty_secret}
- done
-
- - command: s3.put
- params:
- aws_key: '${artifacts_aws_access_key}'
- aws_secret: '${artifacts_aws_secret_key}'
- local_files_include_filter:
- - realm-core/bloaty-results/*.csv
- remote_file: '${project}/${branch_name}/${task_id}/${execution}/bloaty-results-'
- bucket: mciuploads
- permissions: public-read
- content_type: text/csv
- display_name: bloaty-results
- - command: s3.put
- params:
- aws_key: '${artifacts_aws_access_key}'
- aws_secret: '${artifacts_aws_secret_key}'
- local_files_include_filter:
- - realm-core/bloaty-results/*.txt
- remote_file: '${project}/${branch_name}/${task_id}/${execution}/bloaty-results-'
- bucket: mciuploads
- permissions: public-read
- content_type: text/plain
- display_name: bloaty-results
- - command: s3.put
- params:
- aws_key: '${artifacts_aws_access_key}'
- aws_secret: '${artifacts_aws_secret_key}'
- local_files_include_filter:
- - realm-core/bloaty-results/*.json
- remote_file: '${project}/${branch_name}/${task_id}/${execution}/bloaty-results-'
- bucket: mciuploads
- permissions: public-read
- content_type: application/json
- display_name: bloaty-results
-
- name: long-running-core-tests
tags: [ "for_nightly_tests" ]
allowed_requesters: [ "ad_hoc", "patch" ]
@@ -1148,7 +1079,9 @@ tasks:
set -o verbose
set -o errexit
- export PATH=$(./evergreen/abspath.sh ./clang_binaries/bin):$PATH
+ if [[ -n "${clang_format|}" ]]; then
+ export PATH="$(./evergreen/abspath.sh $(dirname ${clang_format}))":$PATH
+ fi
if [[ "${is_patch}" == "true" ]]; then
format_ref="$(git merge-base origin/${branch_name} HEAD)"
@@ -1323,95 +1256,75 @@ task_groups:
- fuzzer
buildvariants:
-- name: ubuntu2004
- display_name: "Ubuntu 20.04 x86_64 (Clang 11)"
- run_on: ubuntu2004-large
+- name: ubuntu
+ display_name: "Ubuntu"
+ run_on: ubuntu2204-arm64-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
fetch_missing_dependencies: On
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
- extra_flags: -DREALM_ENABLE_GEOSPATIAL=OFF # can be removed once SDKs pick this feature up
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
+ clang_format: "/opt/clang+llvm/bin/clang-format"
tasks:
- name: compile_test
+ - name: lint
-
-- name: ubuntu2204
- display_name: "Ubuntu 22.04 x86_64 (Clang 16 + lint)"
- run_on: ubuntu2204-large
+- name: ubuntu-no-session-multiplexing
+ display_name: "Ubuntu (Sync Multiplexing Disabled)"
+ run_on: ubuntu2204-arm64-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-16.0.2-x86_64-linux-gnu-ubuntu-22.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
fetch_missing_dependencies: On
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
+ disable_sync_multiplexing: On
tasks:
- - name: lint
- distros:
- - ubuntu2204-small
- name: compile_test
-- name: ubuntu2004-no-session-multiplexing
- display_name: "Ubuntu 20.04 x86_64 (Sync Multiplexing Disabled)"
- run_on: ubuntu2004-large
+- name: ubuntu-no-geospatial
+ display_name: "Ubuntu (Geospatial Disabled)"
+ run_on: ubuntu2204-arm64-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
fetch_missing_dependencies: On
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
- disable_sync_multiplexing: On
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
+ extra_flags: "-DREALM_ENABLE_GEOSPATIAL=OFF"
tasks:
- name: compile_test
-- name: ubuntu2004-encryption-tsan
- display_name: "Ubuntu 20.04 x86_64 (Clang 11 Encryption Enabled w/TSAN)"
- run_on: ubuntu2004-small
+- name: ubuntu-encryption-tsan
+ display_name: "Ubuntu (Encryption Enabled w/TSAN)"
+ run_on: ubuntu2204-arm64-small
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
fetch_missing_dependencies: On
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
run_with_encryption: On
enable_tsan: On
cmake_build_type: RelWithDebInfo
tasks:
- name: core_tests_group
- distros:
- - ubuntu2004-large
-- name: ubuntu2004-encryption-asan
- display_name: "Ubuntu 20.04 x86_64 (Clang 11 Encryption Enabled w/ASAN)"
- run_on: ubuntu2004-small
+- name: ubuntu-encryption-asan
+ display_name: "Ubuntu (Encryption Enabled w/ASAN)"
+ run_on: ubuntu2204-arm64-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
fetch_missing_dependencies: On
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
- llvm_symbolizer: "./clang_binaries/bin/llvm-symbolizer"
- run_with_encryption: On
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
+ run_with_encryption: 1
enable_asan: On
cmake_build_type: RelWithDebInfo
tasks:
- name: core_tests_group
- distros:
- - ubuntu2004-large
+# TODO RCORE-2085 ubuntu2004-release/ubuntu2004-arm64 build variants are here until we've established
+# a new baseline for the updated ubuntu 2204/clang 18 builders.
- name: ubuntu2004-release
- display_name: "Ubuntu 20.04 x86_64 (Clang 11 Release build)"
- run_on: ubuntu2004-small
+ display_name: "Ubuntu 20.04 x86_64 (Clang 11 release benchmarks)"
+ run_on: ubuntu2004-large
expansions:
clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
+ clang_sha256_sum: "829f5fb0ebda1d8716464394f97d5475d465ddc7bea2879c0601316b611ff6db"
cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- bloaty_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/bloaty-v1.1-39-gefc1c61-ubuntu2004-x86_64.tar.gz"
cmake_bindir: "./cmake_binaries/bin"
cmake_build_type: RelWithDebInfo
fetch_missing_dependencies: On
@@ -1419,79 +1332,113 @@ buildvariants:
cxx_compiler: "./clang_binaries/bin/clang++"
python3: /opt/mongodbtoolchain/v3/bin/python3
tasks:
- - name: compile_test_and_package
- distros:
- - ubuntu2004-large
- name: benchmarks
- distros:
- - ubuntu2004-large
- - name: long-running-tests
- - name: bloaty
-- name: ubuntu2004-asan
- display_name: "Ubuntu 20.04 x86_64 (Clang 11 ASAN)"
- run_on: ubuntu2004-large
+- name: ubuntu2004-arm64
+ display_name: "Ubuntu 20.04 ARM64 (Clang 11 release benchmarks)"
+ run_on: ubuntu2004-arm64-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
+ cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-aarch64.tar.gz"
cmake_bindir: "./cmake_binaries/bin"
+ python3: "/opt/mongodbtoolchain/v3/bin/python3"
+ use_system_openssl: On
fetch_missing_dependencies: On
- enable_asan: On
cmake_build_type: RelWithDebInfo
+ tasks:
+ - name: benchmarks
+
+- name: ubuntu-x86_64-benchmarks
+ display_name: "Ubuntu x86_64 benchmarks"
+ run_on: ubuntu2204-large
+ expansions:
+ fetch_missing_dependencies: On
+ cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
+ cmake_bindir: "./cmake_binaries/bin"
+ clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-18.1.2-x86_64-linux-gnu.tar.xz"
+ clang_sha256_sum: "feab4b0f5fba325bfe0f4245710fd19fd74f813f44b5e81eda794f4f75bca343"
c_compiler: "./clang_binaries/bin/clang"
cxx_compiler: "./clang_binaries/bin/clang++"
- llvm_symbolizer: "./clang_binaries/bin/llvm-symbolizer"
+ cmake_build_type: RelWithDebInfo
+ tasks:
+ - name: benchmarks
+
+- name: ubuntu-release
+ display_name: "Ubuntu (Release build)"
+ run_on: ubuntu2204-arm64-large
+ expansions:
+ cmake_build_type: RelWithDebInfo
+ fetch_missing_dependencies: On
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
+ python3: /opt/mongodbtoolchain/v3/bin/python3
+ tasks:
+ - name: compile_test_and_package
+ - name: benchmarks
+ - name: long-running-tests
+
+- name: ubuntu-asan
+ display_name: "Ubuntu (ASAN ARM64)"
+ run_on: ubuntu2204-arm64-large
+ expansions:
+ fetch_missing_dependencies: On
+ enable_asan: On
+ cmake_build_type: RelWithDebInfo
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
tasks:
- name: compile_test
- name: long-running-tests
- distros:
- - ubuntu2004-small
-- name: ubuntu2004-tsan
- display_name: "Ubuntu 20.04 x86_64 (Clang 11 TSAN)"
- run_on: ubuntu2004-large
+- name: ubuntu-asan-x86_64
+ display_name: "Ubuntu (ASAN x86_64)"
+ run_on: ubuntu2204-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
+ fetch_missing_dependencies: On
cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
cmake_bindir: "./cmake_binaries/bin"
+ clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-18.1.2-x86_64-linux-gnu.tar.xz"
+ clang_sha256_sum: "feab4b0f5fba325bfe0f4245710fd19fd74f813f44b5e81eda794f4f75bca343"
+ c_compiler: "./clang_binaries/bin/clang"
+ cxx_compiler: "./clang_binaries/bin/clang++"
+ enable_asan: On
+ cmake_build_type: RelWithDebInfo
+ tasks:
+ - name: compile_test
+
+- name: ubuntu-tsan
+ display_name: "Ubuntu (TSAN)"
+ run_on: ubuntu2204-arm64-large
+ expansions:
fetch_missing_dependencies: On
enable_tsan: On
cmake_build_type: RelWithDebInfo
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
tasks:
- name: compile_test
-- name: ubuntu2004-ubsan
- display_name: "Ubuntu 20.04 x86_64 (Clang 11 UBSAN)"
- run_on: ubuntu2004-small
+- name: ubuntu-ubsan
+ display_name: "Ubuntu (UBSAN)"
+ run_on: ubuntu2204-arm64-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
fetch_missing_dependencies: On
enable_ubsan: On
cmake_build_type: RelWithDebInfo
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
tasks:
- name: compile_test
- distros:
- - ubuntu2004-large
-- name: ubuntu2004-fuzzer
- display_name: "Ubuntu 20.04 x86_64 (Clang 11 Fuzzer)"
- run_on: ubuntu2004-large
+- name: ubuntu-fuzzer
+ display_name: "Ubuntu (Fuzzer)"
+ run_on: ubuntu2204-arm64-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
fetch_missing_dependencies: On
enable_ubsan: On
- c_compiler: "./clang_binaries/bin/clang"
- cxx_compiler: "./clang_binaries/bin/clang++"
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
cmake_build_type: RelWithDebInfo
- run_with_encryption: On
+ run_with_encryption: 1
enable_fuzzer: On
tasks:
- name: fuzzer-tests
@@ -1569,27 +1516,13 @@ buildvariants:
tasks:
- name: valgrind
-- name: ubuntu2004-arm64
- display_name: "Ubuntu 20.04 ARM64"
- run_on: ubuntu2004-arm64-large
- expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-aarch64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
- python3: "/opt/mongodbtoolchain/v3/bin/python3"
- use_system_openssl: On
- fetch_missing_dependencies: On
- cmake_build_type: RelWithDebInfo
- tasks:
- - name: compile_test_and_package
- - name: benchmarks
-
# use a small runner to exercise timing sensitive bugs
- name: ubuntu2204-arm64-small
- display_name: "Ubuntu 22.04 ARM64 Small"
+ display_name: "Ubuntu Small"
run_on: ubuntu2204-arm64-small
expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-aarch64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
+ c_compiler: "/opt/clang+llvm/bin/clang"
+ cxx_compiler: "/opt/clang+llvm/bin/clang++"
python3: "/opt/mongodbtoolchain/v3/bin/python3"
use_system_openssl: On
fetch_missing_dependencies: On
@@ -1597,50 +1530,21 @@ buildvariants:
tasks:
- name: compile_test_and_package
-- name: ubuntu2204-arm64-asan
- display_name: "Ubuntu 22.04 ARM64 (ASAN)"
- run_on: ubuntu2204-arm64-large
- expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-aarch64.tar.gz"
- cmake_bindir: "./cmake_binaries/bin"
- python3: "/opt/mongodbtoolchain/v3/bin/python3"
- use_system_openssl: On
- fetch_missing_dependencies: On
- cmake_build_type: Debug
- enable_asan: On
- tasks:
- - name: compile_test
-
-- name: macos
- display_name: "MacOS 11.0 x86_64"
- run_on: macos-1100
- expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
- cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
- cmake_generator: Xcode
- max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
- extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=x86_64
- tasks:
- - name: compile_test
- - name: swift-build-and-test
- - name: validate-installed-headers
-
- name: macos-encrypted
- display_name: "MacOS 11.0 x86_64 (Encryption enabled)"
- run_on: macos-1100
+ display_name: "MacOS 14.0 arm64 (Encryption enabled)"
+ run_on: macos-14-arm64
expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
+ cmake_bindir: "/opt/homebrew/bin"
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
+ cmake_build_tool_options: "-sdk macosx"
cmake_generator: Xcode
max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
- extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=x86_64
- run_with_encryption: On
+ xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
+ extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
+ run_with_encryption: 1
tasks:
- name: core_tests_group
+ - name: test-on-exfat
- name: macos-release
display_name: "MacOS 11.0 x86_64 (Release build)"
@@ -1655,29 +1559,11 @@ buildvariants:
xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=x86_64
tasks:
- - name: compile_test_and_package
- name: benchmarks
- - name: long-running-tests
- - name: swift-build-and-test
- - name: test-on-exfat
-
-- name: macos-1100-arm64
- display_name: "MacOS 11 arm64"
- run_on: macos-1100-arm64
- expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
- cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
- cmake_generator: Xcode
- max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
- extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64 -DREALM_ENABLE_GEOSPATIAL=OFF
- tasks:
- name: compile_test
- - name: swift-build-and-test
- name: macos-1100-arm64-release
- display_name: "MacOS 11 arm64 (Release build)"
+ display_name: "MacOS 11 arm64 (Release benchmarks)"
run_on: macos-1100-arm64
expansions:
cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
@@ -1689,102 +1575,103 @@ buildvariants:
xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
tasks:
- - name: compile_test_and_package
- name: benchmarks
- - name: long-running-tests
- - name: swift-build-and-test
-- name: macos-1100-x64-asan
- display_name: "MacOS 11.0 x86_64 (ASAN)"
- run_on: macos-1100
+- name: macos
+ display_name: "MacOS 14 arm64"
+ run_on: macos-14-arm64
expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
+ cmake_bindir: "/opt/homebrew/bin"
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
+ cmake_build_tool_options: "-sdk macosx"
cmake_generator: Xcode
max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
- extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=x86_64
- cmake_build_type: RelWithDebInfo
- enable_asan: On
+ xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
+ extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
tasks:
- name: compile_test
+ - name: swift-build-and-test
+ - name: validate-installed-headers
+ - name: test-on-exfat
-- name: macos-1100-x64-tsan
- display_name: "MacOS 11.0 x86_64 (TSAN)"
- run_on: macos-1100
+- name: macos-14-release
+ display_name: "MacOS 14 arm64 (Release build)"
+ run_on: macos-14-arm64
expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
+ cmake_bindir: "/opt/homebrew/bin"
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
+ cmake_build_tool_options: "-sdk macosx"
cmake_generator: Xcode
max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
- extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=x86_64
- cmake_build_type: RelWithDebInfo
- enable_tsan: On
+ cmake_build_type: Release
+ xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
+ extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
+
tasks:
- - name: compile_test
+ - name: compile_test_and_package
+ # benchmarks are disabled for now because of perf problems on AWS macos instances.
+ # - name: benchmarks
+ - name: long-running-tests
+ - name: swift-build-and-test
+ - name: test-on-exfat
-- name: macos-1100-arm64-asan
- display_name: "MacOS 11 arm64 (ASAN)"
- run_on: macos-1100-arm64
+- name: macos-asan
+ display_name: "MacOS 14 arm64 (ASAN)"
+ run_on: macos-14-arm64
expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
+ cmake_bindir: "/opt/homebrew/bin"
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
+ cmake_build_tool_options: "-sdk macosx"
cmake_generator: Xcode
max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
+ xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
cmake_build_type: RelWithDebInfo
enable_asan: On
tasks:
- name: compile_test
-- name: macos-1100-arm64-tsan
- display_name: "MacOS 11 arm64 (TSAN)"
- run_on: macos-1100-arm64
+- name: macos-tsan
+ display_name: "MacOS 14 arm64 (TSAN)"
+ run_on: macos-14-arm64
expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
+ cmake_bindir: "/opt/homebrew/bin"
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
+ cmake_build_tool_options: "-sdk macosx"
cmake_generator: Xcode
max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
+ xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
cmake_build_type: RelWithDebInfo
enable_tsan: On
tasks:
- # FIXME: tsan is not stable on arm64, fails often with internal errors
- # - name: compile_test
- name: compile_test
- name: macos-coverage
- display_name: "MacOS 11 arm64 (Code Coverage)"
- run_on: macos-1100-arm64
+ display_name: "MacOS 14 arm64 (Code Coverage)"
+ run_on: macos-14-arm64
expansions:
- cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-macos-universal.tar.gz"
- cmake_bindir: "./cmake_binaries/CMake.app/Contents/bin"
+ cmake_bindir: "/opt/homebrew/bin"
cmake_toolchain_file: "./tools/cmake/xcode.toolchain.cmake"
+ cmake_build_tool_options: "-sdk macosx"
cmake_generator: Xcode
max_jobs: $(sysctl -n hw.logicalcpu)
- xcode_developer_dir: /Applications/Xcode13.1.app/Contents/Developer
+ xcode_developer_dir: /Applications/Xcode15.2.app/Contents/Developer
extra_flags: -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_ARCHITECTURES=arm64
enable_llvm_coverage: On
coveralls_flag_name: "macos-arm64"
grcov_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/grcov-aarch64-apple-darwin.tar.bz2"
tasks:
- name: compile_test_coverage
-
- name: ubuntu-coverage
- display_name: "Ubuntu 20.04 x86_64 (Code Coverage)"
- run_on: ubuntu2004-large
+ display_name: "Ubuntu (Code Coverage)"
+ run_on: ubuntu2204-large
expansions:
- clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz"
+ fetch_missing_dependencies: On
cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-x86_64.tar.gz"
cmake_bindir: "./cmake_binaries/bin"
- fetch_missing_dependencies: On
+ clang_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/clang%2Bllvm-18.1.2-x86_64-linux-gnu.tar.xz"
+ clang_sha256_sum: "feab4b0f5fba325bfe0f4245710fd19fd74f813f44b5e81eda794f4f75bca343"
c_compiler: "./clang_binaries/bin/clang"
cxx_compiler: "./clang_binaries/bin/clang++"
enable_llvm_coverage: On
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
deleted file mode 100644
index e2d633440a3..00000000000
--- a/external/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-cmake_minimum_required(VERSION 3.15)
-
-add_cxx_flag_if_supported(-Wno-unused-but-set-variable)
diff --git a/external/generated/empty.cpp b/external/generated/empty.cpp
deleted file mode 100644
index 7a9dd23eb51..00000000000
--- a/external/generated/empty.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-// This empty file forces projects that depend on the Catch2Generated target in Package.swift to generate a .o file
-// for this dependency
diff --git a/src/realm/array_backlink.hpp b/src/realm/array_backlink.hpp
index 190110d29fd..a28b2973700 100644
--- a/src/realm/array_backlink.hpp
+++ b/src/realm/array_backlink.hpp
@@ -86,6 +86,6 @@ class ArrayBacklink : public ArrayPayload, private Array {
void verify() const;
bool verify_backlink(size_t ndx, int64_t link);
};
-}
+} // namespace realm
#endif /* SRC_REALM_ARRAY_KEY_HPP_ */
diff --git a/src/realm/array_basic.hpp b/src/realm/array_basic.hpp
index 21eece3230b..d48b2d1e6ea 100644
--- a/src/realm/array_basic.hpp
+++ b/src/realm/array_basic.hpp
@@ -33,9 +33,7 @@ class BasicArray : public Node, public ArrayPayload {
using value_type = T;
explicit BasicArray(Allocator&) noexcept;
- ~BasicArray() noexcept override
- {
- }
+ ~BasicArray() noexcept override {}
static T default_value(bool)
{
diff --git a/src/realm/array_binary.hpp b/src/realm/array_binary.hpp
index 7e949a26dae..6c8e70d1a7b 100644
--- a/src/realm/array_binary.hpp
+++ b/src/realm/array_binary.hpp
@@ -107,6 +107,6 @@ inline BinaryData ArrayBinary::get(const char* header, size_t ndx, Allocator& al
return ArrayBigBlobs::get(header, ndx, alloc);
}
}
-}
+} // namespace realm
#endif /* SRC_REALM_ARRAY_BINARY_HPP_ */
diff --git a/src/realm/array_blob.hpp b/src/realm/array_blob.hpp
index a0f4e21d4c6..36010fa9913 100644
--- a/src/realm/array_blob.hpp
+++ b/src/realm/array_blob.hpp
@@ -31,9 +31,7 @@ class ArrayBlob : public Array {
static constexpr size_t max_binary_size = 0xFFFFF8 - Array::header_size;
explicit ArrayBlob(Allocator&) noexcept;
- ~ArrayBlob() noexcept override
- {
- }
+ ~ArrayBlob() noexcept override {}
// Disable copying, this is not allowed.
ArrayBlob& operator=(const ArrayBlob&) = delete;
@@ -67,6 +65,7 @@ class ArrayBlob : public Array {
static MemRef create_array(size_t init_size, Allocator&);
void verify() const;
+
private:
size_t calc_byte_len(size_t for_size, size_t width) const override;
size_t calc_item_count(size_t bytes, size_t width) const noexcept override;
diff --git a/src/realm/array_blobs_big.cpp b/src/realm/array_blobs_big.cpp
index dc12f36a6db..daa3df69110 100644
--- a/src/realm/array_blobs_big.cpp
+++ b/src/realm/array_blobs_big.cpp
@@ -188,7 +188,6 @@ void ArrayBigBlobs::find_all(IntegerColumn& result, BinaryData value, bool is_st
}
-
void ArrayBigBlobs::verify() const
{
#ifdef REALM_DEBUG
@@ -204,4 +203,3 @@ void ArrayBigBlobs::verify() const
}
#endif
}
-
diff --git a/src/realm/array_blobs_big.hpp b/src/realm/array_blobs_big.hpp
index a6e1e34f0d6..f64c7d679e3 100644
--- a/src/realm/array_blobs_big.hpp
+++ b/src/realm/array_blobs_big.hpp
@@ -129,7 +129,7 @@ inline BinaryData ArrayBigBlobs::get(const char* header, size_t ndx, Allocator&
inline void ArrayBigBlobs::erase(size_t ndx)
{
ref_type blob_ref = Array::get_as_ref(ndx);
- if (blob_ref != 0) { // nothing to destroy if null
+ if (blob_ref != 0) { // nothing to destroy if null
Array::destroy_deep(blob_ref, get_alloc()); // Deep
}
Array::erase(ndx);
diff --git a/src/realm/array_blobs_small.hpp b/src/realm/array_blobs_small.hpp
index dc772069887..8db3467a209 100644
--- a/src/realm/array_blobs_small.hpp
+++ b/src/realm/array_blobs_small.hpp
@@ -54,9 +54,7 @@ in set(), etc). This way no file format upgrade is needed to support nulls for B
class ArraySmallBlobs : public Array {
public:
explicit ArraySmallBlobs(Allocator&) noexcept;
- ~ArraySmallBlobs() noexcept override
- {
- }
+ ~ArraySmallBlobs() noexcept override {}
// Disable copying, this is not allowed.
ArraySmallBlobs& operator=(const ArraySmallBlobs&) = delete;
diff --git a/src/realm/array_bool.hpp b/src/realm/array_bool.hpp
index 9de45ff94db..7c11f037f23 100644
--- a/src/realm/array_bool.hpp
+++ b/src/realm/array_bool.hpp
@@ -152,6 +152,6 @@ class ArrayBoolNull : public ArrayBool {
return (val == null_value) ? util::none : util::make_optional(val != 0);
}
};
-}
+} // namespace realm
#endif /* REALM_ARRAY_BOOL_HPP */
diff --git a/src/realm/array_direct.hpp b/src/realm/array_direct.hpp
index ae75e978498..d595363c762 100644
--- a/src/realm/array_direct.hpp
+++ b/src/realm/array_direct.hpp
@@ -350,6 +350,6 @@ inline size_t upper_bound(const char* data, size_t size, int64_t value) noexcept
return low;
}
-}
+} // namespace realm
#endif /* ARRAY_TPL_HPP_ */
diff --git a/src/realm/array_integer.cpp b/src/realm/array_integer.cpp
index bf459b8161d..8cf854c671f 100644
--- a/src/realm/array_integer.cpp
+++ b/src/realm/array_integer.cpp
@@ -70,7 +70,7 @@ int64_t next_null_candidate(int64_t previous_candidate)
x += 0xfffffffbULL;
return int64_t(x);
}
-}
+} // namespace
int_fast64_t ArrayIntNull::choose_random_null(int64_t incoming) const
{
diff --git a/src/realm/array_key.hpp b/src/realm/array_key.hpp
index 07231ca5dc0..d0bb9fcd325 100644
--- a/src/realm/array_key.hpp
+++ b/src/realm/array_key.hpp
@@ -128,6 +128,6 @@ class ArrayKeyNonNullable : public ArrayKeyBase<0> {
public:
using ArrayKeyBase::ArrayKeyBase;
};
-}
+} // namespace realm
#endif /* SRC_REALM_ARRAY_KEY_HPP_ */
diff --git a/src/realm/array_list.hpp b/src/realm/array_list.hpp
index 26efda68674..700c8232348 100644
--- a/src/realm/array_list.hpp
+++ b/src/realm/array_list.hpp
@@ -95,6 +95,6 @@ class ArrayList : public ArrayPayload, private Array {
return Array::find_first(from_ref(value), begin, end);
}
};
-}
+} // namespace realm
#endif /* REALM_ARRAY_LIST_HPP */
diff --git a/src/realm/array_string.cpp b/src/realm/array_string.cpp
index 661abf2de5c..636a60a2865 100644
--- a/src/realm/array_string.cpp
+++ b/src/realm/array_string.cpp
@@ -358,7 +358,7 @@ size_t lower_bound_string(const T* arr, U value)
}
return i;
}
-}
+} // namespace
size_t ArrayString::lower_bound(StringData value)
{
diff --git a/src/realm/array_string.hpp b/src/realm/array_string.hpp
index eb6d7bb2594..4dc96646378 100644
--- a/src/realm/array_string.hpp
+++ b/src/realm/array_string.hpp
@@ -160,6 +160,6 @@ inline StringData ArrayString::get(const char* header, size_t ndx, Allocator& al
}
}
-}
+} // namespace realm
#endif /* REALM_ARRAY_STRING_HPP */
diff --git a/src/realm/array_string_short.hpp b/src/realm/array_string_short.hpp
index 5297b169ebc..da499bfcaa4 100644
--- a/src/realm/array_string_short.hpp
+++ b/src/realm/array_string_short.hpp
@@ -48,9 +48,7 @@ class ArrayStringShort : public Array {
// Constructor defaults to non-nullable because we use non-nullable ArrayStringShort so many places internally
// in core (data which isn't user payload) where null isn't needed.
explicit ArrayStringShort(Allocator&, bool nullable = false) noexcept;
- ~ArrayStringShort() noexcept override
- {
- }
+ ~ArrayStringShort() noexcept override {}
bool is_null(size_t ndx) const;
void set_null(size_t ndx);
diff --git a/src/realm/array_timestamp.cpp b/src/realm/array_timestamp.cpp
index 8efe9246e86..e2b282dc680 100644
--- a/src/realm/array_timestamp.cpp
+++ b/src/realm/array_timestamp.cpp
@@ -224,14 +224,14 @@ size_t ArrayTimestamp::find_first(Timestamp value, size_t begin, size_
util::Optional seconds = m_seconds.get(begin);
if (!seconds || *seconds != sec) {
return begin;
- }
- // We now know that neither m_value nor current value is null and that seconds part equals
- // We are just missing to compare nanoseconds part
- int32_t nanos = int32_t(m_nanoseconds.get(begin));
- if (nanos != value.get_nanoseconds()) {
- return begin;
- }
- ++begin;
+ }
+ // We now know that neither m_value nor current value is null and that seconds part equals
+ // We are just missing to compare nanoseconds part
+ int32_t nanos = int32_t(m_nanoseconds.get(begin));
+ if (nanos != value.get_nanoseconds()) {
+ return begin;
+ }
+ ++begin;
}
return not_found;
}
diff --git a/src/realm/array_timestamp.hpp b/src/realm/array_timestamp.hpp
index 9ff8acfc1d8..7381156f7cd 100644
--- a/src/realm/array_timestamp.hpp
+++ b/src/realm/array_timestamp.hpp
@@ -132,6 +132,6 @@ inline size_t ArrayTimestamp::find_first(Timestamp value, size_t begin, size_t e
return find_first(value, begin, end);
}
-}
+} // namespace realm
#endif /* SRC_REALM_ARRAY_BINARY_HPP_ */
diff --git a/src/realm/bplustree.cpp b/src/realm/bplustree.cpp
index c545fa4440c..da25593abe9 100644
--- a/src/realm/bplustree.cpp
+++ b/src/realm/bplustree.cpp
@@ -169,13 +169,11 @@ class BPlusTreeInner : public BPlusTreeNode, private Array {
return (child_ndx) > 0 ? size_t(m_offsets.get(child_ndx - 1)) : 0;
}
};
-}
+} // namespace realm
/****************************** BPlusTreeNode ********************************/
-BPlusTreeNode::~BPlusTreeNode()
-{
-}
+BPlusTreeNode::~BPlusTreeNode() {}
/****************************** BPlusTreeLeaf ********************************/
@@ -275,9 +273,7 @@ void BPlusTreeInner::create(size_t elems_per_child)
Array::create(Array::type_InnerBptreeNode, false, 1, tagged);
}
-BPlusTreeInner::~BPlusTreeInner()
-{
-}
+BPlusTreeInner::~BPlusTreeInner() {}
void BPlusTreeInner::init_from_mem(MemRef mem)
{
@@ -651,7 +647,7 @@ ref_type BPlusTreeInner::insert_bp_node(size_t child_ndx, ref_type new_sibling_r
new_split_offset = size_t(elem_ndx_offset + state.split_offset);
new_split_size = elem_ndx_offset + state.split_size;
new_sibling.add_bp_node_ref(new_sibling_ref); // Throws
- set_tree_size(new_split_offset); // Throws
+ set_tree_size(new_split_offset); // Throws
}
else {
// Case 2/2: The split child was not the last child of the
@@ -661,9 +657,9 @@ ref_type BPlusTreeInner::insert_bp_node(size_t child_ndx, ref_type new_sibling_r
new_split_offset = size_t(elem_ndx_offset + state.split_size);
new_split_size = get_tree_size() + 1;
- move(&new_sibling, new_ref_ndx, (new_split_offset - 1)); // Strips off tree size
+ move(&new_sibling, new_ref_ndx, (new_split_offset - 1)); // Strips off tree size
add_bp_node_ref(new_sibling_ref, elem_ndx_offset + state.split_offset); // Throws
- append_tree_size(new_split_offset); // Throws
+ append_tree_size(new_split_offset); // Throws
}
new_sibling.append_tree_size(new_split_size - new_split_offset); // Throws
@@ -737,9 +733,7 @@ void BPlusTreeInner::verify() const
/****************************** BPlusTreeBase ********************************/
-BPlusTreeBase::~BPlusTreeBase()
-{
-}
+BPlusTreeBase::~BPlusTreeBase() {}
void BPlusTreeBase::create()
{
diff --git a/src/realm/cluster.hpp b/src/realm/cluster.hpp
index f66fca9557f..6d3638d4a87 100644
--- a/src/realm/cluster.hpp
+++ b/src/realm/cluster.hpp
@@ -80,9 +80,9 @@ class ClusterNode : public Array {
// This structure is used to bring information back to the upper nodes when
// inserting new objects or finding existing ones.
struct State {
- int64_t split_key; // When a node is split, this variable holds the value of the
- // first key in the new node. (Relative to the key offset)
- MemRef mem; // MemRef to the Cluster holding the new/found object
+ int64_t split_key; // When a node is split, this variable holds the value of the
+ // first key in the new node. (Relative to the key offset)
+ MemRef mem; // MemRef to the Cluster holding the new/found object
size_t index = realm::npos; // The index within the Cluster at which the object is stored.
operator bool() const
@@ -113,9 +113,7 @@ class ClusterNode : public Array {
{
m_keys.set_parent(this, 0);
}
- virtual ~ClusterNode()
- {
- }
+ virtual ~ClusterNode() {}
void init_from_parent()
{
ref_type ref = get_ref_from_parent();
@@ -360,6 +358,6 @@ class Cluster : public ClusterNode {
void verify(ref_type ref, size_t index, util::Optional& sz) const;
};
-}
+} // namespace realm
#endif /* SRC_REALM_CLUSTER_HPP_ */
diff --git a/src/realm/collection.cpp b/src/realm/collection.cpp
index f0e1851f7a7..f0eabf95d46 100644
--- a/src/realm/collection.cpp
+++ b/src/realm/collection.cpp
@@ -243,10 +243,6 @@ UpdateStatus CollectionBase::do_init_from_parent(BPlusTreeBase* tree, ref_type r
tree->init_from_ref(ref);
}
else {
- if (tree->init_from_parent()) {
- // All is well
- return UpdateStatus::Updated;
- }
if (!allow_create) {
tree->detach();
return UpdateStatus::Detached;
diff --git a/src/realm/column_binary.hpp b/src/realm/column_binary.hpp
index 0fae1c3dbb3..0ff0107eeaf 100644
--- a/src/realm/column_binary.hpp
+++ b/src/realm/column_binary.hpp
@@ -34,9 +34,7 @@ class BinaryColumn : public BPlusTree {
class BinaryIterator {
public:
- BinaryIterator()
- {
- }
+ BinaryIterator() {}
BinaryIterator(BinaryData binary)
: m_binary(binary)
diff --git a/src/realm/column_integer.hpp b/src/realm/column_integer.hpp
index f40b67d8389..0e08b8563eb 100644
--- a/src/realm/column_integer.hpp
+++ b/src/realm/column_integer.hpp
@@ -192,6 +192,6 @@ inline std::ostream& operator<<(std::ostream& out, const IntegerColumnIterator&
out << "IntegerColumnIterator at index: " << it.get_position();
return out;
}
-}
+} // namespace realm
#endif /* REALM_COLUMN_INTEGER_HPP */
diff --git a/src/realm/handover_defs.hpp b/src/realm/handover_defs.hpp
index ad8bfba3116..fcbd2fb0af4 100644
--- a/src/realm/handover_defs.hpp
+++ b/src/realm/handover_defs.hpp
@@ -29,6 +29,6 @@ namespace realm {
enum class PayloadPolicy { Copy, Stay, Move };
-} // end namespace Realm
+} // namespace realm
#endif
diff --git a/src/realm/impl/array_writer.hpp b/src/realm/impl/array_writer.hpp
index f039ad505f9..2f18affe7f3 100644
--- a/src/realm/impl/array_writer.hpp
+++ b/src/realm/impl/array_writer.hpp
@@ -26,9 +26,7 @@ namespace _impl {
class ArrayWriterBase {
public:
- virtual ~ArrayWriterBase()
- {
- }
+ virtual ~ArrayWriterBase() {}
/// Write the specified array data and its checksum into free
/// space.
@@ -38,7 +36,7 @@ class ArrayWriterBase {
virtual ref_type write_array(const char* data, size_t size, uint32_t checksum) = 0;
};
-} // namespace impl_
+} // namespace _impl
} // namespace realm
#endif // REALM_ARRAY_WRITER_HPP
diff --git a/src/realm/impl/cont_transact_hist.hpp b/src/realm/impl/cont_transact_hist.hpp
index 891ef7e54e4..5da27740616 100644
--- a/src/realm/impl/cont_transact_hist.hpp
+++ b/src/realm/impl/cont_transact_hist.hpp
@@ -75,8 +75,8 @@ class History {
/// of update_early_from_top_ref(). In that case, the caller may assume that
/// the memory references stay valid for the remainder of the transaction
/// (up until initiation of the commit operation).
- virtual void get_changesets(version_type begin_version, version_type end_version, BinaryIterator* buffer) const
- noexcept = 0;
+ virtual void get_changesets(version_type begin_version, version_type end_version,
+ BinaryIterator* buffer) const noexcept = 0;
/// \brief Specify the version of the oldest bound snapshot.
///
diff --git a/src/realm/impl/output_stream.hpp b/src/realm/impl/output_stream.hpp
index 1d022cd5318..eb459900485 100644
--- a/src/realm/impl/output_stream.hpp
+++ b/src/realm/impl/output_stream.hpp
@@ -59,9 +59,7 @@ inline OutputStream::OutputStream(std::ostream& out)
{
}
-inline OutputStream::~OutputStream() noexcept
-{
-}
+inline OutputStream::~OutputStream() noexcept {}
inline size_t OutputStream::get_ref_of_next_array() const noexcept
{
diff --git a/src/realm/impl/transact_log.hpp b/src/realm/impl/transact_log.hpp
index ad352f93c03..335856d6719 100644
--- a/src/realm/impl/transact_log.hpp
+++ b/src/realm/impl/transact_log.hpp
@@ -772,18 +772,18 @@ void TransactLogParser::parse_one(InstructionHandler& handler)
case instr_DictionarySet: {
int type = read_int(); // Throws
REALM_ASSERT(type == int(type_String));
- read_string(m_string_buffer); // skip key
- size_t dict_ndx = read_int(); // Throws
- if (!handler.collection_set(dict_ndx)) // Throws
+ read_string(m_string_buffer); // skip key
+ size_t dict_ndx = read_int(); // Throws
+ if (!handler.collection_set(dict_ndx)) // Throws
parser_error();
return;
}
case instr_DictionaryErase: {
int type = read_int(); // Throws
REALM_ASSERT(type == int(type_String));
- read_string(m_string_buffer); // skip key
- size_t dict_ndx = read_int(); // Throws
- if (!handler.collection_erase(dict_ndx)) // Throws
+ read_string(m_string_buffer); // skip key
+ size_t dict_ndx = read_int(); // Throws
+ if (!handler.collection_erase(dict_ndx)) // Throws
parser_error();
return;
}
diff --git a/src/realm/index_string.cpp b/src/realm/index_string.cpp
index f26c575a3de..b313b7c8383 100644
--- a/src/realm/index_string.cpp
+++ b/src/realm/index_string.cpp
@@ -414,7 +414,8 @@ uint32_t replicate_4_lsb_x8(uint32_t i)
return i;
}
-int32_t select_from_mask(int32_t a, int32_t b, int32_t mask) {
+int32_t select_from_mask(int32_t a, int32_t b, int32_t mask)
+{
return a ^ ((a ^ b) & mask);
}
diff --git a/src/realm/index_string.hpp b/src/realm/index_string.hpp
index eefa13fa2fc..c8941989388 100644
--- a/src/realm/index_string.hpp
+++ b/src/realm/index_string.hpp
@@ -123,9 +123,7 @@ class StringIndex : public SearchIndex {
public:
StringIndex(const ClusterColumn& target_column, Allocator&);
StringIndex(ref_type, ArrayParent*, size_t ndx_in_parent, const ClusterColumn& target_column, Allocator&);
- ~StringIndex() noexcept
- {
- }
+ ~StringIndex() noexcept {}
static bool type_supported(realm::DataType type)
{
@@ -205,8 +203,7 @@ class StringIndex : public SearchIndex {
// If the header flag is set, references point to a sub-StringIndex (nesting).
std::unique_ptr m_array;
- struct inner_node_tag {
- };
+ struct inner_node_tag {};
StringIndex(inner_node_tag, Allocator&);
StringIndex(const ClusterColumn& target_column, std::unique_ptr root)
: SearchIndex(target_column, root.get())
diff --git a/src/realm/list.hpp b/src/realm/list.hpp
index ca1cf03162f..f0646d2a176 100644
--- a/src/realm/list.hpp
+++ b/src/realm/list.hpp
@@ -260,7 +260,7 @@ class Lst final : public CollectionBaseImpl {
m_tree->set_parent(const_cast(parent), 0);
}
Base::update_content_version();
- return do_init_from_parent(m_tree.get(), 0, allow_create);
+ return do_init_from_parent(m_tree.get(), Base::get_collection_ref(), allow_create);
}
template
diff --git a/src/realm/node_header.hpp b/src/realm/node_header.hpp
index b5805fc343a..0251c796478 100644
--- a/src/realm/node_header.hpp
+++ b/src/realm/node_header.hpp
@@ -239,6 +239,6 @@ class NodeHeader {
return num_bytes;
}
};
-}
+} // namespace realm
#endif /* REALM_NODE_HEADER_HPP */
diff --git a/src/realm/obj_list.hpp b/src/realm/obj_list.hpp
index 6ea00cabb53..b8fbcfe9be0 100644
--- a/src/realm/obj_list.hpp
+++ b/src/realm/obj_list.hpp
@@ -93,6 +93,6 @@ class ObjList {
template
TableView find_all(ColKey column_key, T value) const;
};
-}
+} // namespace realm
#endif /* SRC_REALM_OBJ_LIST_HPP_ */
diff --git a/src/realm/object-store/dictionary.hpp b/src/realm/object-store/dictionary.hpp
index 8f0fcf52f1a..6af4fcc5ac9 100644
--- a/src/realm/object-store/dictionary.hpp
+++ b/src/realm/object-store/dictionary.hpp
@@ -142,7 +142,6 @@ class Dictionary : public object_store::Collection {
Obj get_object(StringData key) const;
};
-
template
auto Dictionary::dispatch(Fn&& fn) const
{
@@ -178,62 +177,7 @@ inline Obj Dictionary::get(StringData key) const
return get_object(key);
}
-template
-void Dictionary::insert(Context& ctx, StringData key, T&& value, CreatePolicy policy)
-{
- if (ctx.is_null(value)) {
- this->insert(key, Mixed());
- return;
- }
- if (m_is_embedded) {
- validate_embedded(ctx, value, policy);
- auto obj_key = dict().create_and_insert_linked_object(key).get_key();
- ctx.template unbox(value, policy, obj_key);
- return;
- }
- dispatch([&](auto t) {
- this->insert(key, ctx.template unbox>(value, policy));
- });
-}
-
-template
-auto Dictionary::get(Context& ctx, StringData key) const
-{
- return dispatch([&](auto t) {
- return ctx.box(this->get>(key));
- });
-}
-
-template
-void Dictionary::assign(Context& ctx, T&& values, CreatePolicy policy)
-{
- if (ctx.is_same_dictionary(*this, values))
- return;
-
- if (ctx.is_null(values)) {
- remove_all();
- return;
- }
-
- if (!policy.diff)
- remove_all();
-
- ctx.enumerate_dictionary(values, [&](StringData key, auto&& value) {
- if (policy.diff) {
- util::Optional old_value = dict().try_get(key);
- auto new_value = ctx.template unbox(value);
- if (!old_value || *old_value != new_value) {
- dict().insert(key, new_value);
- }
- }
- else {
- this->insert(ctx, key, value, policy);
- }
- });
-}
-
} // namespace object_store
} // namespace realm
-
#endif /* REALM_OS_DICTIONARY_HPP */
diff --git a/src/realm/object-store/impl/object_accessor_impl.hpp b/src/realm/object-store/impl/object_accessor_impl.hpp
index 8a9eacccf0e..c7371589335 100644
--- a/src/realm/object-store/impl/object_accessor_impl.hpp
+++ b/src/realm/object-store/impl/object_accessor_impl.hpp
@@ -31,6 +31,11 @@ namespace realm {
using AnyDict = std::map;
using AnyVector = std::vector;
+struct UnmanagedObject {
+ std::string object_type;
+ std::any properties;
+};
+
// An object accessor context which can be used to create and access objects
// using std::any as the type-erased value type. In addition, this serves as
// the reference implementation of an accessor context that must be implemented
@@ -370,7 +375,7 @@ inline util::Optional CppContext::unbox(std::any& v, CreatePolicy, ObjKey)
}
template <>
-inline Mixed CppContext::unbox(std::any& v, CreatePolicy, ObjKey) const
+inline Mixed CppContext::unbox(std::any& v, CreatePolicy policy, ObjKey) const
{
if (v.has_value()) {
const std::type_info& this_type{v.type()};
@@ -408,6 +413,23 @@ inline Mixed CppContext::unbox(std::any& v, CreatePolicy, ObjKey) const
else if (this_type == typeid(UUID)) {
return Mixed(util::any_cast(v));
}
+ else if (this_type == typeid(AnyDict)) {
+ return Mixed(0, CollectionType::Dictionary);
+ }
+ else if (this_type == typeid(AnyVector)) {
+ return Mixed(0, CollectionType::List);
+ }
+ else if (this_type == typeid(UnmanagedObject)) {
+ UnmanagedObject unmanaged_obj = util::any_cast(v);
+ auto os = realm->schema().find(unmanaged_obj.object_type);
+ CppContext child_ctx(realm, &*os);
+ auto obj = child_ctx.unbox(unmanaged_obj.properties, policy, ObjKey());
+ return Mixed(obj);
+ }
+ else if (this_type == typeid(Obj)) {
+ Obj obj = util::any_cast(v);
+ return Mixed(obj);
+ }
}
return Mixed{};
}
diff --git a/src/realm/object-store/index_set.hpp b/src/realm/object-store/index_set.hpp
index 59c59bbd64a..d61e78221f4 100644
--- a/src/realm/object-store/index_set.hpp
+++ b/src/realm/object-store/index_set.hpp
@@ -391,7 +391,8 @@ template
// Inlining this function crashes msvc when targeting arm64 in as of 19.39.33523
__declspec(noinline)
#endif
-inline void ChunkedRangeVectorIterator::next_chunk() noexcept
+inline void
+ChunkedRangeVectorIterator::next_chunk() noexcept
{
++m_outer;
m_inner = m_outer != m_end ? &m_outer->data[0] : nullptr;
diff --git a/src/realm/object-store/list.hpp b/src/realm/object-store/list.hpp
index 020f3414fee..ca1c1efbd60 100644
--- a/src/realm/object-store/list.hpp
+++ b/src/realm/object-store/list.hpp
@@ -127,9 +127,6 @@ class List : public object_store::Collection {
template
auto& as() const;
- template
- void set_if_different(Context&, size_t row_ndx, T&& value, CreatePolicy);
-
friend struct std::hash;
};
@@ -164,120 +161,6 @@ auto List::dispatch(Fn&& fn) const
return switch_on_type(get_type(), std::forward(fn));
}
-template
-auto List::get(Context& ctx, size_t row_ndx) const
-{
- return dispatch([&](auto t) {
- return ctx.box(this->get>(row_ndx));
- });
-}
-
-template
-size_t List::find(Context& ctx, T&& value) const
-{
- return dispatch([&](auto t) {
- return this->find(ctx.template unbox>(value, CreatePolicy::Skip));
- });
-}
-
-template
-void List::add(Context& ctx, T&& value, CreatePolicy policy)
-{
- if (m_is_embedded) {
- validate_embedded(ctx, value, policy);
- auto key = as().create_and_insert_linked_object(size()).get_key();
- ctx.template unbox(value, policy, key);
- return;
- }
- dispatch([&](auto t) {
- this->add(ctx.template unbox>(value, policy));
- });
-}
-
-template
-void List::insert(Context& ctx, size_t list_ndx, T&& value, CreatePolicy policy)
-{
- if (m_is_embedded) {
- validate_embedded(ctx, value, policy);
- auto key = as().create_and_insert_linked_object(list_ndx).get_key();
- ctx.template unbox(value, policy, key);
- return;
- }
- dispatch([&](auto t) {
- this->insert(list_ndx, ctx.template unbox>(value, policy));
- });
-}
-
-template
-void List::set(Context& ctx, size_t list_ndx, T&& value, CreatePolicy policy)
-{
- if (m_is_embedded) {
- validate_embedded(ctx, value, policy);
-
- auto& list = as();
- auto key = policy.diff ? list.get(list_ndx) : list.create_and_set_linked_object(list_ndx).get_key();
- ctx.template unbox(value, policy, key);
- return;
- }
- dispatch([&](auto t) {
- this->set(list_ndx, ctx.template unbox>(value, policy));
- });
-}
-
-template
-void List::set_if_different(Context& ctx, size_t row_ndx, T&& value, CreatePolicy policy)
-{
- if (m_is_embedded) {
- validate_embedded(ctx, value, policy);
- auto key = policy.diff ? this->get(row_ndx) : as().create_and_set_linked_object(row_ndx);
- ctx.template unbox(value, policy, key.get_key());
- return;
- }
- dispatch([&](auto t) {
- using U = std::decay_t;
- if constexpr (std::is_same_v) {
- auto old_value = this->get(row_ndx);
- auto new_value = ctx.template unbox(value, policy, old_value.get_key());
- if (new_value.get_key() != old_value.get_key())
- this->set(row_ndx, new_value);
- }
- else {
- auto old_value = this->get(row_ndx);
- auto new_value = ctx.template unbox(value, policy);
- if (old_value != new_value)
- this->set(row_ndx, new_value);
- }
- });
-}
-
-template
-void List::assign(Context& ctx, T&& values, CreatePolicy policy)
-{
- if (ctx.is_same_list(*this, values))
- return;
-
- if (ctx.is_null(values)) {
- remove_all();
- return;
- }
-
- if (!policy.diff)
- remove_all();
-
- size_t sz = size();
- size_t index = 0;
- ctx.enumerate_collection(values, [&](auto&& element) {
- if (index >= sz)
- this->add(ctx, element, policy);
- else if (policy.diff)
- this->set_if_different(ctx, index, element, policy);
- else
- this->set(ctx, index, element, policy);
- index++;
- });
- while (index < sz)
- remove(--sz);
-}
} // namespace realm
namespace std {
diff --git a/src/realm/object-store/object_accessor.hpp b/src/realm/object-store/object_accessor.hpp
index 5b6688e5fb2..824ee437204 100644
--- a/src/realm/object-store/object_accessor.hpp
+++ b/src/realm/object-store/object_accessor.hpp
@@ -170,8 +170,38 @@ void Object::set_property_value_impl(ContextType& ctx, const Property& property,
return;
}
- ValueUpdater updater{ctx, property, value, m_obj, col, policy, is_default};
- switch_on_type(property.type, updater);
+ if (property.type == PropertyType::Mixed) {
+ Mixed new_val = ctx.template unbox(value, policy);
+ if (new_val.is_type(type_Dictionary)) {
+ ContextType child_ctx(ctx, m_obj, property);
+ m_obj.set_collection(col, CollectionType::Dictionary);
+ object_store::Dictionary dict(m_realm, m_obj, col);
+ dict.assign(child_ctx, value, policy);
+ ctx.did_change();
+ return;
+ }
+ if (new_val.is_type(type_List)) {
+ ContextType child_ctx(ctx, m_obj, property);
+ m_obj.set_collection(col, CollectionType::List);
+ List list(m_realm, m_obj, col);
+ list.assign(child_ctx, value, policy);
+ ctx.did_change();
+ return;
+ }
+ bool attr_changed = !policy.diff;
+
+ if (!attr_changed) {
+ auto old_val = m_obj.get(col);
+ attr_changed = !new_val.is_same_type(old_val) || new_val != old_val;
+ }
+
+ if (attr_changed)
+ m_obj.set(col, new_val, is_default);
+ }
+ else {
+ ValueUpdater updater{ctx, property, value, m_obj, col, policy, is_default};
+ switch_on_type(property.type, updater);
+ }
ctx.did_change();
}
@@ -214,8 +244,16 @@ ValueType Object::get_property_value_impl(ContextType& ctx, const Property& prop
case PropertyType::UUID:
return is_nullable(property.type) ? ctx.box(m_obj.get>(column))
: ctx.box(m_obj.get(column));
- case PropertyType::Mixed:
- return ctx.box(m_obj.get(column));
+ case PropertyType::Mixed: {
+ Mixed value = m_obj.get(column);
+ if (value.is_type(type_Dictionary)) {
+ return ctx.box(object_store::Dictionary(m_realm, m_obj, column));
+ }
+ if (value.is_type(type_List)) {
+ return ctx.box(List(m_realm, m_obj, column));
+ }
+ return ctx.box(value);
+ }
case PropertyType::Object: {
auto linkObjectSchema = m_realm->schema().find(property.object_type);
auto linked = const_cast(m_obj).get_linked_object(column);
@@ -428,6 +466,272 @@ ObjKey Object::get_for_primary_key_in_migration(ContextType& ctx, Table const& t
return table.find_first(primary_prop.column_key, ctx.template unbox(primary_value));
}
+namespace _impl {
+
+template
+auto box_mixed(Context& ctx, const object_store::Collection& collection, const PathElement& path, Mixed value)
+{
+ if (value.is_type(type_Dictionary)) {
+ return ctx.box(collection.get_dictionary(path));
+ }
+ if (value.is_type(type_List)) {
+ return ctx.box(collection.get_list(path));
+ }
+ return ctx.box(value);
+}
+
+template
+void assign_collection(Context& ctx, object_store::Collection& collection, const PathElement& path,
+ CollectionType type, T&& value, CreatePolicy policy)
+{
+ switch (type) {
+ case CollectionType::List:
+ collection.get_list(path).assign(ctx, value, policy);
+ return;
+ case CollectionType::Dictionary:
+ collection.get_dictionary(path).assign(ctx, value, policy);
+ return;
+ default:
+ REALM_UNREACHABLE();
+ }
+}
+
+template
+inline std::optional collection_type(T)
+{
+ return {};
+}
+
+inline std::optional collection_type(Mixed m)
+{
+ static_assert(int(CollectionType::Dictionary) == int(type_Dictionary));
+ static_assert(int(CollectionType::List) == int(type_List));
+ if (m.is_type(type_Dictionary, type_List)) {
+ return static_cast(static_cast(m.get_type()));
+ }
+ return {};
+}
+
+template
+bool compare(const T& a, const T& b)
+{
+ return a == b;
+}
+inline bool compare(const Obj& a, const Obj& b)
+{
+ return a.get_key() == b.get_key();
+}
+inline bool compare(Mixed a, Mixed b)
+{
+ return a.is_same_type(b) && a == b;
+}
+
+} // namespace _impl
+
+template
+auto List::get(Context& ctx, size_t row_ndx) const
+{
+ if (m_type == PropertyType::Mixed) {
+ return _impl::box_mixed(ctx, *this, row_ndx, get(row_ndx));
+ }
+
+ return dispatch([&](auto t) {
+ return ctx.box(this->get>(row_ndx));
+ });
+}
+
+template
+size_t List::find(Context& ctx, T&& value) const
+{
+ return dispatch([&](auto t) {
+ return this->find(ctx.template unbox>(value, CreatePolicy::Skip));
+ });
+}
+
+template
+void List::add(Context& ctx, T&& value, CreatePolicy policy)
+{
+ this->insert(ctx, size(), std::move(value), policy);
+}
+
+template
+void List::insert(Context& ctx, size_t list_ndx, T&& value, CreatePolicy policy)
+{
+ if (m_is_embedded) {
+ validate_embedded(ctx, value, policy);
+ auto key = as().create_and_insert_linked_object(list_ndx).get_key();
+ ctx.template unbox(value, policy, key);
+ return;
+ }
+ dispatch([&](auto t) {
+ using U = std::decay_t;
+ auto new_val = ctx.template unbox(value, policy);
+ if (auto type = _impl::collection_type(new_val)) {
+ insert_collection(list_ndx, *type);
+ _impl::assign_collection(ctx, *this, list_ndx, *type, value, policy);
+ return;
+ }
+ this->insert(list_ndx, new_val);
+ });
+}
+
+template
+void List::set(Context& ctx, size_t list_ndx, T&& value, CreatePolicy policy)
+{
+ if (m_is_embedded) {
+ validate_embedded(ctx, value, policy);
+ auto& list = as();
+ auto key = policy.diff ? list.get(list_ndx) : list.create_and_set_linked_object(list_ndx).get_key();
+ ctx.template unbox(value, policy, key);
+ return;
+ }
+
+ dispatch([&](auto t) {
+ using U = std::decay_t;
+ U new_val;
+ if constexpr (std::is_same_v) {
+ auto old_key = this->get(list_ndx);
+ new_val = ctx.template unbox(value, policy, old_key);
+ }
+ else {
+ new_val = ctx.template unbox(value, policy);
+ }
+
+ if constexpr (std::is_same_v) {
+ if (auto type = _impl::collection_type(new_val)) {
+ set_collection(list_ndx, *type);
+ _impl::assign_collection(ctx, *this, list_ndx, *type, value, policy);
+ return;
+ }
+ }
+
+ if (policy.diff) {
+ auto old_value = this->get(list_ndx);
+ if (_impl::compare(old_value, new_val))
+ return;
+ }
+
+ this->set(list_ndx, new_val);
+ });
+}
+
+template
+void List::assign(Context& ctx, T&& values, CreatePolicy policy)
+{
+ if (ctx.is_same_list(*this, values))
+ return;
+
+ if (ctx.is_null(values)) {
+ remove_all();
+ return;
+ }
+
+ if (!policy.diff)
+ remove_all();
+
+ size_t sz = size();
+ size_t index = 0;
+ ctx.enumerate_collection(values, [&](auto&& element) {
+ if (index >= sz) {
+ this->add(ctx, element, policy);
+ }
+ else {
+ // If index is within legal range, policy.diff must be true -
+ // otherwise the list would have been cleared
+ REALM_ASSERT(policy.diff);
+ this->set(ctx, index, element, policy);
+ }
+ index++;
+ });
+ while (index < sz)
+ remove(--sz);
+}
+
+namespace object_store {
+
+template
+void Dictionary::insert(Context& ctx, StringData key, T&& value, CreatePolicy policy)
+{
+ if (ctx.is_null(value)) {
+ this->insert(key, Mixed());
+ return;
+ }
+ if (m_is_embedded) {
+ validate_embedded(ctx, value, policy);
+ auto old_value = dict().try_get(key);
+ auto obj_key = (policy.diff && old_value && !old_value->is_null())
+ ? old_value->get()
+ : dict().create_and_insert_linked_object(key).get_key();
+ ctx.template unbox(value, policy, obj_key);
+ return;
+ };
+
+ dispatch([&](auto t) {
+ using U = std::decay_t;
+ U new_val;
+ if constexpr (std::is_same_v) {
+ ObjKey old_key;
+ if (auto old_value = dict().try_get(key); old_value && !old_value->is_null()) {
+ // Value is either null or an ObjKey
+ old_key = old_value->get_link().get_obj_key();
+ }
+ new_val = ctx.template unbox(value, policy, old_key);
+ }
+ else {
+ new_val = ctx.template unbox(value, policy);
+ }
+
+ if constexpr (std::is_same_v) {
+ if (auto type = _impl::collection_type(new_val)) {
+ insert_collection(key, *type);
+ _impl::assign_collection(ctx, *this, key, *type, value, policy);
+ return;
+ }
+ }
+
+ if (policy.diff) {
+ if (auto old_value = dict().try_get(key)) {
+ if (_impl::compare(*old_value, new_val)) {
+ return;
+ }
+ }
+ }
+
+ dict().insert(key, new_val);
+ });
+}
+
+template
+auto Dictionary::get(Context& ctx, StringData key) const
+{
+ if (m_type == PropertyType::Mixed) {
+ return _impl::box_mixed(ctx, *this, key, get(key));
+ }
+ return dispatch([&](auto t) {
+ return ctx.box(this->get>(key));
+ });
+}
+
+template
+void Dictionary::assign(Context& ctx, T&& values, CreatePolicy policy)
+{
+ if (ctx.is_same_dictionary(*this, values))
+ return;
+
+ if (ctx.is_null(values)) {
+ remove_all();
+ return;
+ }
+
+ if (!policy.diff)
+ remove_all();
+
+ ctx.enumerate_dictionary(values, [&](StringData key, auto&& value) {
+ this->insert(ctx, key, value, policy);
+ });
+}
+
+} // namespace object_store
} // namespace realm
#endif // REALM_OS_OBJECT_ACCESSOR_HPP
diff --git a/src/realm/object-store/results.hpp b/src/realm/object-store/results.hpp
index 88c1c2b5a4f..d2e419869a0 100644
--- a/src/realm/object-store/results.hpp
+++ b/src/realm/object-store/results.hpp
@@ -411,10 +411,23 @@ auto Results::dispatch(Fn&& fn) const
}
template
-auto Results::get(Context& ctx, size_t row_ndx)
+auto Results::get(Context& ctx, size_t ndx)
{
return dispatch([&](auto t) {
- return ctx.box(this->get>(row_ndx));
+ using U = std::decay_t;
+ if constexpr (std::is_same_v) {
+ Mixed value = this->get(ndx);
+ if (value.is_type(type_Dictionary)) {
+ return ctx.box(get_dictionary(ndx));
+ }
+ if (value.is_type(type_List)) {
+ return ctx.box(get_list(ndx));
+ }
+ return ctx.box(value);
+ }
+ else {
+ return ctx.box(this->get(ndx));
+ }
});
}
diff --git a/src/realm/object-store/schema.cpp b/src/realm/object-store/schema.cpp
index 47cebb6a389..c129a9c1c5b 100644
--- a/src/realm/object-store/schema.cpp
+++ b/src/realm/object-store/schema.cpp
@@ -118,8 +118,8 @@ Schema::const_iterator Schema::find(TableKey table_key) const noexcept
namespace {
struct CheckObjectPath {
- const ObjectSchema& object; // the schema to check
- std::string path; // a printable path for error messaging
+ const ObjectSchema& object; // the schema to check
+ std::string path; // a printable path for error messaging
};
// a non-recursive search that returns a property path to the first embedded object cycle detected
diff --git a/src/realm/object-store/sync/app.cpp b/src/realm/object-store/sync/app.cpp
index 08d42aeb3f2..884d80ec7e3 100644
--- a/src/realm/object-store/sync/app.cpp
+++ b/src/realm/object-store/sync/app.cpp
@@ -1041,48 +1041,48 @@ void App::request_location(UniqueFunction)>&& compl
log_debug("App: request location: %1", req.url);
- m_config.transport->send_request_to_server(
- req, [self = shared_from_this(), completion = std::move(completion), base_url = std::move(base_url),
- redirect_count](const Response& response) mutable {
- // Check to see if a redirect occurred
- if (AppUtils::is_redirect_status_code(response.http_status_code)) {
- // Make sure we don't do too many redirects (max_http_redirects (20) is an arbitrary number)
- if (redirect_count >= s_max_http_redirects) {
- completion(AppError{ErrorCodes::ClientTooManyRedirects,
- util::format("number of redirections exceeded %1", s_max_http_redirects),
- {},
- response.http_status_code});
- return;
- }
- // Handle the redirect response when requesting the location - extract the
- // new location header field and resend the request.
- auto redir_location = AppUtils::extract_redir_location(response.headers);
- if (!redir_location) {
- // Location not found in the response, pass error response up the chain
- completion(AppError{ErrorCodes::ClientRedirectError,
- "Redirect response missing location header",
- {},
- response.http_status_code});
- return;
- }
- // try to request the location info at the new location in the redirect response
- // retry_count is passed in to track the number of subsequent redirection attempts
- self->request_location(std::move(completion), std::move(base_url), std::move(redir_location),
- redirect_count + 1);
+ m_config.transport->send_request_to_server(req, [self = shared_from_this(), completion = std::move(completion),
+ base_url = std::move(base_url),
+ redirect_count](const Response& response) mutable {
+ // Check to see if a redirect occurred
+ if (AppUtils::is_redirect_status_code(response.http_status_code)) {
+ // Make sure we don't do too many redirects (max_http_redirects (20) is an arbitrary number)
+ if (redirect_count >= s_max_http_redirects) {
+ completion(AppError{ErrorCodes::ClientTooManyRedirects,
+ util::format("number of redirections exceeded %1", s_max_http_redirects),
+ {},
+ response.http_status_code});
return;
}
-
- // Location request was successful - update the location info
- auto update_response = self->update_location(response, base_url);
- if (update_response) {
- self->log_error("App: request location failed (%1%2): %3", update_response->code_string(),
- update_response->additional_status_code
- ? util::format(" %1", *update_response->additional_status_code)
- : "",
- update_response->reason());
+ // Handle the redirect response when requesting the location - extract the
+ // new location header field and resend the request.
+ auto redir_location = AppUtils::extract_redir_location(response.headers);
+ if (!redir_location) {
+ // Location not found in the response, pass error response up the chain
+ completion(AppError{ErrorCodes::ClientRedirectError,
+ "Redirect response missing location header",
+ {},
+ response.http_status_code});
+ return;
}
- completion(update_response);
- });
+ // try to request the location info at the new location in the redirect response
+ // retry_count is passed in to track the number of subsequent redirection attempts
+ self->request_location(std::move(completion), std::move(base_url), std::move(redir_location),
+ redirect_count + 1);
+ return;
+ }
+
+ // Location request was successful - update the location info
+ auto update_response = self->update_location(response, base_url);
+ if (update_response) {
+ self->log_error("App: request location failed (%1%2): %3", update_response->code_string(),
+ update_response->additional_status_code
+ ? util::format(" %1", *update_response->additional_status_code)
+ : "",
+ update_response->reason());
+ }
+ completion(update_response);
+ });
}
std::optional App::update_location(const Response& response, const std::string& base_url)
@@ -1331,17 +1331,17 @@ void App::call_function(const std::shared_ptr& user, const std::string& na
auto args = util::format("{\"arguments\":%1,\"name\":%2%3}", args_ejson, nlohmann::json(name).dump(),
service_name_opt ? (",\"service\":" + nlohmann::json(service_name).dump()) : "");
- do_authenticated_request(
- HttpMethod::post, function_call_url_path(), std::move(args), user, RequestTokenType::AccessToken,
- [self = shared_from_this(), name = name, service_name = std::move(service_name),
- completion = std::move(completion)](const Response& response) {
- if (auto error = AppUtils::check_for_errors(response)) {
- self->log_error("App: call_function: %1 service_name: %2 -> %3 ERROR: %4", name, service_name,
- response.http_status_code, error->what());
- return completion(nullptr, error);
- }
- completion(&response.body, util::none);
- });
+ do_authenticated_request(HttpMethod::post, function_call_url_path(), std::move(args), user,
+ RequestTokenType::AccessToken,
+ [self = shared_from_this(), name = name, service_name = std::move(service_name),
+ completion = std::move(completion)](const Response& response) {
+ if (auto error = AppUtils::check_for_errors(response)) {
+ self->log_error("App: call_function: %1 service_name: %2 -> %3 ERROR: %4", name,
+ service_name, response.http_status_code, error->what());
+ return completion(nullptr, error);
+ }
+ completion(&response.body, util::none);
+ });
}
void App::call_function(const std::shared_ptr& user, const std::string& name, const BsonArray& args_bson,
diff --git a/src/realm/object-store/sync/async_open_task.cpp b/src/realm/object-store/sync/async_open_task.cpp
index 45f056ae05e..a261f94c943 100644
--- a/src/realm/object-store/sync/async_open_task.cpp
+++ b/src/realm/object-store/sync/async_open_task.cpp
@@ -195,25 +195,25 @@ void AsyncOpenTask::migrate_schema_or_complete(AsyncOpenCallback&& callback,
// * Then, pause the session, delete all tables, re-initialize the metadata, and finally restart the session.
// The lifetime of the task is extended until the bootstrap completes.
std::shared_ptr self(shared_from_this());
- session->wait_for_upload_completion([callback = std::move(callback), coordinator, session, self,
- this](Status status) mutable {
- {
- util::CheckedLockGuard lock(m_mutex);
- if (!m_session)
- return; // Swallow all events if the task has been cancelled.
- }
-
- if (!status.is_ok()) {
- self->async_open_complete(std::move(callback), coordinator, status);
- return;
- }
-
- auto migration_completed_callback = [callback = std::move(callback), coordinator = std::move(coordinator),
- self](Status status) mutable {
- self->wait_for_bootstrap_or_complete(std::move(callback), coordinator, status);
- };
- SyncSession::Internal::migrate_schema(*session, std::move(migration_completed_callback));
- });
+ session->wait_for_upload_completion(
+ [callback = std::move(callback), coordinator, session, self, this](Status status) mutable {
+ {
+ util::CheckedLockGuard lock(m_mutex);
+ if (!m_session)
+ return; // Swallow all events if the task has been cancelled.
+ }
+
+ if (!status.is_ok()) {
+ self->async_open_complete(std::move(callback), coordinator, status);
+ return;
+ }
+
+ auto migration_completed_callback = [callback = std::move(callback), coordinator = std::move(coordinator),
+ self](Status status) mutable {
+ self->wait_for_bootstrap_or_complete(std::move(callback), coordinator, status);
+ };
+ SyncSession::Internal::migrate_schema(*session, std::move(migration_completed_callback));
+ });
}
void AsyncOpenTask::wait_for_bootstrap_or_complete(AsyncOpenCallback&& callback,
diff --git a/src/realm/object-store/sync/sync_session.hpp b/src/realm/object-store/sync/sync_session.hpp
index 952fcc65faf..accba057903 100644
--- a/src/realm/object-store/sync/sync_session.hpp
+++ b/src/realm/object-store/sync/sync_session.hpp
@@ -42,7 +42,7 @@ namespace sync {
class Session;
struct SessionErrorInfo;
class MigrationStore;
-}
+} // namespace sync
namespace _impl {
class RealmCoordinator;
diff --git a/src/realm/object-store/util/atomic_shared_ptr.hpp b/src/realm/object-store/util/atomic_shared_ptr.hpp
index bac414aed32..48a47b5397f 100644
--- a/src/realm/object-store/util/atomic_shared_ptr.hpp
+++ b/src/realm/object-store/util/atomic_shared_ptr.hpp
@@ -31,12 +31,10 @@ namespace _impl {
// HasAtomicPtrOps to either true_type or false_type
template >
-struct HasAtomicPtrOps : std::false_type {
-};
+struct HasAtomicPtrOps : std::false_type {};
template
-struct HasAtomicPtrOps()))>> : std::true_type {
-};
+struct HasAtomicPtrOps()))>> : std::true_type {};
} // namespace _impl
namespace util {
diff --git a/src/realm/object-store/util/event_loop_dispatcher.hpp b/src/realm/object-store/util/event_loop_dispatcher.hpp
index a9a429b1bd3..a194a8ea6f5 100644
--- a/src/realm/object-store/util/event_loop_dispatcher.hpp
+++ b/src/realm/object-store/util/event_loop_dispatcher.hpp
@@ -67,8 +67,7 @@ class EventLoopDispatcher {
namespace _impl::ForEventLoopDispatcher {
template
-struct ExtractSignatureImpl {
-};
+struct ExtractSignatureImpl {};
template
struct ExtractSignatureImpl {
using signature = void(Args...);
diff --git a/src/realm/object_id.cpp b/src/realm/object_id.cpp
index 8a599242ba0..95ad4e8d76f 100644
--- a/src/realm/object_id.cpp
+++ b/src/realm/object_id.cpp
@@ -52,8 +52,9 @@ static_assert(sizeof(ObjectId) == 12, "changing the size of an ObjectId is a fil
bool ObjectId::is_valid_str(StringData str) noexcept
{
- return str.size() == 24 &&
- std::all_of(str.data(), str.data() + str.size(), [](unsigned char c) { return std::isxdigit(c); });
+ return str.size() == 24 && std::all_of(str.data(), str.data() + str.size(), [](unsigned char c) {
+ return std::isxdigit(c);
+ });
}
ObjectId::ObjectId(StringData init) noexcept
diff --git a/src/realm/owned_data.hpp b/src/realm/owned_data.hpp
index c707f9da4cf..9d3ee6f688c 100644
--- a/src/realm/owned_data.hpp
+++ b/src/realm/owned_data.hpp
@@ -30,9 +30,7 @@ namespace realm {
class OwnedData {
public:
/// Construct a null reference.
- OwnedData() noexcept
- {
- }
+ OwnedData() noexcept {}
/// If \a data_to_copy is 'null', \a data_size must be zero.
OwnedData(const char* data_to_copy, size_t data_size)
diff --git a/src/realm/parser/driver.hpp b/src/realm/parser/driver.hpp
index e255b45bc67..207460a4958 100644
--- a/src/realm/parser/driver.hpp
+++ b/src/realm/parser/driver.hpp
@@ -145,8 +145,7 @@ class ExpressionNode : public ParserNode {
/******************************** Value Nodes ********************************/
-class ValueNode : public ExpressionNode {
-};
+class ValueNode : public ExpressionNode {};
class ConstantNode : public ValueNode {
public:
diff --git a/src/realm/query.hpp b/src/realm/query.hpp
index b3b2ac5a385..6b3c7a77afa 100644
--- a/src/realm/query.hpp
+++ b/src/realm/query.hpp
@@ -401,8 +401,8 @@ class Query final {
// m_source_collection is a pointer to a collection which must also be a ObjList*
// this includes: LnkLst, LnkSet, and DictionaryLinkValues. It cannot be a list of primitives because
// it is used to populate a query through a collection of objects and there are asserts for this.
- LinkCollectionPtr m_source_collection; // collections are owned by the query.
- TableView* m_source_table_view = nullptr; // table views are not refcounted, and not owned by the query.
+ LinkCollectionPtr m_source_collection; // collections are owned by the query.
+ TableView* m_source_table_view = nullptr; // table views are not refcounted, and not owned by the query.
std::unique_ptr m_owned_source_table_view; // <--- except when indicated here
util::bind_ptr m_ordering;
};
diff --git a/src/realm/query_conditions.hpp b/src/realm/query_conditions.hpp
index 5fdc8de31c3..cf3cf9e73d8 100644
--- a/src/realm/query_conditions.hpp
+++ b/src/realm/query_conditions.hpp
@@ -63,7 +63,7 @@ struct Contains : public HackClass {
{
return v2.contains(v1);
}
- bool operator()(StringData v1, const std::array &charmap, StringData v2) const
+ bool operator()(StringData v1, const std::array& charmap, StringData v2) const
{
return v2.contains(v1, charmap);
}
@@ -389,14 +389,15 @@ struct ContainsIns : public HackClass {
}
// Case insensitive Boyer-Moore version
- bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, const std::array &charmap, StringData v2) const
+ bool operator()(StringData v1, const char* v1_upper, const char* v1_lower,
+ const std::array& charmap, StringData v2) const
{
if (v2.is_null() && !v1.is_null())
return false;
-
+
if (v1.size() == 0 && !v2.is_null())
return true;
-
+
return contains_ins(v2, v1_upper, v1_lower, v1.size(), charmap);
}
diff --git a/src/realm/query_engine.hpp b/src/realm/query_engine.hpp
index 9a84dda2284..57ae09fa731 100644
--- a/src/realm/query_engine.hpp
+++ b/src/realm/query_engine.hpp
@@ -180,9 +180,7 @@ class ParentNode {
cluster_changed();
}
- virtual void collect_dependencies(std::vector&) const
- {
- }
+ virtual void collect_dependencies(std::vector&) const {}
virtual size_t find_first_local(size_t start, size_t end) = 0;
virtual size_t find_all_local(size_t start, size_t end);
@@ -286,9 +284,7 @@ class ParentNode {
}
private:
- virtual void table_changed()
- {
- }
+ virtual void table_changed() {}
virtual void cluster_changed()
{
// TODO: Should eventually be pure
@@ -311,7 +307,6 @@ class ColumnNodeBase : public ParentNode {
: ParentNode(from)
{
}
-
};
class IndexEvaluator {
diff --git a/src/realm/query_expression.hpp b/src/realm/query_expression.hpp
index bb659a0e8bc..24b43af8c66 100644
--- a/src/realm/query_expression.hpp
+++ b/src/realm/query_expression.hpp
@@ -2076,7 +2076,7 @@ class Columns : public SimpleQuerySupport {
}
}
if (!index.set_size(m_ctrl.matches.size())) {
- dest.init(true, 0);
+ destination.init(true, 0);
return;
}
}
diff --git a/src/realm/sort_descriptor.hpp b/src/realm/sort_descriptor.hpp
index 09e9b6b07b6..0224ea5de6b 100644
--- a/src/realm/sort_descriptor.hpp
+++ b/src/realm/sort_descriptor.hpp
@@ -78,16 +78,15 @@ class BaseDescriptor {
public:
Sorter(std::vector> const& columns, std::vector const& ascending,
Table const& root_table, const IndexPairs& indexes);
- Sorter()
- {
- }
+ Sorter() {}
bool operator()(IndexPair i, IndexPair j, bool total_ordering = true) const;
bool has_links() const
{
- return std::any_of(m_columns.begin(), m_columns.end(),
- [](auto&& col) { return !col.translated_keys.empty(); });
+ return std::any_of(m_columns.begin(), m_columns.end(), [](auto&& col) {
+ return !col.translated_keys.empty();
+ });
}
bool any_is_null(IndexPair i) const
@@ -345,10 +344,11 @@ class DescriptorOrdering : public util::AtomicRefCountBase {
std::string get_description(ConstTableRef target_table) const;
void collect_dependencies(const Table* table);
void get_versions(const Group* group, TableVersions& versions) const;
+
private:
std::vector> m_descriptors;
std::vector m_dependencies;
};
-}
+} // namespace realm
#endif /* REALM_SORT_DESCRIPTOR_HPP */
diff --git a/src/realm/spec.hpp b/src/realm/spec.hpp
index 9db898cb969..c9f3ff0c230 100644
--- a/src/realm/spec.hpp
+++ b/src/realm/spec.hpp
@@ -101,8 +101,8 @@ class Spec {
ArrayStringShort m_names; // 2nd slot in m_top
Array m_attr; // 3rd slot in m_top
// 4th slot in m_top not cached
- Array m_enumkeys; // 5th slot in m_top
- Array m_keys; // 6th slot in m_top
+ Array m_enumkeys; // 5th slot in m_top
+ Array m_keys; // 6th slot in m_top
size_t m_num_public_columns = 0;
Spec(Allocator&) noexcept; // Unattached
diff --git a/src/realm/string_data.cpp b/src/realm/string_data.cpp
index 1c1787db560..9d00fa2dcaa 100644
--- a/src/realm/string_data.cpp
+++ b/src/realm/string_data.cpp
@@ -25,8 +25,8 @@ using namespace realm;
namespace {
template
-REALM_FORCEINLINE
-bool matchlike(const StringData& text, const StringData& pattern, const StringData* alternate_pattern=nullptr) noexcept
+REALM_FORCEINLINE bool matchlike(const StringData& text, const StringData& pattern,
+ const StringData* alternate_pattern = nullptr) noexcept
{
// If alternate_pattern is provided, it is assumed to differ from `pattern` only in case.
REALM_ASSERT_DEBUG(has_alternate_pattern == bool(alternate_pattern));
diff --git a/src/realm/string_data.hpp b/src/realm/string_data.hpp
index d174b7fbbd7..46e1df0713d 100644
--- a/src/realm/string_data.hpp
+++ b/src/realm/string_data.hpp
@@ -143,8 +143,8 @@ class StringData {
constexpr bool begins_with(StringData) const noexcept;
constexpr bool ends_with(StringData) const noexcept;
constexpr bool contains(StringData) const noexcept;
- bool contains(StringData d, const std::array &charmap) const noexcept;
-
+ bool contains(StringData d, const std::array& charmap) const noexcept;
+
// Wildcard matching ('?' for single char, '*' for zero or more chars)
// case insensitive version in unicode.hpp
bool like(StringData) const noexcept;
@@ -312,40 +312,40 @@ constexpr inline bool StringData::contains(StringData d) const noexcept
/// This method takes an array that maps chars to distance that can be moved (and zero for chars not in needle),
/// allowing the method to apply Boyer-Moore for quick substring search
/// The map is calculated in the StringNode class (so it can be reused across searches)
-inline bool StringData::contains(StringData d, const std::array &charmap) const noexcept
+inline bool StringData::contains(StringData d, const std::array& charmap) const noexcept
{
if (is_null() && !d.is_null())
return false;
-
+
size_t needle_size = d.size();
if (needle_size == 0)
return true;
-
+
// Prepare vars to avoid lookups in loop
- size_t last_char_pos = d.size()-1;
+ size_t last_char_pos = d.size() - 1;
unsigned char lastChar = d[last_char_pos];
-
+
// Do Boyer-Moore search
size_t p = last_char_pos;
while (p < m_size) {
unsigned char c = m_data[p]; // Get candidate for last char
-
+
if (c == lastChar) {
- StringData candidate = substr(p-needle_size+1, needle_size);
+ StringData candidate = substr(p - needle_size + 1, needle_size);
if (candidate == d)
return true; // text found!
}
-
+
// If we don't have a match, see how far we can move char_pos
if (charmap[c] == 0)
p += needle_size; // char was not present in search string
else
p += charmap[c];
}
-
+
return false;
}
-
+
inline bool StringData::like(StringData d) const noexcept
{
if (is_null() || d.is_null()) {
diff --git a/src/realm/sync/client.cpp b/src/realm/sync/client.cpp
index d68f254b1d6..494973a471e 100644
--- a/src/realm/sync/client.cpp
+++ b/src/realm/sync/client.cpp
@@ -1402,7 +1402,7 @@ void SessionWrapper::on_commit(version_type new_version)
if (REALM_UNLIKELY(!self->m_sess))
return; // Already finalized
SessionImpl& sess = *self->m_sess;
- sess.recognize_sync_version(new_version); // Throws
+ sess.recognize_sync_version(new_version); // Throws
self->on_upload_progress(/* only_if_new_uploadable_data = */ true); // Throws
});
}
diff --git a/src/realm/sync/instruction_applier.cpp b/src/realm/sync/instruction_applier.cpp
index a8673e74c60..72139b77b66 100644
--- a/src/realm/sync/instruction_applier.cpp
+++ b/src/realm/sync/instruction_applier.cpp
@@ -174,66 +174,65 @@ void InstructionApplier::operator()(const Instruction::CreateObject& instr)
ColKey pk_col = table->get_primary_key_column();
m_last_object_key = instr.object;
- mpark::visit(
- util::overload{
- [&](mpark::monostate) {
- if (!pk_col) {
- bad_transaction_log("CreateObject(NULL) on table without a primary key");
- }
- if (!table->is_nullable(pk_col)) {
- bad_transaction_log("CreateObject(NULL) on a table with a non-nullable primary key");
- }
- m_last_object = table->create_object_with_primary_key(util::none);
- },
- [&](int64_t pk) {
- if (!pk_col) {
- bad_transaction_log("CreateObject(Int) on table without a primary key");
- }
- if (table->get_column_type(pk_col) != type_Int) {
- bad_transaction_log("CreateObject(Int) on a table with primary key type %1",
- table->get_column_type(pk_col));
- }
- m_last_object = table->create_object_with_primary_key(pk);
- },
- [&](InternString pk) {
- if (!pk_col) {
- bad_transaction_log("CreateObject(String) on table without a primary key");
- }
- if (table->get_column_type(pk_col) != type_String) {
- bad_transaction_log("CreateObject(String) on a table with primary key type %1",
- table->get_column_type(pk_col));
- }
- StringData str = get_string(pk);
- m_last_object = table->create_object_with_primary_key(str);
- },
- [&](const ObjectId& id) {
- if (!pk_col) {
- bad_transaction_log("CreateObject(ObjectId) on table without a primary key");
- }
- if (table->get_column_type(pk_col) != type_ObjectId) {
- bad_transaction_log("CreateObject(ObjectId) on a table with primary key type %1",
- table->get_column_type(pk_col));
- }
- m_last_object = table->create_object_with_primary_key(id);
- },
- [&](const UUID& id) {
- if (!pk_col) {
- bad_transaction_log("CreateObject(UUID) on table without a primary key");
- }
- if (table->get_column_type(pk_col) != type_UUID) {
- bad_transaction_log("CreateObject(UUID) on a table with primary key type %1",
- table->get_column_type(pk_col));
- }
- m_last_object = table->create_object_with_primary_key(id);
- },
- [&](GlobalKey key) {
- if (pk_col) {
- bad_transaction_log("CreateObject(GlobalKey) on table with a primary key");
- }
- m_last_object = table->create_object(key);
- },
- },
- instr.object);
+ mpark::visit(util::overload{
+ [&](mpark::monostate) {
+ if (!pk_col) {
+ bad_transaction_log("CreateObject(NULL) on table without a primary key");
+ }
+ if (!table->is_nullable(pk_col)) {
+ bad_transaction_log("CreateObject(NULL) on a table with a non-nullable primary key");
+ }
+ m_last_object = table->create_object_with_primary_key(util::none);
+ },
+ [&](int64_t pk) {
+ if (!pk_col) {
+ bad_transaction_log("CreateObject(Int) on table without a primary key");
+ }
+ if (table->get_column_type(pk_col) != type_Int) {
+ bad_transaction_log("CreateObject(Int) on a table with primary key type %1",
+ table->get_column_type(pk_col));
+ }
+ m_last_object = table->create_object_with_primary_key(pk);
+ },
+ [&](InternString pk) {
+ if (!pk_col) {
+ bad_transaction_log("CreateObject(String) on table without a primary key");
+ }
+ if (table->get_column_type(pk_col) != type_String) {
+ bad_transaction_log("CreateObject(String) on a table with primary key type %1",
+ table->get_column_type(pk_col));
+ }
+ StringData str = get_string(pk);
+ m_last_object = table->create_object_with_primary_key(str);
+ },
+ [&](const ObjectId& id) {
+ if (!pk_col) {
+ bad_transaction_log("CreateObject(ObjectId) on table without a primary key");
+ }
+ if (table->get_column_type(pk_col) != type_ObjectId) {
+ bad_transaction_log("CreateObject(ObjectId) on a table with primary key type %1",
+ table->get_column_type(pk_col));
+ }
+ m_last_object = table->create_object_with_primary_key(id);
+ },
+ [&](const UUID& id) {
+ if (!pk_col) {
+ bad_transaction_log("CreateObject(UUID) on table without a primary key");
+ }
+ if (table->get_column_type(pk_col) != type_UUID) {
+ bad_transaction_log("CreateObject(UUID) on a table with primary key type %1",
+ table->get_column_type(pk_col));
+ }
+ m_last_object = table->create_object_with_primary_key(id);
+ },
+ [&](GlobalKey key) {
+ if (pk_col) {
+ bad_transaction_log("CreateObject(GlobalKey) on table with a primary key");
+ }
+ m_last_object = table->create_object(key);
+ },
+ },
+ instr.object);
}
void InstructionApplier::operator()(const Instruction::EraseObject& instr)
diff --git a/src/realm/sync/network/default_socket.hpp b/src/realm/sync/network/default_socket.hpp
index 81c956631d1..33dbc3730d0 100644
--- a/src/realm/sync/network/default_socket.hpp
+++ b/src/realm/sync/network/default_socket.hpp
@@ -46,8 +46,7 @@ class DefaultSocketProvider : public SyncSocketProvider {
network::DeadlineTimer m_timer;
};
- struct AutoStartTag {
- };
+ struct AutoStartTag {};
using AutoStart = util::TaggedBool;
DefaultSocketProvider(const std::shared_ptr& logger, const std::string& user_agent,
diff --git a/src/realm/sync/noinst/changeset_index.hpp b/src/realm/sync/noinst/changeset_index.hpp
index 30753782226..0280b11621b 100644
--- a/src/realm/sync/noinst/changeset_index.hpp
+++ b/src/realm/sync/noinst/changeset_index.hpp
@@ -178,8 +178,7 @@ struct ChangesetIndex::RangeIterator {
}
}
- struct end_tag {
- };
+ struct end_tag {};
/// Create an iterator representing the end.
RangeIterator(ChangesetIndex::Ranges* ranges, end_tag) noexcept
: m_ranges(ranges)
diff --git a/src/realm/sync/noinst/client_impl_base.hpp b/src/realm/sync/noinst/client_impl_base.hpp
index 5d85111c2c5..5bcb38e0067 100644
--- a/src/realm/sync/noinst/client_impl_base.hpp
+++ b/src/realm/sync/noinst/client_impl_base.hpp
@@ -291,8 +291,8 @@ class ClientImpl {
std::mutex m_mutex;
- bool m_stopped = false; // Protected by `m_mutex`
- bool m_sessions_terminated = false; // Protected by `m_mutex`
+ bool m_stopped = false; // Protected by `m_mutex`
+ bool m_sessions_terminated = false; // Protected by `m_mutex`
// The set of session wrappers that are not yet wrapping a session object,
// and are not yet abandoned (still referenced by the application).
diff --git a/src/realm/sync/noinst/server/server.cpp b/src/realm/sync/noinst/server/server.cpp
index e2a0d53e249..aeac91412f5 100644
--- a/src/realm/sync/noinst/server/server.cpp
+++ b/src/realm/sync/noinst/server/server.cpp
@@ -4052,8 +4052,8 @@ void ServerImpl::handle_accept(std::error_code ec)
else {
HTTPConnection& conn = *m_next_http_conn;
if (m_config.tcp_no_delay)
- conn.get_socket().set_option(network::SocketBase::no_delay(true)); // Throws
- m_http_connections.emplace(conn.get_id(), std::move(m_next_http_conn)); // Throws
+ conn.get_socket().set_option(network::SocketBase::no_delay(true)); // Throws
+ m_http_connections.emplace(conn.get_id(), std::move(m_next_http_conn)); // Throws
Formatter& formatter = m_misc_buffers.formatter;
formatter.reset();
formatter << "[" << m_next_http_conn_endpoint.address() << "]:" << m_next_http_conn_endpoint.port(); // Throws
diff --git a/src/realm/sync/noinst/server/server_history.cpp b/src/realm/sync/noinst/server/server_history.cpp
index cbaeaf87910..e5764e1c574 100644
--- a/src/realm/sync/noinst/server/server_history.cpp
+++ b/src/realm/sync/noinst/server/server_history.cpp
@@ -1330,8 +1330,8 @@ _impl::History* ServerHistory::_get_history_write()
// Overriding member in Replication
std::unique_ptr<_impl::History> ServerHistory::_create_history_read()
{
- auto server_hist = std::make_unique(m_context); // Throws
- server_hist->initialize(*m_db); // Throws
+ auto server_hist = std::make_unique(m_context); // Throws
+ server_hist->initialize(*m_db); // Throws
return std::unique_ptr<_impl::History>(server_hist.release());
}
diff --git a/src/realm/sync/noinst/sync_metadata_schema.hpp b/src/realm/sync/noinst/sync_metadata_schema.hpp
index 0c6ac6040ff..2bd8efa2993 100644
--- a/src/realm/sync/noinst/sync_metadata_schema.hpp
+++ b/src/realm/sync/noinst/sync_metadata_schema.hpp
@@ -36,7 +36,7 @@ namespace internal_schema_groups {
constexpr static std::string_view c_flx_subscription_store("flx_subscription_store");
constexpr static std::string_view c_pending_bootstraps("pending_bootstraps");
constexpr static std::string_view c_flx_migration_store("flx_migration_store");
-}
+} // namespace internal_schema_groups
/*
* The types in this file represent the schema for tables used internally by the sync client. They are similar
@@ -88,8 +88,7 @@ struct SyncMetadataTable {
util::Optional pk_info;
std::vector columns;
- struct IsEmbeddedTag {
- };
+ struct IsEmbeddedTag {};
SyncMetadataTable(TableKey* out, std::string_view name, IsEmbeddedTag,
std::initializer_list columns)
: key_out(out)
diff --git a/src/realm/sync/protocol.hpp b/src/realm/sync/protocol.hpp
index 11e11217c9e..4142281fdab 100644
--- a/src/realm/sync/protocol.hpp
+++ b/src/realm/sync/protocol.hpp
@@ -57,8 +57,6 @@ namespace sync {
// Server replaces 'downloadable_bytes' (which was always zero prior this version)
// with an estimated progress value (double from 0.0 to 1.0) for flx sessions
//
-// 13 Support for syncing collections (lists and dictionaries) in Mixed columns
-//
// XX Changes:
// - TBD
//
@@ -66,7 +64,7 @@ constexpr int get_current_protocol_version() noexcept
{
// Also update the current protocol version test in flx_sync.cpp when
// updating this value
- return 13;
+ return 12;
}
constexpr std::string_view get_pbs_websocket_protocol_prefix() noexcept
diff --git a/src/realm/sync/subscriptions.hpp b/src/realm/sync/subscriptions.hpp
index 751ec84e457..8b735d53ac4 100644
--- a/src/realm/sync/subscriptions.hpp
+++ b/src/realm/sync/subscriptions.hpp
@@ -190,8 +190,7 @@ class SubscriptionSet {
protected:
friend class SubscriptionStore;
- struct SupersededTag {
- };
+ struct SupersededTag {};
using MakingMutableCopy = util::TaggedBool;
explicit SubscriptionSet(std::weak_ptr mgr, int64_t version, SupersededTag);
diff --git a/src/realm/table.hpp b/src/realm/table.hpp
index a7785f1863f..e175c6548f4 100644
--- a/src/realm/table.hpp
+++ b/src/realm/table.hpp
@@ -63,8 +63,7 @@ template
class SubQuery;
class TableView;
-struct Link {
-};
+struct Link {};
typedef Link BackLink;
@@ -728,13 +727,13 @@ class Table {
{
m_alloc.refresh_ref_translation();
}
- Spec m_spec; // 1st slot in m_top
- ClusterTree m_clusters; // 3rd slot in m_top
- std::unique_ptr m_tombstones; // 13th slot in m_top
- TableKey m_key; // 4th slot in m_top
- Array m_index_refs; // 5th slot in m_top
- Array m_opposite_table; // 7th slot in m_top
- Array m_opposite_column; // 8th slot in m_top
+ Spec m_spec; // 1st slot in m_top
+ ClusterTree m_clusters; // 3rd slot in m_top
+ std::unique_ptr m_tombstones; // 13th slot in m_top
+ TableKey m_key; // 4th slot in m_top
+ Array m_index_refs; // 5th slot in m_top
+ Array m_opposite_table; // 7th slot in m_top
+ Array m_opposite_column; // 8th slot in m_top
std::vector> m_index_accessors;
ColKey m_primary_key_col;
Replication* const* m_repl;
diff --git a/src/realm/table_ref.cpp b/src/realm/table_ref.cpp
index 16953b443ac..a65a7ceb33d 100644
--- a/src/realm/table_ref.cpp
+++ b/src/realm/table_ref.cpp
@@ -75,4 +75,4 @@ Table* TableRef::operator->() const
}
-}
+} // namespace realm
diff --git a/src/realm/table_view.cpp b/src/realm/table_view.cpp
index 4fbd2cab501..8b06208192c 100644
--- a/src/realm/table_view.cpp
+++ b/src/realm/table_view.cpp
@@ -70,8 +70,7 @@ TableView::TableView(TableView& src, Transaction* tr, PayloadPolicy policy_mode)
// Aggregates ----------------------------------------------------
template
-struct Aggregator {
-};
+struct Aggregator {};
template
struct Aggregator {
diff --git a/src/realm/timestamp.hpp b/src/realm/timestamp.hpp
index 5e77f2717fe..77f71f30a05 100644
--- a/src/realm/timestamp.hpp
+++ b/src/realm/timestamp.hpp
@@ -224,6 +224,6 @@ struct numeric_limits {
return realm::Timestamp(numeric_limits::max(), 0);
}
};
-}
+} // namespace std
#endif // REALM_TIMESTAMP_HPP
diff --git a/src/realm/tools/unicode_table_generator.cpp b/src/realm/tools/unicode_table_generator.cpp
index 9cd2b6626d2..45d67afcd8f 100644
--- a/src/realm/tools/unicode_table_generator.cpp
+++ b/src/realm/tools/unicode_table_generator.cpp
@@ -6,9 +6,7 @@
#include
#include
-std::vector tokenize(const char* src,
- char delim,
- bool want_empty_tokens = true)
+std::vector tokenize(const char* src, char delim, bool want_empty_tokens = true)
{
std::vector tokens;
@@ -49,20 +47,20 @@ int main()
std::cout << "static const uint32_t upper_lower[" << last_unicode << " + 1][2] = {";
- while (std::getline(infile, line))
- {
+ while (std::getline(infile, line)) {
std::istringstream iss(line);
std::vector v = tokenize(line.c_str(), ';');
uint32_t in = hex2int(v[0]);
gap:
- // The unicode characters in UnicodeData.txt can have gaps, i.e. increase by more than 1 for each new line. For skipped
- // characters (i.e. characters that have no case conversion that makes sense), we want to just return the same character
- // as we got as input. Signal that by a {0, 0}-entry.
+ // The unicode characters in UnicodeData.txt can have gaps, i.e. increase by more than 1 for each new line.
+ // For skipped characters (i.e. characters that have no case conversion that makes sense), we want to just
+ // return the same character as we got as input. Signal that by a {0, 0}-entry.
if (in > code)
std::cout << "{0, 0}";
else
- std::cout << "{" << (v[12] != "" ? "0x" + v[12] : "0") << ", " << (v[13] != "" ? "0x" + v[13] : "0") << "}";
+ std::cout << "{" << (v[12] != "" ? "0x" + v[12] : "0") << ", " << (v[13] != "" ? "0x" + v[13] : "0")
+ << "}";
if (code != last_unicode)
std::cout << ", ";
@@ -83,4 +81,3 @@ int main()
return 0;
}
-
diff --git a/src/realm/util/backtrace.hpp b/src/realm/util/backtrace.hpp
index 801102392d3..4645d397dbc 100644
--- a/src/realm/util/backtrace.hpp
+++ b/src/realm/util/backtrace.hpp
@@ -43,9 +43,7 @@ struct Backtrace {
void print(std::ostream&) const;
/// Construct an empty stack trace.
- Backtrace() noexcept
- {
- }
+ Backtrace() noexcept {}
/// Move constructor. This operation cannot fail.
Backtrace(Backtrace&&) noexcept;
diff --git a/src/realm/util/base64.cpp b/src/realm/util/base64.cpp
index e6632c32c61..e8361dfd860 100644
--- a/src/realm/util/base64.cpp
+++ b/src/realm/util/base64.cpp
@@ -21,16 +21,17 @@
#include
#if defined(_MSC_VER)
-# define REALM_RESTRICT __restrict
+#define REALM_RESTRICT __restrict
#elif defined(__GNUC__) || defined(__clang__)
-# define REALM_RESTRICT __restrict__
+#define REALM_RESTRICT __restrict__
#else
-# define REALM_RESTRICT
+#define REALM_RESTRICT
#endif
namespace {
+// clang-format off
static const char g_base64_encoding_chars[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
@@ -61,6 +62,7 @@ static const unsigned char g_base64_chars[] = {
66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66
};
+// clang-format on
inline unsigned int index_of_base64_byte(unsigned char c)
{
@@ -126,9 +128,9 @@ std::optional base64_decode(Span input, Span out_buffe
char* REALM_RESTRICT o = out_buffer.data();
enum b64_byte_type {
- equals = 64, // used as padding at the end
+ equals = 64, // used as padding at the end
whitespace = 65,
- invalid = 66,
+ invalid = 66,
};
size_t bytes_written = 0;
@@ -139,9 +141,13 @@ std::optional base64_decode(Span input, Span out_buffe
// classify the base64 character
unsigned int x = index_of_base64_byte(static_cast(p[i]));
switch (x) {
- case equals: ++num_trailing_equals; continue;
- case whitespace: continue; // ignore whitespace
- case invalid: return none;
+ case equals:
+ ++num_trailing_equals;
+ continue;
+ case whitespace:
+ continue; // ignore whitespace
+ case invalid:
+ return none;
}
if (num_trailing_equals > 0)
@@ -153,8 +159,8 @@ std::optional base64_decode(Span input, Span out_buffe
if (buffer_size == 4) {
*o++ = (buffer >> 16) & 0xff;
- *o++ = (buffer >> 8) & 0xff;
- *o++ = (buffer >> 0) & 0xff;
+ *o++ = (buffer >> 8) & 0xff;
+ *o++ = (buffer >> 0) & 0xff;
buffer = 0;
buffer_size = 0;
bytes_written += 3;
@@ -166,7 +172,7 @@ std::optional base64_decode(Span input, Span out_buffe
if (num_trailing_equals == 0 && extra > 1) {
num_trailing_equals = 4 - extra;
}
-
+
// trailing bytes
if (num_trailing_equals == 0) {
if (buffer_size != 0)
@@ -174,11 +180,11 @@ std::optional base64_decode(Span input, Span out_buffe
}
else if (num_trailing_equals == 1) {
*o++ = (buffer >> 10) & 0xff;
- *o++ = (buffer >> 2) & 0xff;
+ *o++ = (buffer >> 2) & 0xff;
bytes_written += 2;
}
else if (num_trailing_equals == 2) {
- *o++ = (buffer >> 4) & 0xff;
+ *o++ = (buffer >> 4) & 0xff;
bytes_written += 1;
}
else {
diff --git a/src/realm/util/base64.hpp b/src/realm/util/base64.hpp
index d47e9d02a64..2c78ebdfe02 100644
--- a/src/realm/util/base64.hpp
+++ b/src/realm/util/base64.hpp
@@ -62,7 +62,6 @@ inline size_t base64_decoded_size(size_t base64_size) noexcept
}
-
/// base64_decode_to_vector() is a convenience function that decodes \param
/// encoded and returns the result in a std::vector with the correct size.
/// This function returns none if the input is invalid.
@@ -71,4 +70,3 @@ std::optional> base64_decode_to_vector(Span encode
} // namespace realm::util
#endif // REALM_UTIL_BASE64_HPP
-
diff --git a/src/realm/util/bind_ptr.hpp b/src/realm/util/bind_ptr.hpp
index 355648e3f1a..57bb8b9ed78 100644
--- a/src/realm/util/bind_ptr.hpp
+++ b/src/realm/util/bind_ptr.hpp
@@ -34,8 +34,7 @@ namespace util {
class bind_ptr_base {
public:
- struct adopt_tag {
- };
+ struct adopt_tag {};
};
@@ -234,8 +233,7 @@ class bind_ptr : public bind_ptr_base {
}
protected:
- struct casting_move_tag {
- };
+ struct casting_move_tag {};
template
bind_ptr(bind_ptr* p, casting_move_tag) noexcept
: m_ptr(static_cast(p->release()))
diff --git a/src/realm/util/cf_ptr.hpp b/src/realm/util/cf_ptr.hpp
index a1ec431f1b0..0c97c21034f 100644
--- a/src/realm/util/cf_ptr.hpp
+++ b/src/realm/util/cf_ptr.hpp
@@ -99,8 +99,8 @@ CFPtr[ retainCF(Ref ptr)
CFRetain(ptr);
return CFPtr][(ptr);
}
-}
-}
+} // namespace util
+} // namespace realm
#endif // REALM_PLATFORM_APPLE
diff --git a/src/realm/util/fifo_helper.hpp b/src/realm/util/fifo_helper.hpp
index 441bd29b3fe..f9dadc19f33 100644
--- a/src/realm/util/fifo_helper.hpp
+++ b/src/realm/util/fifo_helper.hpp
@@ -34,7 +34,8 @@ void create_fifo(std::string_view path); // throws
bool try_create_fifo(std::string_view path, bool has_more_fallbacks = true);
// Ensure that a path representing a directory ends with `/`
-inline std::string normalize_dir(const std::string& path) {
+inline std::string normalize_dir(const std::string& path)
+{
return (!path.empty() && path.back() != '/') ? path + '/' : path;
}
diff --git a/src/realm/util/file.cpp b/src/realm/util/file.cpp
index a0e472aa49b..6a604db8a8e 100644
--- a/src/realm/util/file.cpp
+++ b/src/realm/util/file.cpp
@@ -1578,7 +1578,7 @@ bool File::copy(const std::string& origin_path, const std::string& target_path,
}
#endif
- File origin_file{origin_path, mode_Read}; // Throws
+ File origin_file{origin_path, mode_Read}; // Throws
File target_file;
bool did_create = false;
target_file.open(target_path, did_create); // Throws
diff --git a/src/realm/util/functional.hpp b/src/realm/util/functional.hpp
index aee92d2fcdd..bd9894cf86d 100644
--- a/src/realm/util/functional.hpp
+++ b/src/realm/util/functional.hpp
@@ -169,20 +169,15 @@ class UniqueFunction {
* function pointers. We don't currently support r-value-qualified call operators.
*/
template
-struct UFDeductionHelper {
-};
+struct UFDeductionHelper {};
template
-struct UFDeductionHelper : TypeIdentity {
-};
+struct UFDeductionHelper : TypeIdentity {};
template
-struct UFDeductionHelper : TypeIdentity {
-};
+struct UFDeductionHelper : TypeIdentity {};
template
-struct UFDeductionHelper : TypeIdentity {
-};
+struct UFDeductionHelper : TypeIdentity {};
template
-struct UFDeductionHelper : TypeIdentity {
-};
+struct UFDeductionHelper : TypeIdentity {};
/**
* Deduction guides for UniqueFunction that pluck the signature off of function pointers and
diff --git a/src/realm/util/future.hpp b/src/realm/util/future.hpp
index 78f556cef2f..aad7be1ef41 100644
--- a/src/realm/util/future.hpp
+++ b/src/realm/util/future.hpp
@@ -53,8 +53,7 @@ constexpr static bool is_future> = true;
// FakeVoid is a helper type for futures for callbacks or values that return/are void but need to be represented
// as a value. It should not be visible to callers outside of future_details.
-struct FakeVoid {
-};
+struct FakeVoid {};
template
using VoidToFakeVoid = std::conditional_t, FakeVoid, T>;
diff --git a/src/realm/util/interprocess_mutex.hpp b/src/realm/util/interprocess_mutex.hpp
index 6787f32222d..d50c0dac3cc 100644
--- a/src/realm/util/interprocess_mutex.hpp
+++ b/src/realm/util/interprocess_mutex.hpp
@@ -83,8 +83,7 @@ class InterprocessMutex {
InterprocessMutex& operator=(const InterprocessMutex&) = delete;
#if REALM_ROBUST_MUTEX_EMULATION || defined(_WIN32)
- struct SharedPart {
- };
+ struct SharedPart {};
#else
using SharedPart = RobustMutex;
#endif
diff --git a/src/realm/util/memory_stream.cpp b/src/realm/util/memory_stream.cpp
index 14a2735a112..f9f65b667bc 100644
--- a/src/realm/util/memory_stream.cpp
+++ b/src/realm/util/memory_stream.cpp
@@ -110,12 +110,12 @@ auto MemoryInputStreambuf::do_seekoff(off_type offset, std::ios_base::seekdir di
}
goto bad;
- good:
+good:
if (offset >= (m_begin - anchor) && offset <= (m_end - anchor)) {
m_curr = anchor + std::ptrdiff_t(offset);
return pos_type(off_type(m_curr - m_begin));
}
- bad:
+bad:
return pos_type(off_type(-1)); // Error
}
diff --git a/src/realm/util/memory_stream.hpp b/src/realm/util/memory_stream.hpp
index 81a48523c8d..1ebf10a257f 100644
--- a/src/realm/util/memory_stream.hpp
+++ b/src/realm/util/memory_stream.hpp
@@ -74,7 +74,8 @@ class MemoryInputStream : public std::istream {
/// \{ Behavior is undefined if the size of the specified buffer exceeds
/// PTRDIFF_MAX.
void set_buffer(const char* begin, const char* end) noexcept;
- template ]