From 235b80cd444d2f0dd6c27193532540e1a2212013 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Sat, 7 Oct 2023 14:12:11 +0800 Subject: [PATCH] Clean before merge archive --- .github/workflows/ci.linux.arm.yml | 44 +++++++++++++++++++++++++-- .github/workflows/ci.linux.x86.yml | 48 +++++++++++++++++++++++++++--- .github/workflows/ci.macos.arm.yml | 2 +- .github/workflows/ci.macos.yml | 2 +- CMakeLists.txt | 8 +++-- 5 files changed, 93 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.linux.arm.yml b/.github/workflows/ci.linux.arm.yml index 89e50086..d352064e 100644 --- a/.github/workflows/ci.linux.arm.yml +++ b/.github/workflows/ci.linux.arm.yml @@ -7,7 +7,7 @@ on: branches: [ "main" ] jobs: - centos8-gcc921-epoll: + centos8-gcc921-epoll-release: runs-on: [self-hosted, Linux, ARM64] container: @@ -35,7 +35,7 @@ jobs: - name: Build run: | source /opt/rh/gcc-toolset-9/enable - cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo \ + cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_BUILD_DEPENDENCIES=OFF -D PHOTON_BUILD_TESTING=ON \ -D PHOTON_ENABLE_SASL=ON -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_EXTFS=ON @@ -46,3 +46,43 @@ jobs: ulimit -l unlimited cd build ctest --timeout 3600 -V + + centos8-gcc921-epoll-debug: + runs-on: [self-hosted, Linux, ARM64] + + container: + image: dokken/centos-stream-8:sha-40294ce + options: --cpus 4 + + steps: + - uses: szenius/set-timezone@v1.2 + with: + timezoneLinux: "Asia/Shanghai" + timezoneMacos: "Asia/Shanghai" + timezoneWindows: "China Standard Time" + + - uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + dnf install -y git gcc-c++ cmake 'dnf-command(config-manager)' + dnf install -y gcc-toolset-9-gcc-c++ + dnf install -y openssl-devel libcurl-devel libaio-devel + dnf install -y epel-release + dnf config-manager --set-enabled powertools + dnf install -y gtest-devel gmock-devel gflags-devel fuse-devel libgsasl-devel e2fsprogs-devel + + - name: Build + run: | + source /opt/rh/gcc-toolset-9/enable + cmake -B build -D CMAKE_BUILD_TYPE=Debug \ + -D PHOTON_BUILD_DEPENDENCIES=OFF -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_EXTFS=ON + cmake --build build -j -- VERBOSE=1 + + - name: Test + run: | + ulimit -l unlimited + cd build + ctest --timeout 3600 -V \ No newline at end of file diff --git a/.github/workflows/ci.linux.x86.yml b/.github/workflows/ci.linux.x86.yml index f975df4c..79cd2cb6 100644 --- a/.github/workflows/ci.linux.x86.yml +++ b/.github/workflows/ci.linux.x86.yml @@ -7,7 +7,7 @@ on: branches: [ "main" ] jobs: - centos8-gcc921-epoll: + centos8-gcc921-epoll-release: runs-on: [self-hosted, Linux, X64] container: @@ -35,7 +35,7 @@ jobs: - name: Build run: | source /opt/rh/gcc-toolset-9/enable - cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo \ + cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_BUILD_DEPENDENCIES=OFF -D PHOTON_BUILD_TESTING=ON \ -D PHOTON_ENABLE_SASL=ON -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_EXTFS=ON @@ -47,7 +47,47 @@ jobs: cd build ctest --timeout 3600 -V - centos8-gcc921-iouring: + centos8-gcc921-epoll-debug: + runs-on: [self-hosted, Linux, X64] + + container: + image: dokken/centos-stream-8:sha-40294ce + options: --cpus 4 + + steps: + - uses: szenius/set-timezone@v1.2 + with: + timezoneLinux: "Asia/Shanghai" + timezoneMacos: "Asia/Shanghai" + timezoneWindows: "China Standard Time" + + - uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + dnf install -y git gcc-c++ cmake 'dnf-command(config-manager)' + dnf install -y gcc-toolset-9-gcc-c++ + dnf install -y openssl-devel libcurl-devel libaio-devel + dnf install -y epel-release + dnf config-manager --set-enabled powertools + dnf install -y gtest-devel gmock-devel gflags-devel fuse-devel libgsasl-devel e2fsprogs-devel + + - name: Build + run: | + source /opt/rh/gcc-toolset-9/enable + cmake -B build -D CMAKE_BUILD_TYPE=Debug \ + -D PHOTON_BUILD_DEPENDENCIES=OFF -D PHOTON_BUILD_TESTING=ON \ + -D PHOTON_ENABLE_SASL=ON -D PHOTON_ENABLE_FUSE=ON \ + -D PHOTON_ENABLE_EXTFS=ON + cmake --build build -j -- VERBOSE=1 + + - name: Test + run: | + ulimit -l unlimited + cd build + ctest --timeout 3600 -V + + centos8-gcc921-iouring-release: runs-on: [self-hosted, Linux, X64] container: @@ -75,7 +115,7 @@ jobs: - name: Build run: | source /opt/rh/gcc-toolset-9/enable - cmake -B build -D CMAKE_BUILD_TYPE=RelWithDebInfo \ + cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_BUILD_DEPENDENCIES=ON -D PHOTON_BUILD_TESTING=ON \ -D PHOTON_ENABLE_SASL=ON -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_EXTFS=ON \ diff --git a/.github/workflows/ci.macos.arm.yml b/.github/workflows/ci.macos.arm.yml index c419479e..391ed891 100644 --- a/.github/workflows/ci.macos.arm.yml +++ b/.github/workflows/ci.macos.arm.yml @@ -7,7 +7,7 @@ on: branches: [ "main" ] jobs: - macOS-clang: + macOS-clang-debug: runs-on: [self-hosted, macOS, ARM64] steps: diff --git a/.github/workflows/ci.macos.yml b/.github/workflows/ci.macos.yml index c854300a..2b40153e 100644 --- a/.github/workflows/ci.macos.yml +++ b/.github/workflows/ci.macos.yml @@ -7,7 +7,7 @@ on: branches: [ "main" ] jobs: - macOS-12-Monterey: + macOS-12-Monterey-debug: runs-on: macos-12 steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a3af2ee..736be2be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,9 +52,10 @@ set(CMAKE_CXX_STANDARD ${PHOTON_CXX_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) # CMake didn't provide an abstraction of optimization level for now. -set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") # For development -set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") # For production -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g") # For CI test +set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -DNDEBUG -g") +set(CMAKE_CXX_FLAGS_MINSIZEREL "-O3 -g") # Only for CI test set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -306,6 +307,7 @@ target_link_libraries(photon_static # Merge static libs into libphoton.a # Do NOT use this target directly. add_custom_target(_photon_static_archive ALL + COMMAND rm -rf libphoton.a COMMAND ar -crT libphoton.a $ $ $ DEPENDS photon_static WORKING_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}