-
Notifications
You must be signed in to change notification settings - Fork 909
Modernize codebase #951
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
Modernize codebase #951
Conversation
Yes, I'll do that in a couple of days |
Codecov Report
@@ Coverage Diff @@
## cpp_master #951 +/- ##
==============================================
- Coverage 85.74% 85.61% -0.13%
==============================================
Files 72 79 +7
Lines 4847 5005 +158
==============================================
+ Hits 4156 4285 +129
- Misses 691 720 +29 |
57cbe99
to
4c49c4a
Compare
Add support for the following types: - `std::array<std::byte>` - `std::span<char>` - `std::span<unsigned char>` - `std::span<std::byte>`
4c49c4a
to
388891e
Compare
Done. |
While trying to add tests for
It looks like that adding C++20 support will not be trivial. I'll do it, but it'll take some time (maybe, a week or more). |
There is no C++20 complete support (language feature and standard libraries) compiler yet. Some of features are already implemented but from my experience, it is usually unstable. I'd like to support C++20 feature after at least one complete support compiler is released. |
You are right - none of the compilers has a complete C++20 support (and we might not get it until... 2023?). The problem is that if we don't pass
From my perspective, the 3rd variant is applicable - changes are only related to stable and predictable parts of language and standard library. If you think that it is not - I suggest to use the 2nd option. |
Sorry for my late reply, I had busy days. 3rd option seems good to me. Anyway, could you update (rebase) the PR ? The CI reports an error and I have fixed it by #957. |
Yes, I have updated the PR (rebased from master & added std::span adaptor tests among with c++20 related fixes), now it is 3rd approach. Now I will focus on enhancing CI scripts, particularly, I will add a build variant with C++20 enabled (of course, I will not delete older variants). Without this enhancement some new code just will not be compiled and tested during CI builds. |
Thanks. I will wait your update. |
- Enhance CMakeLists.txt files. - Move to Boost Test from Google Test to support pre-C++11 compilers. - Add more configurations on CI matrix builds. - Other minor fixes
@redboltz Hello, sorry for a long delay. I have added appropriate build configurations on CI, and… accidently did a lot of other changes that I believe are important and helpful for the project. The initial motivation was that I simply did not catch the pattern – why that 10 particular sets of options were considered in CI matrix build, and others were not (see this). If you think that some changes need to be rejected or should be separated into other PR’s – please let me know. Here is a brief overview of what was done:
|
a1a59fc
to
3365d76
Compare
4dca6a5
to
754aba2
Compare
VERSION_GREATER_EQUAL is available since cmake 3.7 only
754aba2
to
25d6f84
Compare
@kovdan01 Thank you for the great work ! Before I post the review comments, I answer your question.
It is based on https://en.wikipedia.org/wiki/Orthogonal_array_testing but manually configured. The motivation is how to shorten the test time. The resource (especially macos) is limited. To be honest, the criteria of picking case in ambiguous. |
I'm watching https://github.com/redboltz/msgpack-c/actions/runs/1106831751 progress. Why linux build is not started ? It seems that macos and linux share (vm or container) resources. Is this right? Maybe we should check up to date Github Actions document. |
I found this post (3 months ago). Maybe total limit is 20.
My expectation as follows:
You can test on your account using the following modification: IMPORTANT |
It seems that Windows build "Build dependencies" takes a long time. It is about 30 minutes. |
The current CI on the PR should be improved. The current total time in unacceptable. So far, only 36 builds are finished (they all macos) and takes 34 minutes. Maybe total time will be several hours. I continue measuring. Problem and possible solution candidate
|
Expected total duration is less that 30 minutes. It is a kind of turn around time that someone post a PR and got the first response (from the CI). |
2 hours later, macos buils were finished. linux build started. NOTE: windows 3 builds were all finished. |
macos build spent 2 hours. |
The PR linux build has the following matrix: matrix
arch: [32, 64]
cxx: [98, 11, 14, 17, 20]
sanitize: ["no", "undefined"]
api: [1, 2, 3]
char_sign: ["unsigned", "signed"]
x3_parse: ["OFF", "ON"] Is this from msgpack-c/.github/workflows/gha.yml Line 115 in b9381f8
I think that you need to pick up some practical patterns as follows:
msgpack-c/.github/workflows/gha.yml Line 115 in b9381f8
I think that at most 5 build for macos, at most 15 builds for linux, and windows 3 builds don't need to update. Then, the total CI time could be practical. |
@redboltz Thanks for your reply! I see your point – builds took really long time. Updated the PR and left 12 Linux, 5 macOS and 3 Windows builds. Regarding that
I did not change this part – dependencies are installed via vcpkg as before. Github actions cache is used to cache those dependencies, so builds will be fast after first run (while cache is valid). Anyway, Windows builds are not slower than before at the moment. |
Thank you for updating the PR. I'm very busy now so I couldn't check the PR soon but I will check it when things have calmed down . Just a comment for CI running time. The PR spent 51m 49s. It still long. See the following results: They are recent merged PR.
You can find the bottle neck. |
It seems that you updated CMakeLists.txt. |
Could you load balance the parallel CI builds ? I realized that msgpack-c/.github/workflows/gha.yml Lines 114 to 209 in be4d971
is the result of load balancing. |
I tried to build the branch on my local environment. [kondo@archboltz] $ rm -rf build [kovdan01-add_span_support][~/work/msgpack-c]
[kondo@archboltz] $ mkdir build [kovdan01-add_span_support][~/work/msgpack-c]
[kondo@archboltz] $ cd build [kovdan01-add_span_support][~/work/msgpack-c]
[kondo@archboltz] $ cmake .. [kovdan01-add_span_support][~/work/msgpack-c/build]
-- The CXX compiler identification is GNU 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/lib64/cmake/Boost-1.76.0/BoostConfig.cmake (found version "1.76.0")
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen dot
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kondo/work/msgpack-c/build
[kondo@archboltz] $ make [kovdan01-add_span_support][~/work/msgpack-c/build]
[kondo@archboltz] $ [kovdan01-add_span_support][~/work/msgpack-c/build] But nothing happens. On cpp_master, started building after |
It seems that you replaced gtest with boost test. It is nice. Great work! I found the following description in the README.md. Dependencymsgpack-c requires boost library. |
To install the library, run
Currently cmake 3.1.0 or newer is required. Fixed it in readme.
Updated. Thanks!
Yes, I'll do that and will write about results. By the way, I briefly described the changes in the comment on Jul 1 (maybe you did not notice that). For example, it is described what particularly was changed in cmake files (and not only that). |
Thanks. This is not so creative work but it is needed to get result in practical time.
I confirmed #951 (comment) , thanks. |
@redboltz Previously I used both gcc and clang for every Linux build. It seems that there was no way to enhance build time while using both compilers, that's why now I use gcc for 6 Linux builds and clang for the remaining 6 Linux builds. Currently the same approach is used in It seems that after this fix build time is OK (at least as for me). |
Thank you for updating. It looks nice build time result. I will check details this weekend. |
@kovdan01 Thank you for updating the PR. |
@redboltz Thank you for reviewing such a huge PR! |
std::array<std::byte>
std::span<char>
std::span<unsigned char>
std::span<std::byte>
I plan to submit one more PR to add full support for
std::span
- a nice non-owning data range wrapper from C++20.