Introduce realm-core Visual Studio 2022 projects #229
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce Realm VS2022 Project Files
This PR builds on #210, adding support for Visual Studio 2022 Projects for wolfSSL and Realm-core.
Tested with latest wolfSSL release v5.7.6-stable, origin Realm-core commit
a5e87a39or5533505d1.I suggest first merging this PR before #228 as some of my changes are included there, but have since been updated.
Getting Started
From Windows, either
[Windows Key] + Sor just[Windows Key]and search for the "Developer Command Prompt for VS 2022". Typically typingdevewill be enough to find it. Click to start.From the Developer Command Prompt, create and navigate to a test directory, then copy the
osp_test.batfile there:Upon successful execution of the script, the VS2022
RealmCore.slnshould open automatically.Note: There's a critical Windows update this week that affects Visual Studio. If the
osp_text.batscript does not launch Visual Studio, check to see if updates are in progress by launching manually:Unfortunately the output error when Visual Studio is unable to launch is not displayed in the current
osp_test.batscript.Once Visual Studio is running with the
RealmCore.slnsolution file, right click on an application project such asCoreTestsand select "Set as Startup Project". Press the green "Local Windows Debugger" to run, or pressF5.There are additional settings inside the source of
osp_text.batthat may be helpful under a variety of different circumstances.Getting Started with WSL
Be sure the Linux build requirements are satisfied for realm-core and wolfSSL (see "0. Building on *nix from git repository").
If the Windows batch file has already been run as described above, navigate to
osp/realmand run thebuild_wolfssl_with_realm.shfrom a bash script in the Windows Subsystem for Linux (WSL):cd /mnt/c/test/osp/realm ./build_wolfssl_with_realm.sh -i -rOtherwise, there's an enclosed
osp_test.shalso found in realm/lib. Download and run it:mkdir /mnt/c/testw cd /mnt/c/testw curl -o osp_test.sh https://raw.githubusercontent.com/gojimmypi/osp/refs/heads/pr-realm-vs2022/realm/lib/osp_test.sh ./osp_test.shThere are additional settings inside the source of
build_wolfssl_with_realm.shthat may be helpful under a variety of different circumstances.Development
Developed with Visual Studio 2022 v17.11.5 on Windows 11. My development branch is osp/dev
The files in the
VS2022directory were initially generated usingcmake:Subsequent edits were then applied manually to make the project files more portable related to various paths that were otherwise system and user specific.
Configuration files
realm-core-GlobalProperties.propsandwolfssl-GlobalProperties.propswere hand crafted and manually inserted into project files as appropriate.wolfssl library
This PR is configure and was tested using wolfSSL Release 5.7.6.
The enclosed
wolfssl-VS2022-cmake.vcxprojis based on wolfSSL/wolfssl-VS2022.vcxproj and was crafted specifically for this exercise with different configuration options.For additional details, see:
Known Issues
There some known issues to be aware of:
realm-coreneeds a patch applied forwolfssllibrary support. Originally this wasa5e87a39and later updated to5533505d1.SyncTests) See the outdated debug scripts and expired certificates in the older realm-core being used.INSTALLandPACKAGEprojects have not been tested.cmake.verify_globsandVerifyGlobs.cmakefiles in[OSP_ROOT]/realm/VS2022/CMakeFiles/are auto-generated but must exist to build the solution.realm-core.realm-core
A wolfssl-specific needs to be applied to realm-core. See updated realm-commit-a5e87a39.patch.
The requirements were later revised to be based on a slightly newer, post-release commit. See realm-commit-5533505d1.patch
Patch files have been generated from my dev-consolidated patch link.
The patch can be applied to either desired
realm-corecommit (a5e87a39or5533505d1), so the filesrealm-commit-a5e87a39.patchandrealm-commit-5533505d1.patchare the same and can each be a.plied to either commit.The patch files are code-only updates, primarily as related to wolfSSL. Some of the tests require updated certificates. (e.g. certs at the commits have since expired). See the upstream realm-core certificate-authority and upstream realm-core test for various
.pemcertificates and other testing support files.Visual Studio Projects Reload
There's one highly undesired oddity that has not yet been resolved: Upon a fresh clone, the first build causes all of the project files to spontaneously replace all
msbuildmacros in the various project files with actual values for the current user. Occasionally afterwards, even when reverting all changes, an unknown spontaneous event will re-trigger the project file edits and reload.For details see the thread in dotnet/msbuild#5486 and the related Visual Studio Developer Community Issue.
There's no problem for the current user, although the automatic changes reverting to hard-coded user names, paths, and VS editions makes it very difficult to contribute to upstream
osprepository. It also makes it more difficult to find any explicit local changes.