From a981f29c248570fbec2c035ff01b7a3762d67ed4 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Sat, 15 Jun 2024 21:49:37 +0800 Subject: [PATCH 1/6] Use Rocky Linux 8 and vcpkg to build RPM packages --- build-support/merge_archives_vcpkg.sh | 32 ++++++++++ lib/CMakeLists.txt | 6 +- pkg/rpm/Dockerfile | 88 +++------------------------ pkg/rpm/SPECS/pulsar-client.spec | 12 +++- pkg/rpm/build-rpm.sh | 4 ++ 5 files changed, 61 insertions(+), 81 deletions(-) create mode 100644 build-support/merge_archives_vcpkg.sh diff --git a/build-support/merge_archives_vcpkg.sh b/build-support/merge_archives_vcpkg.sh new file mode 100644 index 00000000..de1756e5 --- /dev/null +++ b/build-support/merge_archives_vcpkg.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +set -e +cd `dirname $0` + +if [[ $# -lt 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +CMAKE_BUILD_DIRECTORY=$1 +./merge_archives.sh $CMAKE_BUILD_DIRECTORY/libpulsarwithdeps.a \ + $CMAKE_BUILD_DIRECTORY/lib/libpulsar.a \ + $(find "$CMAKE_BUILD_DIRECTORY/vcpkg_installed" -name "*.a" | grep -v debug) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 6edc05e2..33694a66 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -76,6 +76,7 @@ target_include_directories(PULSAR_OBJECT_LIB PUBLIC "${CMAKE_SOURCE_DIR}/include" "${CMAKE_BINARY_DIR}/include") +include(CheckCXXSymbolExists) if (BUILD_DYNAMIC_LIB) add_library(pulsarShared SHARED $) set_property(TARGET pulsarShared PROPERTY OUTPUT_NAME ${LIB_NAME_SHARED}) @@ -89,9 +90,12 @@ if (BUILD_DYNAMIC_LIB) target_include_directories(pulsarShared PRIVATE ${dlfcn-win32_INCLUDE_DIRS}) target_link_options(pulsarShared PRIVATE $<$:/NODEFAULTLIB:MSVCRT>) endif() + check_cxx_symbol_exists(__GLIBCXX__ iostream GLIBCXX) + if (GLIBCXX) + target_link_libraries(pulsarShared PUBLIC -static-libgcc -static-libstdc++) + endif () endif() -include(CheckCXXSymbolExists) check_cxx_symbol_exists(getauxval sys/auxv.h HAVE_AUXV_GETAUXVAL) if(HAVE_AUXV_GETAUXVAL) add_definitions(-DPULSAR_AUXV_GETAUXVAL_PRESENT) diff --git a/pkg/rpm/Dockerfile b/pkg/rpm/Dockerfile index 40044a54..0fdb4995 100644 --- a/pkg/rpm/Dockerfile +++ b/pkg/rpm/Dockerfile @@ -19,7 +19,7 @@ # Build pulsar client library in Centos with tools to build static RPM -FROM centos:7 +FROM rockylinux:8 ARG PLATFORM @@ -30,87 +30,19 @@ RUN yum update -y && \ rpm-build \ which \ createrepo \ - libstdc++-static \ - python3 + git \ + python3 \ + python3-pip +RUN dnf --enablerepo=powertools install -y libstdc++-static RUN pip3 install pyyaml ADD .build/dependencies.yaml / ADD .build/dep-version.py /usr/local/bin -# Download and compile boost -# GCC 4.8.2 implementation of std::regex is buggy, so we install boost::regex here -RUN BOOST_VERSION=$(dep-version.py boost) && \ - echo "BOOST VERSION: '${BOOST_VERSION}'" && \ - curl -O -L https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}.tar.gz && \ - tar zxf boost-${BOOST_VERSION}.tar.gz && \ - cd boost-${BOOST_VERSION} && \ - ./bootstrap.sh --with-libraries=regex && \ - ./b2 address-model=64 cxxflags="-fPIC -std=c++11" link=static threading=multi variant=release install && \ - rm -rf /boost-${BOOST_VERSION}.tar.gz /boost-${BOOST_VERSION} - -RUN CMAKE_VERSION=$(dep-version.py cmake) && \ - curl -O -L https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${PLATFORM}.tar.gz && \ - tar xfz cmake-${CMAKE_VERSION}-linux-${PLATFORM}.tar.gz && \ - cp cmake-${CMAKE_VERSION}-linux-${PLATFORM}/bin/* /usr/bin/ && \ - cp -r cmake-${CMAKE_VERSION}-linux-${PLATFORM}/share/cmake-* /usr/share/ && \ - rm -rf cmake-${CMAKE_VERSION}-linux-${PLATFORM} cmake-${CMAKE_VERSION}-linux-${PLATFORM}.tar.gz - -# Download and compile protobuf -RUN PROTOBUF_VERSION=$(dep-version.py protobuf) && \ - curl -O -L https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz && \ - tar xfz protobuf-cpp-${PROTOBUF_VERSION}.tar.gz && \ - cd protobuf-${PROTOBUF_VERSION}/ && \ - CXXFLAGS=-fPIC ./configure && \ - make -j8 && make install && ldconfig && \ - rm -rf /protobuf-cpp-${PROTOBUF_VERSION}.tar.gz /protobuf-${PROTOBUF_VERSION} - -# ZLib -RUN ZLIB_VERSION=$(dep-version.py zlib) && \ - curl -O -L https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz && \ - tar xfz v${ZLIB_VERSION}.tar.gz && \ - cd zlib-${ZLIB_VERSION} && \ - CFLAGS="-fPIC -O3" ./configure && \ - make -j8 && make install && \ - rm -rf /v${ZLIB_VERSION}.tar.gz /zlib-${ZLIB_VERSION} - -# Zstandard -RUN ZSTD_VERSION=$(dep-version.py zstd) && \ - curl -O -L https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz && \ - tar xfz zstd-${ZSTD_VERSION}.tar.gz && \ - cd zstd-${ZSTD_VERSION} && \ - CFLAGS="-fPIC -O3" make -j8 && \ - make install && \ - rm -rf /zstd-${ZSTD_VERSION} /zstd-${ZSTD_VERSION}.tar.gz - -# Snappy -RUN SNAPPY_VERSION=$(dep-version.py snappy) && \ - curl -O -L https://github.com/google/snappy/archive/refs/tags/${SNAPPY_VERSION}.tar.gz && \ - tar xfz ${SNAPPY_VERSION}.tar.gz && \ - cd snappy-${SNAPPY_VERSION} && \ - CXXFLAGS="-fPIC -O3" cmake . -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF && \ - make -j8 && make install && \ - rm -rf /snappy-${SNAPPY_VERSION} /${SNAPPY_VERSION}.tar.gz - -RUN OPENSSL_VERSION=$(dep-version.py openssl) && \ - OPENSSL_VERSION_UNDERSCORE=$(echo $OPENSSL_VERSION | sed 's/\./_/g') && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz && \ - tar xfz OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz && \ - cd openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}/ && \ - ./Configure -fPIC --prefix=/usr/local/ssl/ linux-${PLATFORM} && \ - make -j8 && make install && \ - rm -rf /OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz /openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE} - -ENV LD_LIBRARY_PATH /usr/local/ssl/lib/: -ENV OPENSSL_ROOT_DIR /usr/local/ssl/ - -# LibCurl -RUN CURL_VERSION=$(dep-version.py curl) && \ - CURL_VERSION_UNDERSCORE=$(echo $CURL_VERSION | sed 's/\./_/g') && \ - curl -O -L https://github.com/curl/curl/releases/download/curl-${CURL_VERSION_UNDERSCORE}/curl-${CURL_VERSION}.tar.gz && \ - tar xfz curl-${CURL_VERSION}.tar.gz && \ - cd curl-${CURL_VERSION} && \ - CFLAGS=-fPIC ./configure --with-ssl=/usr/local/ssl/ --without-zstd --without-libpsl && \ - make -j8 && make install && \ - rm -rf /curl-${CURL_VERSION}.tar.gz /curl-${CURL_VERSION} +# Vcpkg does not provide pre-built binaries for Arm architectures so we need to build vcpkg from source +RUN yum install cmake && + dnf --enablerepo=devel install -y ninja-build +# Dependencies when building OpenSSL +RUN yum install -y perl-IPC-Cmd diff --git a/pkg/rpm/SPECS/pulsar-client.spec b/pkg/rpm/SPECS/pulsar-client.spec index c9782587..425eec5f 100644 --- a/pkg/rpm/SPECS/pulsar-client.spec +++ b/pkg/rpm/SPECS/pulsar-client.spec @@ -20,6 +20,7 @@ %define name apache-pulsar-client %define release 1 %define buildroot %{_topdir}/%{name}-%{version}-root +%define debug_package %{nil} BuildRoot: %{buildroot} Summary: Apache Pulsar client library @@ -52,8 +53,15 @@ static library. %setup -q -n apache-pulsar-client-cpp-%{pom_version} %build -cmake . -DBUILD_TESTS=OFF -DLINK_STATIC=ON -make -j 3 +git clone https://github.com/microsoft/vcpkg.git +cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON +cmake --build build -j8 +./build-support/merge_archives_vcpkg.sh $PWD/build + +cp build/lib/libpulsar.a lib/libpulsar.a +cp build/lib/libpulsar.so lib/libpulsar.so +cp build/libpulsarwithdeps.a lib/libpulsarwithdeps.a %install INCLUDE_DIR=$RPM_BUILD_ROOT/usr/include diff --git a/pkg/rpm/build-rpm.sh b/pkg/rpm/build-rpm.sh index 6f15a846..47d1485f 100755 --- a/pkg/rpm/build-rpm.sh +++ b/pkg/rpm/build-rpm.sh @@ -24,6 +24,10 @@ cd /pulsar-client-cpp ROOT_DIR=$(pwd) cd $ROOT_DIR/pkg/rpm +if [[ $PLATFORM == "aarch64" ]]; then + export VCPKG_FORCE_SYSTEM_BINARIES=arm +fi + POM_VERSION=`cat $ROOT_DIR/version.txt | xargs` # Sanitize VERSION by removing `-incubating` since it's not legal in RPM From 484dc90ca43a2c7fda233aaafea5b7320d0d7f46 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Sat, 15 Jun 2024 23:17:53 +0800 Subject: [PATCH 2/6] [TEST] Build RPM packages --- .github/workflows/ci-pr-validation.yaml | 302 +----------------------- 1 file changed, 11 insertions(+), 291 deletions(-) diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index 9f113b03..7e1f31e1 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -28,259 +28,19 @@ concurrency: cancel-in-progress: true jobs: - - formatting-check: - name: Formatting Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Run clang-format style check for C/C++/Protobuf programs. - uses: jidicula/clang-format-action@v4.11.0 - with: - clang-format-version: '11' - exclude-regex: '.*\.(proto|hpp)' - - wireshark-dissector-build: - name: Build the Wireshark dissector - needs: formatting-check - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - matrix: - os: [ubuntu-20.04, macos-12] - - steps: - - name: checkout - uses: actions/checkout@v3 - - - name: Install deps (Ubuntu) - if: ${{ startsWith(matrix.os, 'ubuntu') }} - run: | - sudo apt-get update -y - sudo apt-get install -y protobuf-compiler libprotobuf-dev wireshark-dev - - - name: Install deps (macOS) - if: ${{ startsWith(matrix.os, 'macos') }} - run: | - # See https://github.com/Homebrew/homebrew-core/issues/157142 - export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 - cd /usr/local/bin - rm -f 2to3* idle3* pydoc* python3* - rm -f /usr/local/share/man/man1/python3.1 /usr/local/lib/pkgconfig/python3* - cd /usr/local/Frameworks/Python.framework - rm -rf Headers Python Resources Versions/Current - brew update - brew install pkg-config wireshark protobuf - - name: Build wireshark plugin - run: | - cmake -S wireshark -B build-wireshark - cmake --build build-wireshark - - unit-tests: - name: Run unit tests - needs: formatting-check - runs-on: ubuntu-22.04 - timeout-minutes: 120 - - steps: - - name: checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - name: Build core libraries - run: | - cmake . -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=OFF - cmake --build . -j8 - - - name: Check formatting - run: | - ./vcpkg/vcpkg format-manifest vcpkg.json - if [[ $(git diff | wc -l) -gt 0 ]]; then - echo "Please run `./vcpkg/vcpkg format-manifest vcpkg.json` to reformat vcpkg.json" - exit 1 - fi - - - name: Build tests - run: | - cmake . -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON - cmake --build . -j8 - - - name: Install gtest-parallel - run: | - sudo curl -o /gtest-parallel https://raw.githubusercontent.com/google/gtest-parallel/master/gtest_parallel.py - - - name: Run unit tests - run: RETRY_FAILED=3 ./run-unit-tests.sh - - - name: Build perf tools - run: | - cmake . -DINTEGRATE_VCPKG=ON -DBUILD_TESTS=ON -DBUILD_PERF_TOOLS=ON - cmake --build . -j8 - - - name: Verify custom vcpkg installation - run: | - mv vcpkg /tmp/ - cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_TOOLCHAIN_FILE="/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake" - - cpp20-build: - name: Build with the C++20 standard - needs: formatting-check - runs-on: ubuntu-22.04 - timeout-minutes: 60 - - steps: - - name: checkout - uses: actions/checkout@v3 - - name: Install deps - run: | - sudo apt-get update -y - sudo apt-get install -y libcurl4-openssl-dev libssl-dev \ - protobuf-compiler libprotobuf-dev libboost-dev \ - libboost-dev libboost-program-options-dev \ - libzstd-dev libsnappy-dev libgmock-dev libgtest-dev - - name: CMake - run: cmake -B build -DBUILD_PERF_TOOLS=ON -DCMAKE_CXX_STANDARD=20 - - name: Build - run: | - cmake --build build -j8 --target pulsarShared pulsarStatic - cmake --build build -j8 - - cpp-build-windows: - timeout-minutes: 120 - name: Build CPP Client on ${{ matrix.name }} - needs: unit-tests - runs-on: ${{ matrix.os }} - env: - VCPKG_ROOT: '${{ github.workspace }}/vcpkg' - INSTALL_DIR: 'C:\\pulsar-cpp' - strategy: - fail-fast: false - matrix: - include: - - name: 'Windows x64' - os: windows-2019 - triplet: x64-windows-static - suffix: 'windows-win64' - generator: 'Visual Studio 16 2019' - arch: '-A x64' - - name: 'Windows x86' - os: windows-2019 - triplet: x86-windows-static - suffix: 'windows-win32' - generator: 'Visual Studio 16 2019' - arch: '-A Win32' - - steps: - - name: checkout - uses: actions/checkout@v3 - - - name: Restore vcpkg and its artifacts. - uses: actions/cache@v3 - id: vcpkg-cache - with: - path: | - ${{ env.VCPKG_ROOT }} - vcpkg_installed - !${{ env.VCPKG_ROOT }}/.git - !${{ env.VCPKG_ROOT }}/buildtrees - !${{ env.VCPKG_ROOT }}/packages - !${{ env.VCPKG_ROOT }}/downloads - key: | - ${{ runner.os }}-${{ matrix.triplet}}-${{ hashFiles( 'vcpkg.json' ) }} - - - name: Get vcpkg(windows) - if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }} - run: | - cd ${{ github.workspace }} - mkdir build -force - git clone https://github.com/Microsoft/vcpkg.git - cd vcpkg - .\bootstrap-vcpkg.bat - - - name: remove system vcpkg(windows) - if: runner.os == 'Windows' - run: rm -rf "$VCPKG_INSTALLATION_ROOT" - shell: bash - - - name: Install vcpkg packages - run: | - ${{ env.VCPKG_ROOT }}\vcpkg.exe install --triplet ${{ matrix.triplet }} - - - name: Configure - shell: bash - run: | - if [ "$RUNNER_OS" == "Windows" ]; then - cmake \ - -B ./build-1 \ - -G "${{ matrix.generator }}" ${{ matrix.arch }} \ - -DUSE_ASIO=ON \ - -DBUILD_TESTS=OFF \ - -DVCPKG_TRIPLET="${{ matrix.triplet }}" \ - -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}" \ - -S . - fi - - - name: Install - shell: bash - run: | - if [ "$RUNNER_OS" == "Windows" ]; then - cmake --build ./build-1 --parallel --config Release - cmake --install ./build-1 - fi - - - name: Test examples - shell: bash - run: | - if [ "$RUNNER_OS" == "Windows" ]; then - cd win-examples - cmake \ - -G "${{ matrix.generator }}" ${{ matrix.arch }} \ - -DLINK_STATIC=OFF \ - -DCMAKE_PREFIX_PATH=${{ env.INSTALL_DIR }} \ - -B build-dynamic - cmake --build build-dynamic --config Release - cmake \ - -G "${{ matrix.generator }}" ${{ matrix.arch }} \ - -DLINK_STATIC=ON \ - -DCMAKE_PREFIX_PATH=${{ env.INSTALL_DIR }} \ - -B build-static - cmake --build build-static --config Release - ./build-static/Release/win-example.exe - fi - - - name: Build (Debug) - shell: bash - run: | - if [ "$RUNNER_OS" == "Windows" ]; then - cmake \ - -B ./build-2 \ - -G "${{ matrix.generator }}" ${{ matrix.arch }} \ - -DUSE_ASIO=ON \ - -DBUILD_TESTS=OFF \ - -DVCPKG_TRIPLET="${{ matrix.triplet }}" \ - -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_DIR }}" \ - -DCMAKE_BUILD_TYPE=Debug \ - -S . - cmake --build ./build-2 --parallel --config Debug - fi - - package: + package-linux: name: Build ${{matrix.pkg.name}} ${{matrix.cpu.platform}} runs-on: ubuntu-22.04 - needs: unit-tests timeout-minutes: 500 strategy: - fail-fast: true + fail-fast: false matrix: pkg: - { name: 'RPM', type: 'rpm', path: 'pkg/rpm/RPMS' } - - { name: 'Deb', type: 'deb', path: 'pkg/deb/BUILD/DEB' } - - { name: 'Alpine', type: 'apk', path: 'pkg/apk/build' } cpu: - { arch: 'x86_64', platform: 'x86_64' } + - { arch: 'aarch64', platform: 'arm64' } steps: - name: checkout @@ -309,60 +69,20 @@ jobs: - name: Build packages run: pkg/${{matrix.pkg.type}}/docker-build-${{matrix.pkg.type}}-${{matrix.cpu.platform}}.sh build:latest - cpp-build-macos: - timeout-minutes: 120 - name: Build CPP Client on macOS - needs: formatting-check - runs-on: macos-12 - steps: - - name: checkout - uses: actions/checkout@v3 - - - name: Install dependencies - run: brew install openssl protobuf boost zstd snappy googletest - - - name: Configure (default) - shell: bash - run: cmake -B ./build-macos -S . + - name: Zip artifact + run: zip -r ${{matrix.pkg.type}}-${{matrix.cpu.platform}}.zip ${{matrix.pkg.path}} - - name: Compile - shell: bash - run: | - cmake --build ./build-macos --parallel --config Release - - - name: Build with C++20 - shell: bash - run: | - cmake -B build-macos-cpp20 -DCMAKE_CXX_STANDARD=20 - cmake --build build-macos-cpp20 -j8 - - cpp-build-macos-static: - timeout-minutes: 120 - name: Build CPP Client on macOS with static dependencies - runs-on: macos-12 - needs: unit-tests - steps: - - name: checkout - uses: actions/checkout@v3 - - - name: Build libraries - run: ./pkg/mac/build-static-library.sh - - - name: Test static libraries - run: | - export PULSAR_DIR=$PWD/pkg/mac/.install - echo "Build with static library" - clang++ win-examples/example.cc -o static.out -std=c++11 -I $PULSAR_DIR/include $PULSAR_DIR/lib/libpulsarwithdeps.a - ./static.out - echo "Build with dynamic library" - clang++ win-examples/example.cc -o dynamic.out -std=c++11 -I $PULSAR_DIR/include -L $PULSAR_DIR/lib -Wl,-rpath $PULSAR_DIR/lib -lpulsar - ./dynamic.out + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{matrix.pkg.type}}-${{matrix.cpu.platform}} + path: ${{matrix.pkg.path}} # Job that will be required to complete and depends on all the other jobs check-completion: name: Check Completion runs-on: ubuntu-latest - needs: [formatting-check, wireshark-dissector-build, unit-tests, cpp20-build, cpp-build-windows, package, cpp-build-macos] + needs: [package-linux] steps: - run: true From dc71a72db7bb206f07c63298646ac9401425b74f Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Sat, 15 Jun 2024 23:25:11 +0800 Subject: [PATCH 3/6] Fix wrong Dockerfile --- pkg/rpm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/rpm/Dockerfile b/pkg/rpm/Dockerfile index 0fdb4995..30dbe489 100644 --- a/pkg/rpm/Dockerfile +++ b/pkg/rpm/Dockerfile @@ -41,7 +41,7 @@ ADD .build/dependencies.yaml / ADD .build/dep-version.py /usr/local/bin # Vcpkg does not provide pre-built binaries for Arm architectures so we need to build vcpkg from source -RUN yum install cmake && +RUN yum install cmake && \ dnf --enablerepo=devel install -y ninja-build # Dependencies when building OpenSSL From 6e2caea689494560d14c56486506091a8874f813 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Sat, 15 Jun 2024 23:25:34 +0800 Subject: [PATCH 4/6] [TEST] Skip codeql --- .github/workflows/codeql-analysis.yml | 73 --------------------------- 1 file changed, 73 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index c877c642..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,73 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - schedule: - - cron: '16 21 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-22.04 - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - - name: Install deps - run: | - sudo apt-get update -y - sudo apt-get install -y libcurl4-openssl-dev libssl-dev \ - protobuf-compiler libprotobuf-dev libboost-dev \ - libboost-dev libboost-program-options-dev \ - libzstd-dev libsnappy-dev - - - name: Build - run: | - cmake . -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=OFF -DBUILD_STATIC_LIB=OFF -DBUILD_PERF_TOOLS=ON - cmake --build . -j8 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" From 9c2cd72926832cf2d700407dd32377dc987bafc1 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Sat, 15 Jun 2024 23:28:31 +0800 Subject: [PATCH 5/6] Fix cmake install --- pkg/rpm/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rpm/Dockerfile b/pkg/rpm/Dockerfile index 30dbe489..95740238 100644 --- a/pkg/rpm/Dockerfile +++ b/pkg/rpm/Dockerfile @@ -41,8 +41,8 @@ ADD .build/dependencies.yaml / ADD .build/dep-version.py /usr/local/bin # Vcpkg does not provide pre-built binaries for Arm architectures so we need to build vcpkg from source -RUN yum install cmake && \ - dnf --enablerepo=devel install -y ninja-build +RUN yum install -y cmake +RUn dnf --enablerepo=devel install -y ninja-build # Dependencies when building OpenSSL RUN yum install -y perl-IPC-Cmd From 557a00e49210d889a4ff24e163ea0e9c32151d78 Mon Sep 17 00:00:00 2001 From: Yunze Xu Date: Sun, 16 Jun 2024 20:25:47 +0800 Subject: [PATCH 6/6] Fix permission --- build-support/merge_archives_vcpkg.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build-support/merge_archives_vcpkg.sh diff --git a/build-support/merge_archives_vcpkg.sh b/build-support/merge_archives_vcpkg.sh old mode 100644 new mode 100755