Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building for Windows using C++20 #7841

Merged
merged 6 commits into from
Jul 5, 2024
Merged

Building for Windows using C++20 #7841

merged 6 commits into from
Jul 5, 2024

Conversation

kneth
Copy link
Contributor

@kneth kneth commented Jun 26, 2024

What, How & Why?

This PR tries to address the following:

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • [ ] C-API, if public C++ API changed
  • [ ] bindgen/spec.yml, if public C++ API changed

Copy link

coveralls-official bot commented Jun 26, 2024

Pull Request Test Coverage Report for Build kenneth.geisshirt_16

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 90 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.02%) to 90.961%

Files with Coverage Reduction New Missed Lines %
src/realm/array_string.cpp 1 87.23%
src/realm/util/file.cpp 1 85.3%
test/test_index_string.cpp 1 93.48%
test/test_query2.cpp 1 98.73%
src/realm/table_view.cpp 2 92.99%
test/object-store/util/test_file.cpp 2 86.29%
test/test_all.cpp 2 75.82%
src/realm/unicode.cpp 3 83.83%
src/realm/sync/noinst/client_impl_base.cpp 4 82.56%
src/realm/sync/noinst/server/server.cpp 5 73.82%
Totals Coverage Status
Change from base Build 2434: -0.02%
Covered Lines: 214709
Relevant Lines: 236046

💛 - Coveralls

Copy link

coveralls-official bot commented Jun 26, 2024

Pull Request Test Coverage Report for Build kenneth.geisshirt_18

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 107 unchanged lines in 19 files lost coverage.
  • Overall coverage decreased (-0.03%) to 90.943%

Files with Coverage Reduction New Missed Lines %
src/realm/query_engine.hpp 1 94.15%
src/realm/util/file.cpp 1 84.84%
src/realm/util/serializer.cpp 1 90.43%
test/fuzz_tester.hpp 1 57.73%
test/test_query2.cpp 1 98.73%
src/realm/object-store/shared_realm.cpp 2 91.89%
src/realm/table_view.cpp 2 92.99%
test/test_all.cpp 2 75.82%
src/realm/mixed.cpp 3 86.46%
src/realm/query_expression.hpp 3 93.84%
Totals Coverage Status
Change from base Build 2434: -0.03%
Covered Lines: 214668
Relevant Lines: 236046

💛 - Coveralls

Copy link

coveralls-official bot commented Jun 26, 2024

Pull Request Test Coverage Report for Build kenneth.geisshirt_19

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 81 unchanged lines in 18 files lost coverage.
  • Overall coverage increased (+0.008%) to 90.985%

Files with Coverage Reduction New Missed Lines %
src/realm/array_string.cpp 1 87.23%
src/realm/sync/noinst/server/server_history.cpp 1 63.7%
src/realm/util/file.cpp 1 84.84%
src/realm/util/serializer.cpp 1 90.43%
test/fuzz_tester.hpp 1 57.73%
test/test_index_string.cpp 1 93.48%
test/test_query2.cpp 1 98.73%
src/realm/sync/noinst/server/server.cpp 2 73.78%
test/test_all.cpp 2 75.82%
src/realm/mixed.cpp 3 86.46%
Totals Coverage Status
Change from base Build 2434: 0.008%
Covered Lines: 214771
Relevant Lines: 236052

💛 - Coveralls

@jedelbo jedelbo marked this pull request as ready for review June 27, 2024 07:18
@jedelbo jedelbo requested review from tgoyne and ironage June 27, 2024 07:18
Copy link
Contributor

