From 426884a5296181cce94fc17ab5afdd25e1f1ad30 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Sat, 26 Oct 2024 17:09:19 +0800 Subject: [PATCH] Re-add PHOTON_BUILD_DEPENDENCIES in x86 CI workflow --- .github/workflows/ci.linux.arm.yml | 27 --------------------------- .github/workflows/ci.linux.x86_64.yml | 23 +++++++++++++++++++++++ CMake/Finduring.cmake | 9 ++++++++- CMake/build-from-src.cmake | 2 +- common/test/test_objcache.cpp | 4 ++-- fs/test/test_exportfs.cpp | 2 +- io/iouring-wrapper.cpp | 4 ++-- thread/test/test-pool.cpp | 8 ++++---- 8 files changed, 41 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.linux.arm.yml b/.github/workflows/ci.linux.arm.yml index 8c795fa2..79ed87bf 100644 --- a/.github/workflows/ci.linux.arm.yml +++ b/.github/workflows/ci.linux.arm.yml @@ -40,30 +40,3 @@ jobs: cd build ctest -E test-lockfree --timeout 3600 -V - gcc921-build-debug: - runs-on: [self-hosted, Linux, ARM64] - - container: - image: ghcr.io/alibaba/photon-ut-base:latest - options: --cpus 4 - - steps: - - uses: szenius/set-timezone@v2.0 - with: - timezoneLinux: "Asia/Shanghai" - timezoneMacos: "Asia/Shanghai" - timezoneWindows: "China Standard Time" - - - uses: actions/checkout@v4 - - - name: Build - run: | - source /opt/rh/gcc-toolset-9/enable - cmake -B build \ - -D CMAKE_BUILD_TYPE=Debug \ - -D PHOTON_ENABLE_ECOSYSTEM=ON \ - -D PHOTON_BUILD_TESTING=ON \ - -D PHOTON_ENABLE_SASL=ON \ - -D PHOTON_ENABLE_FUSE=ON \ - -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) -- VERBOSE=1 diff --git a/.github/workflows/ci.linux.x86_64.yml b/.github/workflows/ci.linux.x86_64.yml index 7bcb2fc2..0c9cff05 100644 --- a/.github/workflows/ci.linux.x86_64.yml +++ b/.github/workflows/ci.linux.x86_64.yml @@ -181,6 +181,29 @@ jobs: export PHOTON_CI_EV_ENGINE=epoll_ng cd build && ctest -E test-lockfree --timeout 3600 -V + debug-build-from-source: + runs-on: ubuntu-latest + container: + image: almalinux:8 + steps: + - uses: actions/checkout@v4 + - name: Build + run: | + dnf -q -y install git gcc-c++ cmake gcc-toolset-9-gcc-c++ openssl-devel libcurl-devel + dnf -q -y install autoconf automake libtool + source /opt/rh/gcc-toolset-9/enable + cmake -B build -D CMAKE_BUILD_TYPE=Debug \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=OFF \ + -D PHOTON_ENABLE_FUSE=OFF \ + -D PHOTON_ENABLE_URING=ON \ + -D PHOTON_ENABLE_EXTFS=OFF \ + -D PHOTON_BUILD_DEPENDENCIES=ON \ + -D PHOTON_OPENSSL_SOURCE="" \ + -D PHOTON_CURL_SOURCE="" + cmake --build build -j $(nproc) -- VERBOSE=1 + fstack: runs-on: ubuntu-latest container: diff --git a/CMake/Finduring.cmake b/CMake/Finduring.cmake index 5899c826..2260e386 100644 --- a/CMake/Finduring.cmake +++ b/CMake/Finduring.cmake @@ -1,7 +1,14 @@ +set(URING_VERSION 2.3) + find_path(URING_INCLUDE_DIRS liburing.h) find_library(URING_LIBRARIES uring) find_package_handle_standard_args(uring DEFAULT_MSG URING_LIBRARIES URING_INCLUDE_DIRS) -mark_as_advanced(URING_INCLUDE_DIRS URING_LIBRARIES) \ No newline at end of file +mark_as_advanced(URING_INCLUDE_DIRS URING_LIBRARIES) + +get_filename_component(URING_LIB_BASE ${URING_LIBRARIES} DIRECTORY) +if (NOT EXISTS "${URING_LIB_BASE}/liburing.so.${URING_VERSION}") + message(FATAL_ERROR "Requires liburing ${URING_VERSION}. Install it to system or try -D PHOTON_BUILD_DEPENDENCIES=ON") +endif () \ No newline at end of file diff --git a/CMake/build-from-src.cmake b/CMake/build-from-src.cmake index 5a7117bc..d1b12e4a 100644 --- a/CMake/build-from-src.cmake +++ b/CMake/build-from-src.cmake @@ -75,7 +75,7 @@ function(build_from_src [dep]) ExternalProject_Get_Property(googletest SOURCE_DIR) ExternalProject_Get_Property(googletest BINARY_DIR) set(GOOGLETEST_INCLUDE_DIRS ${SOURCE_DIR}/googletest/include ${SOURCE_DIR}/googlemock/include PARENT_SCOPE) - set(GOOGLETEST_LIBRARIES ${BINARY_DIR}/lib/libgmock.a ${BINARY_DIR}/lib/libgtest.a PARENT_SCOPE) + set(GOOGLETEST_LIBRARIES ${BINARY_DIR}/lib/libgmock.a ${BINARY_DIR}/lib/libgtest_main.a ${BINARY_DIR}/lib/libgtest.a PARENT_SCOPE) elseif (dep STREQUAL "openssl") set(BINARY_DIR ${PROJECT_BINARY_DIR}/openssl-build) diff --git a/common/test/test_objcache.cpp b/common/test/test_objcache.cpp index 16e206a0..1178cc8b 100644 --- a/common/test/test_objcache.cpp +++ b/common/test/test_objcache.cpp @@ -136,11 +136,11 @@ TEST(ObjectCache, ctor_may_yield_and_null) { photon::thread_create(&ph_act, &a); } sem.wait(10); - EXPECT_EQ(1, ocache._set.size()); + EXPECT_EQ(1UL, ocache._set.size()); ocache.expire(); photon::thread_usleep(1100UL * 1000); ocache.expire(); - EXPECT_EQ(0, ocache._set.size()); + EXPECT_EQ(0UL, ocache._set.size()); } TEST(ObjectCache, multithread) { diff --git a/fs/test/test_exportfs.cpp b/fs/test/test_exportfs.cpp index 8ea6e761..81e995f0 100644 --- a/fs/test/test_exportfs.cpp +++ b/fs/test/test_exportfs.cpp @@ -54,7 +54,7 @@ static std::atomic work(0); template int callback(void*, AsyncResult* ret) { - EXPECT_EQ(val, ret->result); + EXPECT_EQ(val, (uint64_t) ret->result); LOG_DEBUG("DONE `", VALUE(ret->operation)); work--; return 0; diff --git a/io/iouring-wrapper.cpp b/io/iouring-wrapper.cpp index 8efe34ae..1faa6c35 100644 --- a/io/iouring-wrapper.cpp +++ b/io/iouring-wrapper.cpp @@ -188,7 +188,7 @@ class iouringEngine : public MasterEventEngine, public CascadingEventEngine, pub ioCtx timer_ctx(true, false); __kernel_timespec ts; auto usec = timeout.timeout_us(); - if (usec < std::numeric_limits::max()) { + if (usec < (uint64_t) std::numeric_limits::max()) { sqe->flags |= IOSQE_IO_LINK; ts = usec_to_timespec(usec); sqe = _get_sqe(); @@ -334,7 +334,7 @@ class iouringEngine : public MasterEventEngine, public CascadingEventEngine, pub ssize_t wait_and_fire_events(uint64_t timeout) override { // Prepare own timeout - if (timeout > std::numeric_limits::max()) { + if (timeout > (uint64_t) std::numeric_limits::max()) { timeout = std::numeric_limits::max(); } diff --git a/thread/test/test-pool.cpp b/thread/test/test-pool.cpp index 8a394b16..d6f15bd3 100644 --- a/thread/test/test-pool.cpp +++ b/thread/test/test-pool.cpp @@ -174,7 +174,7 @@ TEST(workpool, async_work_lambda) { new auto ([r]() { LOG_INFO("START ", VALUE(__cplusplus), VALUE(r->copy), VALUE(r->move)); - EXPECT_EQ(0, r->copy); + EXPECT_EQ(0UL, r->copy); this_thread::sleep_for(std::chrono::seconds(1)); LOG_INFO("FINISH"); delete r; @@ -200,7 +200,7 @@ TEST(workpool, async_work_lambda_threadcreate) { new auto ([&sem, r]() { LOG_INFO("START ", VALUE(__cplusplus), VALUE(r->copy), VALUE(r->move)); - EXPECT_EQ(0, r->copy); + EXPECT_EQ(0UL, r->copy); thread_sleep(1); sem.signal(1); LOG_INFO("FINISH"); @@ -229,7 +229,7 @@ TEST(workpool, async_work_lambda_threadpool) { new auto ([&sem, r]() { LOG_INFO("START ", VALUE(__cplusplus), VALUE(r->copy), VALUE(r->move)); - EXPECT_EQ(0, r->copy); + EXPECT_EQ(0UL, r->copy); thread_sleep(1); sem.signal(1); LOG_INFO("FINISH"); @@ -267,7 +267,7 @@ TEST(workpool, async_work_lambda_threadpool_append) { new auto ([&sem, r]() { LOG_INFO("START ", VALUE(__cplusplus), VALUE(r->copy), VALUE(r->move)); - EXPECT_EQ(0, r->copy); + EXPECT_EQ(0UL, r->copy); thread_sleep(1); sem.signal(1); LOG_INFO("FINISH");