andreasbuhr / cppcoro

A library of C++ coroutine abstractions for the coroutines TS
MIT License
364 stars 53 forks source link

msys2 CI #75

Closed kassane closed 1 year ago

kassane commented 1 year ago

cc: @andreasbuhr

Previous reference: #74

kassane commented 1 year ago

new error from Mingw:

D:/a/cppcoro/cppcoro/include/cppcoro/resume_on.hpp:120:81: error: insufficient contextual information to determine type
  120 |                 for (auto iter = co_await source.begin(); iter != source.end(); co_await ++iter)
      |                                                                                 ^~~~~~~~
kassane commented 1 year ago

New error on Mingw:

D:/a/cppcoro/cppcoro/test/file_tests.cpp: In lambda function:
D:/a/cppcoro/cppcoro/test/file_tests.cpp:98:35: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare]
   98 |                 for (int i = 0; i < sizeof(buffer); ++i, c = (c == 'z' ? 'a' : c + 1))
      |                                 ~~^~~~~~~~~~~~~~~~
D:/a/cppcoro/cppcoro/test/file_tests.cpp: In lambda function:
D:/a/cppcoro/cppcoro/test/file_tests.cpp:154:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
  154 |                 std::memset(buffer1, 0xAB, sizeof(buffer1));
      |                      ^~~~~~
      |                      wmemset
D:/a/cppcoro/cppcoro/test/file_tests.cpp:159:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
  159 |                 std::memset(buffer2, 0xCC, sizeof(buffer2));
      |                      ^~~~~~
      |                      wmemset
In file included from D:/a/cppcoro/cppcoro/test/doctest/cppcoro_doctest.h:9,
                 from D:/a/cppcoro/cppcoro/test/file_tests.cpp:24:
D:/a/cppcoro/cppcoro/test/file_tests.cpp:162:28: error: 'memcmp' is not a member of 'std'; did you mean 'wmemcmp'?
  162 |                 CHECK(std::memcmp(buffer1, buffer2, 50) == 0);
      |                            ^~~~~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2104:9: note: in definition of macro 'DOCTEST_WRAP_IN_TRY'
 2104 |         x;                                                                                         \
      |         ^
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2354:9: note: in expansion of macro 'DOCTEST_ASSERT_IMPLEMENT_2'
 2354 |         DOCTEST_ASSERT_IMPLEMENT_2(assert_type, __VA_ARGS__);                                      \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2398:28: note: in expansion of macro 'DOCTEST_ASSERT_IMPLEMENT_1'
 2398 | #define DOCTEST_CHECK(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_CHECK, __VA_ARGS__)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2927:20: note: in expansion of macro 'DOCTEST_CHECK'
 2927 | #define CHECK(...) DOCTEST_CHECK(__VA_ARGS__)
      |                    ^~~~~~~~~~~~~
D:/a/cppcoro/cppcoro/test/file_tests.cpp:162:17: note: in expansion of macro 'CHECK'
  162 |                 CHECK(std::memcmp(buffer1, buffer2, 50) == 0);
      |                 ^~~~~
D:/a/cppcoro/cppcoro/test/file_tests.cpp:165:28: error: 'memcmp' is not a member of 'std'; did you mean 'wmemcmp'?
  165 |                 CHECK(std::memcmp(buffer1 + 50, buffer2, 50) == 0);
      |                            ^~~~~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2104:9: note: in definition of macro 'DOCTEST_WRAP_IN_TRY'
 2104 |         x;                                                                                         \
      |         ^
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2354:9: note: in expansion of macro 'DOCTEST_ASSERT_IMPLEMENT_2'
 2354 |         DOCTEST_ASSERT_IMPLEMENT_2(assert_type, __VA_ARGS__);                                      \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2398:28: note: in expansion of macro 'DOCTEST_ASSERT_IMPLEMENT_1'
 2398 | #define DOCTEST_CHECK(...) DOCTEST_ASSERT_IMPLEMENT_1(DT_CHECK, __VA_ARGS__)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:2927:20: note: in expansion of macro 'DOCTEST_CHECK'
 2927 | #define CHECK(...) DOCTEST_CHECK(__VA_ARGS__)
      |                    ^~~~~~~~~~~~~