@ironage ironage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are officially supporting C++20, then we should have a CI runner that checks for compile errors so that we don't accidentally regress.

}
inline auto u8path(const std::string& str)
{
return std::filesystem::path(reinterpret_cast<const char8_t*>(str.c_str()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit concerned that this converts using the constructor that terminates at the first null byte, regardless of the length of the original string. But I suppose this is not actually a problem because null bytes cannot be in a file path.

@jedelbo jedelbo force-pushed the kneth/cpp20-windows branch 4 times, most recently from 6c5cebf to e923527 Compare July 2, 2024 12:26
@jedelbo
Copy link
Contributor

jedelbo commented Jul 2, 2024

@ironage I tried to get it to compile on ubuntu2204-arm64-large, but it failed with both gcc-11 and clang-18. I think clang-18 needs libstdc++-12 to work. On my machine it fails with gcc-11 (probably too old), but succeeds with gcc-12 and clang-16.

Copy link

coveralls-official bot commented Jul 2, 2024

Pull Request Test Coverage Report for Build kenneth.geisshirt_25

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 56 unchanged lines in 11 files lost coverage.
  • Overall coverage decreased (-0.003%) to 90.971%

Files with Coverage Reduction New Missed Lines %
src/realm/dictionary.cpp 1 85.16%
src/realm/query_expression.hpp 1 93.85%
src/realm/cluster.cpp 2 75.85%
test/object-store/sync/flx_sync.cpp 2 98.27%
test/object-store/util/test_file.cpp 2 86.29%
test/test_lang_bind_helper.cpp 2 93.2%
src/realm/collection_parent.cpp 3 93.08%
src/realm/sync/network/websocket.cpp 5 71.21%
src/realm/bplustree.cpp 6 72.55%
src/realm/sync/noinst/server/server.cpp 8 74.29%
Totals Coverage Status
Change from base Build 2466: -0.003%
Covered Lines: 215115
Relevant Lines: 236466

💛 - Coveralls

@jedelbo jedelbo force-pushed the kneth/cpp20-windows branch 3 times, most recently from edc77ab to aedf6d3 Compare July 2, 2024 13:55
@jedelbo
Copy link
Contributor

jedelbo commented Jul 2, 2024

Trying to get it to build on Windows also failed (works on my machine)

Copy link

coveralls-official bot commented Jul 2, 2024

Pull Request Test Coverage Report for Build kenneth.geisshirt_28

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 50 unchanged lines in 13 files lost coverage.
  • Overall coverage increased (+0.01%) to 90.986%

Files with Coverage Reduction New Missed Lines %
src/realm/dictionary.cpp 1 85.16%
src/realm/query_expression.hpp 1 93.81%
src/realm/sort_descriptor.cpp 1 94.06%
test/test_index_string.cpp 1 93.48%
src/realm/object-store/shared_realm.cpp 2 91.89%
src/realm/query_expression.cpp 2 86.62%
src/realm/sync/network/http.hpp 2 82.27%
src/realm/table.cpp 3 90.42%
src/realm/unicode.cpp 3 83.83%
test/fuzz_group.cpp 6 44.98%
Totals Coverage Status
Change from base Build 2466: 0.01%
Covered Lines: 215158
Relevant Lines: 236473

💛 - Coveralls

@ironage
Copy link
Contributor

ironage commented Jul 3, 2024

Building with -D CMAKE_CXX_STANDARD=20 works on evergreen's ubuntu 24.04 builders; they use gcc 13.2.0. I think it should be sufficient to add this to the builder I just added in #7856. What do you think?

@kneth
Copy link
Contributor Author

kneth commented Jul 4, 2024

@ironage

evergreen's ubuntu 24.04 builders

I am trying in ff889df

Copy link

coveralls-official bot commented Jul 4, 2024

Pull Request Test Coverage Report for Build kenneth.geisshirt_30

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 31 unchanged lines in 13 files lost coverage.
  • Overall coverage increased (+0.03%) to 90.986%

Files with Coverage Reduction New Missed Lines %
src/realm/dictionary.cpp 1 85.16%
src/realm/object-store/sync/sync_session.cpp 1 92.01%
src/realm/sort_descriptor.cpp 1 94.06%
src/realm/sync/network/websocket.cpp 1 71.79%
src/realm/sync/noinst/client_impl_base.cpp 1 82.1%
test/fuzz_tester.hpp 1 57.73%
src/realm/array_blobs_big.cpp 2 98.58%
src/realm/cluster.cpp 2 75.85%
src/realm/query_expression.hpp 2 93.81%
src/realm/sync/client.cpp 3 90.98%
Totals Coverage Status
Change from base Build 2469: 0.03%
Covered Lines: 215219
Relevant Lines: 236542

💛 - Coveralls

Copy link
Contributor

@nielsenko nielsenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tried running the Dart test suite with this commit with set(CMAKE_CXX_STANDARD 20) without any hickups.

@kneth
Copy link
Contributor Author

kneth commented Jul 5, 2024

Builds for node.js for Windows: realm/realm-js#6739

@kneth kneth added the no-jira-ticket Skip checking the PR title for Jira reference label Jul 5, 2024
@kneth kneth merged commit 8259932 into master Jul 5, 2024
43 of 44 checks passed
@kneth kneth deleted the kneth/cpp20-windows branch July 5, 2024 09:08
@github-actions github-actions bot mentioned this pull request Jul 5, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes no-jira-ticket Skip checking the PR title for Jira reference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants