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

switch-off uthread on not supported platform #66

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

RainMark
Copy link
Collaborator

Signed-off-by: Rain Mark rain.by.zhou@gmail.com

Why

  1. disable uthread on not supported platform
  2. fix SimpleIOExecutorTest failed without libaio
  3. no need to link async_simple when uthread disabled, because there is no other cpp source file

Close #39

Signed-off-by: Rain Mark <rain.by.zhou@gmail.com>
@RainMark RainMark requested review from ChuanqiXu9 and qicosmos and removed request for ChuanqiXu9 March 23, 2022 04:04
@qicosmos
Copy link
Collaborator

Have you tested it on Mac?

add_library(async_simple SHARED ${SRCS})
target_link_libraries(async_simple ${deplibs})
target_link_libraries(async_simple_static ${deplibs})
if(SRCS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this condition necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the SRCS is null after disabled uthread
cmake will throw error if SRCS is empty

Copy link
Collaborator

Choose a reason for hiding this comment

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

How about adding an empty src file to reduce the branches? I feel things is more uniform in this way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i prefer to move some not effect performance logic to cpp source, empty src file so ugly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Event.h not template class, we can move some implement to cpp

Copy link
Collaborator

Choose a reason for hiding this comment

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

CountEvent contains some atomic operations. I feel it might affect the performance. Oh, if you feel empty src file is ugly, I think we could reduce the branch later once we have actual src files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CountEvent contains some atomic operations. I feel it might affect the performance. Oh, if you feel empty src file is ugly, I think we could reduce the branch later once we have actual src files.

OK,I will add a comment to make others note it

@@ -1,7 +1,7 @@
file(GLOB coro_test_src "*.cpp")
add_executable(async_simple_coro_test ${coro_test_src} ${PROJECT_SOURCE_DIR}/async_simple/test/dotest.cpp)

target_link_libraries(async_simple_coro_test async_simple ${deplibs} ${testdeplibs})
target_link_libraries(async_simple_coro_test ${deplibs} ${testdeplibs})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be harmful to remain it? If no, I prefer to remain it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if we keep it, we must move some source code to cpp file, feels not suitable

@qicosmos
Copy link
Collaborator

I tested on Mac with clang compiler, there are some compile errors:

  • c++20 should change to c++2a
  • other errors:
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:16:
async_simple/async_simple/coro/FutureAwaiter.h:44:35: error: expected ';' at end of declaration
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
                                  ^
                                  ;
async_simple/async_simple/coro/FutureAwaiter.h:44:36: error: expected unqualified-id
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
                                   ^
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:17:
In file included from async_simple/async_simple/coro/Lazy.h:21:
async_simple/async_simple/coro/CoAwait.h:96:25: error: function 'operator co_await<std::experimental::coroutines_v1::suspend_always>' with deduced return type cannot be used before it is defined
    static ViaCoroutine create(Executor* ex) { co_return; }
                        ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<std::experimental::coroutines_v1::suspend_always>' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:40:18: error: function 'operator co_await<std::experimental::coroutines_v1::suspend_always>' with deduced return type cannot be used before it is
      defined
    auto lazy1 = [&]() -> Lazy<> {
                 ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<std::experimental::coroutines_v1::suspend_always>' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:17:
In file included from async_simple/async_simple/coro/Lazy.h:21:
In file included from async_simple/async_simple/coro/CoAwait.h:30:
async_simple/async_simple/coro/Traits.h:70:12: error: call to deleted constructor of 'async_simple::Future<int>'
    return std::forward<Awaitable>(awaitable);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
async_simple/async_simple/coro/CoAwait.h:184:26: note: in instantiation of function template specialization 'async_simple::coro::detail::getAwaiter<async_simple::Future<int> &, 0, 0>' requested here
        decltype(detail::getAwaiter(std::forward<Awaitable>(awaitable)));
                         ^
async_simple/async_simple/coro/Lazy.h:97:24: note: in instantiation of function template specialization 'async_simple::coro::detail::coAwait<async_simple::Future<int> &, 0>' requested here
        return detail::coAwait(_executor, std::forward<Awaitable>(awaitable));
                       ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:45:20: note: in instantiation of function template specialization
      'async_simple::coro::detail::LazyPromiseBase::await_transform<async_simple::Future<int> &>' requested here
        auto val = co_await fut;
                   ^
async_simple/async_simple/Future.h:63:5: note: 'Future' has been explicitly marked deleted here
    Future(const Future&) = delete;
    ^
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:17:
In file included from async_simple/async_simple/coro/Lazy.h:21:
async_simple/async_simple/coro/CoAwait.h:139:43: error: no member named 'await_suspend' in 'async_simple::Future<int>'
        decltype(std::declval<Awaiter&>().await_suspend(
                 ~~~~~~~~~~~~~~~~~~~~~~~~ ^
async_simple/async_simple/coro/CoAwait.h:185:12: note: in instantiation of template class 'async_simple::coro::detail::ViaAsyncAwaiter<async_simple::Future<int> >' requested here
    return ViaAsyncAwaiter<std::decay_t<AwaiterType>>(
           ^
async_simple/async_simple/coro/Lazy.h:97:24: note: in instantiation of function template specialization 'async_simple::coro::detail::coAwait<async_simple::Future<int> &, 0>' requested here
        return detail::coAwait(_executor, std::forward<Awaitable>(awaitable));
                       ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:45:20: note: in instantiation of function template specialization
      'async_simple::coro::detail::LazyPromiseBase::await_transform<async_simple::Future<int> &>' requested here
        auto val = co_await fut;
                   ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:45:20: note: call to 'await_transform' implicitly required by 'co_await' here
        auto val = co_await fut;
                   ^        ~~~
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:49:18: error: function 'operator co_await<std::experimental::coroutines_v1::suspend_always>' with deduced return type cannot be used before it is
      defined
    auto lazy2 = [&]() -> Lazy<> {
                 ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<std::experimental::coroutines_v1::suspend_always>' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:56:20: error: function 'operator co_await<async_simple::coro::detail::ViaAsyncAwaiter<async_simple::Future<int> > >' with deduced return type
      cannot be used before it is defined
        auto val = co_await std::move(fut);
                   ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<async_simple::coro::detail::ViaAsyncAwaiter<async_simple::Future<int> > >' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
8 errors generated.
make[2]: *** [async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/FutureAwaiterTest.cpp.o] Error 1
make[1]: *** [async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/all] Error 2
make: *** [all] Error 2

@RainMark
Copy link
Collaborator Author

RainMark commented Mar 23, 2022

Have you tested it on Mac?

yes, i passed all test on libc++ mode, but got one error about link -lstdc++fs, we need fix it in another pr

$ make -j4
[  5%] Building CXX object async_simple/test/CMakeFiles/async_simple_test.dir/FutureStateTest.cpp.o
[  5%] Building CXX object async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/FutureAwaiterTest.cpp.o
[  7%] Building CXX object async_simple/executors/test/CMakeFiles/async_simple_executor_test.dir/SimpleIOExecutorTest.cpp.o
[ 10%] Building CXX object async_simple/util/test/CMakeFiles/async_simple_util_test.dir/ThreadPoolTest.cpp.o
[ 13%] Building CXX object async_simple/executors/test/CMakeFiles/async_simple_executor_test.dir/__/__/test/dotest.cpp.o
[ 15%] Linking CXX executable async_simple_executor_test
[ 15%] Built target async_simple_executor_test
[ 18%] Building CXX object async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/LazyTest.cpp.o
[ 21%] Building CXX object async_simple/util/test/CMakeFiles/async_simple_util_test.dir/__/__/test/dotest.cpp.o
[ 23%] Building CXX object async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/SleepTest.cpp.o
[ 26%] Building CXX object async_simple/test/CMakeFiles/async_simple_test.dir/FutureTest.cpp.o
[ 28%] Linking CXX executable async_simple_util_test
[ 28%] Built target async_simple_util_test
[ 31%] Building CXX object async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/TraitsTest.cpp.o
[ 34%] Building CXX object demo_example/CMakeFiles/smtp_client.dir/smtp/smtp_client.cpp.o
[ 36%] Building CXX object demo_example/CMakeFiles/block_http_server.dir/http/block_http/block_http_server.cpp.o
[ 39%] Linking CXX executable block_http_server
[ 39%] Built target block_http_server
[ 42%] Building CXX object async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/ViaCoroutineTest.cpp.o
[ 44%] Linking CXX executable smtp_client
ld: library not found for -lstdc++fs
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [demo_example/smtp_client] Error 1
make[1]: *** [demo_example/CMakeFiles/smtp_client.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 47%] Building CXX object async_simple/test/CMakeFiles/async_simple_test.dir/TryTest.cpp.o
[ 50%] Building CXX object async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/__/__/test/dotest.cpp.o
[ 52%] Building CXX object async_simple/test/CMakeFiles/async_simple_test.dir/dotest.cpp.o
[ 55%] Linking CXX executable async_simple_test
[ 55%] Built target async_simple_test
[ 57%] Linking CXX executable async_simple_coro_test
[ 57%] Built target async_simple_coro_test
make: *** [all] Error 2

-lstdc++fs removed

$ make -j4
-- CMAKE_MODULE_PATH: /Users/rain/Project/async_simple/cmake
-- FindAio.cmake:
CMake Warning (dev) at /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (aio) does
  not match the name of the calling package (Aio).  This can lead to problems
  in calling code that expects `find_package` result variables (e.g.,
  `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindAio.cmake:22 (find_package_handle_standard_args)
  CMakeLists.txt:8 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find aio (missing: LIBAIO_LIBRARIES)
CMake Warning (dev) at /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (gmock) does
  not match the name of the calling package (GMock).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindGMock.cmake:25 (find_package_handle_standard_args)
  CMakeLists.txt:9 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (gtest) does
  not match the name of the calling package (GTest).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindGTest.cmake:25 (find_package_handle_standard_args)
  CMakeLists.txt:10 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (benchmark)
  does not match the name of the calling package (Benchmark).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindBenchmark.cmake:25 (find_package_handle_standard_args)
  CMakeLists.txt:11 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find benchmark (missing: BENCHMARK_LIBRARIES BENCHMARK_INCLUDE_DIR)
-- GTest found.
-- GTest: /usr/local/include, /usr/local/lib/libgtest.a
-- GMock found.
-- GMock: /usr/local/include, /usr/local/lib/libgmock.a
-- Use flag -m64
-- Skipping benchmarks
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/rain/Project/async_simple/oxs
Consolidate compiler generated dependencies of target async_simple_test
Consolidate compiler generated dependencies of target async_simple_util_test
Consolidate compiler generated dependencies of target async_simple_coro_test
Consolidate compiler generated dependencies of target async_simple_executor_test
[  7%] Built target async_simple_executor_test
[ 15%] Built target async_simple_util_test
[ 28%] Built target async_simple_test
Consolidate compiler generated dependencies of target smtp_client
[ 47%] Built target async_simple_coro_test
Consolidate compiler generated dependencies of target block_http_server
[ 50%] Building CXX object demo_example/CMakeFiles/http_client.dir/http/coroutine_http/http_client.cpp.o
[ 52%] Building CXX object demo_example/CMakeFiles/CountChar.dir/CountChar.cpp.o
[ 55%] Linking CXX executable smtp_client
[ 60%] Built target block_http_server
[ 63%] Building CXX object demo_example/CMakeFiles/http_server.dir/http/coroutine_http/http_server.cpp.o
[ 65%] Built target smtp_client
[ 68%] Building CXX object demo_example/CMakeFiles/block_echo_client.dir/block_echo_client.cpp.o
[ 71%] Linking CXX executable CountChar
[ 71%] Built target CountChar
[ 73%] Building CXX object demo_example/CMakeFiles/block_echo_server.dir/block_echo_server.cpp.o
[ 76%] Linking CXX executable block_echo_client
[ 76%] Built target block_echo_client
[ 78%] Building CXX object demo_example/CMakeFiles/async_echo_server.dir/async_echo_server.cpp.o
[ 81%] Linking CXX executable http_client
[ 81%] Built target http_client
[ 84%] Building CXX object demo_example/CMakeFiles/async_echo_client.dir/async_echo_client.cpp.o
[ 86%] Linking CXX executable block_echo_server
[ 86%] Built target block_echo_server
[ 89%] Building CXX object demo_example/CMakeFiles/ReadFiles.dir/ReadFiles.cpp.o
[ 92%] Linking CXX executable http_server
[ 92%] Built target http_server
[ 94%] Linking CXX executable async_echo_server
[ 94%] Built target async_echo_server
[ 97%] Linking CXX executable async_echo_client
[ 97%] Built target async_echo_client
[100%] Linking CXX executable ReadFiles
[100%] Built target ReadFiles

 12:08:48  rain@RaindeMacBook-Pro  ...Project/async_simple/oxs   off_uthread ✘ ✹ ✭  23s 
$ make test
Running tests...
Test project /Users/rain/Project/async_simple/oxs
    Start 1: run_async_simple_test
1/4 Test #1: run_async_simple_test ............   Passed    1.49 sec
    Start 2: run_async_simple_util_test
2/4 Test #2: run_async_simple_util_test .......   Passed    0.29 sec
    Start 3: run_async_simple_coro_test
3/4 Test #3: run_async_simple_coro_test .......   Passed   10.93 sec
    Start 4: run_async_simple_executor_test
4/4 Test #4: run_async_simple_executor_test ...   Passed    0.28 sec

100% tests passed, 0 tests failed out of 4

Total Test time (real) =  13.00 sec
  • version

macOS 12.1 (21C52)

$ clang++ -v
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: x86_64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@ChuanqiXu9
Copy link
Collaborator

I tested on Mac with clang compiler, there are some compile errors:

  • c++20 should change to c++2a
  • other errors:
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:16:
async_simple/async_simple/coro/FutureAwaiter.h:44:35: error: expected ';' at end of declaration
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
                                  ^
                                  ;
async_simple/async_simple/coro/FutureAwaiter.h:44:36: error: expected unqualified-id
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
                                   ^
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:17:
In file included from async_simple/async_simple/coro/Lazy.h:21:
async_simple/async_simple/coro/CoAwait.h:96:25: error: function 'operator co_await<std::experimental::coroutines_v1::suspend_always>' with deduced return type cannot be used before it is defined
    static ViaCoroutine create(Executor* ex) { co_return; }
                        ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<std::experimental::coroutines_v1::suspend_always>' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:40:18: error: function 'operator co_await<std::experimental::coroutines_v1::suspend_always>' with deduced return type cannot be used before it is
      defined
    auto lazy1 = [&]() -> Lazy<> {
                 ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<std::experimental::coroutines_v1::suspend_always>' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:17:
In file included from async_simple/async_simple/coro/Lazy.h:21:
In file included from async_simple/async_simple/coro/CoAwait.h:30:
async_simple/async_simple/coro/Traits.h:70:12: error: call to deleted constructor of 'async_simple::Future<int>'
    return std::forward<Awaitable>(awaitable);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
async_simple/async_simple/coro/CoAwait.h:184:26: note: in instantiation of function template specialization 'async_simple::coro::detail::getAwaiter<async_simple::Future<int> &, 0, 0>' requested here
        decltype(detail::getAwaiter(std::forward<Awaitable>(awaitable)));
                         ^
async_simple/async_simple/coro/Lazy.h:97:24: note: in instantiation of function template specialization 'async_simple::coro::detail::coAwait<async_simple::Future<int> &, 0>' requested here
        return detail::coAwait(_executor, std::forward<Awaitable>(awaitable));
                       ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:45:20: note: in instantiation of function template specialization
      'async_simple::coro::detail::LazyPromiseBase::await_transform<async_simple::Future<int> &>' requested here
        auto val = co_await fut;
                   ^
async_simple/async_simple/Future.h:63:5: note: 'Future' has been explicitly marked deleted here
    Future(const Future&) = delete;
    ^
In file included from async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:17:
In file included from async_simple/async_simple/coro/Lazy.h:21:
async_simple/async_simple/coro/CoAwait.h:139:43: error: no member named 'await_suspend' in 'async_simple::Future<int>'
        decltype(std::declval<Awaiter&>().await_suspend(
                 ~~~~~~~~~~~~~~~~~~~~~~~~ ^
async_simple/async_simple/coro/CoAwait.h:185:12: note: in instantiation of template class 'async_simple::coro::detail::ViaAsyncAwaiter<async_simple::Future<int> >' requested here
    return ViaAsyncAwaiter<std::decay_t<AwaiterType>>(
           ^
async_simple/async_simple/coro/Lazy.h:97:24: note: in instantiation of function template specialization 'async_simple::coro::detail::coAwait<async_simple::Future<int> &, 0>' requested here
        return detail::coAwait(_executor, std::forward<Awaitable>(awaitable));
                       ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:45:20: note: in instantiation of function template specialization
      'async_simple::coro::detail::LazyPromiseBase::await_transform<async_simple::Future<int> &>' requested here
        auto val = co_await fut;
                   ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:45:20: note: call to 'await_transform' implicitly required by 'co_await' here
        auto val = co_await fut;
                   ^        ~~~
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:49:18: error: function 'operator co_await<std::experimental::coroutines_v1::suspend_always>' with deduced return type cannot be used before it is
      defined
    auto lazy2 = [&]() -> Lazy<> {
                 ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<std::experimental::coroutines_v1::suspend_always>' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
async_simple/async_simple/coro/test/FutureAwaiterTest.cpp:56:20: error: function 'operator co_await<async_simple::coro::detail::ViaAsyncAwaiter<async_simple::Future<int> > >' with deduced return type
      cannot be used before it is defined
        auto val = co_await std::move(fut);
                   ^
async_simple/async_simple/coro/FutureAwaiter.h:44:6: note: 'operator co_await<async_simple::coro::detail::ViaAsyncAwaiter<async_simple::Future<int> > >' declared here
auto operator co_await(T&& future) requires IsFuture<std::decay_t<T>>::value {
     ^
8 errors generated.
make[2]: *** [async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/FutureAwaiterTest.cpp.o] Error 1
make[1]: *** [async_simple/coro/test/CMakeFiles/async_simple_coro_test.dir/all] Error 2
make: *** [all] Error 2

It looks like the version of your compiler is not high enough to support concept.

@qicosmos
Copy link
Collaborator

qicosmos commented Mar 23, 2022

Good, could you also update the doc: how to compile the library on Mac?
The fs issue i will solve it, no need depend on fs i think, you can remove fs link in this PR.

@RainMark
Copy link
Collaborator Author

Good, could you also update the doc: how to compile the library on Mac? The fs issue i will solve it, no need depend on fs i think, you can remove fs link in this PR.

ok

@RainMark
Copy link
Collaborator Author

@qicosmos

stdc++fs related issue: https://gitlab.kitware.com/cmake/cmake/-/issues/17834

I tested result

  • clang11 + libstdc++ need link stdc++fs
  • clang13 + libc++ can not found stdc++fs

@qicosmos qicosmos merged commit b7b5e1b into alibaba:main Mar 23, 2022
@qicosmos
Copy link
Collaborator

qicosmos commented Mar 23, 2022

Should revert because of #69

qicosmos added a commit that referenced this pull request Mar 23, 2022
qicosmos added a commit that referenced this pull request Mar 23, 2022
@RainMark RainMark mentioned this pull request Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove uthread related implement in Future
3 participants