D:/a/cppcoro/cppcoro/test/file_tests.cpp:165:17: note: in expansion of macro 'CHECK'
  165 |                 CHECK(std::memcmp(buffer1 + 50, buffer2, 50) == 0);
      |                 ^~~~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h: In instantiation of 'doctest::detail::Expression_lhs<L>::operator doctest::detail::Result() [with L = const char (&)[27]]':
D:/a/cppcoro/cppcoro/test/file_tests.cpp:196:5:   required from here
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:1469:42: warning: the compiler can assume that the address of 'doctest::detail::Expression_lhs<const char (&)[27]>::lhs' will never be NULL [-Waddress]
 1469 |             bool res = static_cast<bool>(lhs);
      |                                          ^~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:1459:26: note: 'doctest::detail::Expression_lhs<const char (&)[27]>::lhs' declared here
 1459 |         L                lhs;
      |                          ^~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h: In instantiation of 'doctest::detail::Expression_lhs<L>::operator doctest::detail::Result() [with L = const char (&)[32]]':
D:/a/cppcoro/cppcoro/test/file_tests.cpp:207:4:   required from here
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:1469:42: warning: the compiler can assume that the address of 'doctest::detail::Expression_lhs<const char (&)[32]>::lhs' will never be NULL [-Waddress]
 1469 |             bool res = static_cast<bool>(lhs);
      |                                          ^~~
D:/a/cppcoro/cppcoro/test/doctest/doctest.h:1459:26: note: 'doctest::detail::Expression_lhs<const char (&)[32]>::lhs' declared here
 1459 |         L                lhs;
      |                          ^~~
kassane commented 1 year ago

New issue on build: Error: could not load cache - no detect msys2 shell

kassane commented 1 year ago

There are still some warnings that can be corrected later.

Wow! It was fun refactoring the CI that reported some errors and learning a bit more about the API.

What do you think @andreasbuhr?

andreasbuhr commented 1 year ago

Wow, that's cool, thanks for all your effort!

Why did you disable the configure, build, and test steps? If I understand the diff correctly, you are doing all (including configure, build and test) in the 'Install Mingw' step. Was this necessary?

Before merging, I'd appreciate if you cleaned up the patch. Currently this pull request changes a lot of lines which are technically unchanged. This messes up the history and "git blame" does not give sensible results for these lines afterwards. It would be nice if this pull request touched only lines in needs to touch. I usually do such cleanups by creating a cleanup commit, undoing the non-necessary changes, then use use the 'git rebase -i' command to fixup this cleanup commit into the commit doing the unnecessary changes and then 'git push --force' the result to GitHub.

kassane commented 1 year ago

Wow, that's cool, thanks for all your effort!

Why did you disable the configure, build, and test steps? If I understand the diff correctly, you are doing all (including configure, build and test) in the 'Install Mingw' step. Was this necessary?

By default setup-msys2 requires passing own shell, the build and test steps didn't identify the files even passing msys2-env in: D:/a/_temp/setup-msys2/msys2.cmd

Before merging, I'd appreciate if you cleaned up the patch. Currently this pull request changes a lot of lines which are technically unchanged. This messes up the history and "git blame" does not give sensible results for these lines afterwards. It would be nice if this pull request touched only lines in needs to touch. I usually do such cleanups by creating a cleanup commit, undoing the non-necessary changes, then use use the 'git rebase -i' command to fixup this cleanup commit into the commit doing the unnecessary changes and then 'git push --force' the result to GitHub.

Ok.

kassane commented 1 year ago

Commands:

git remote add andreasbuhr git@github.com:andreasbuhr/cppcoro.git
git fetch andreasbuhr
git rebase andreasbuhr/main
git rebase -i HEAD~2
git push -f origin msys2-CI
andreasbuhr commented 1 year ago

Great! It's bedtime in my timezone now, I'll have a closer look tomorrow.

andreasbuhr commented 1 year ago

Thank you very much, this is good to have.