diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 22866cbb..e7931894 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,6 +93,7 @@ jobs: openssl: - openssl3 - openssl + - sys rebar3: - 3.23.0 build_type: @@ -115,7 +116,7 @@ jobs: - name: release build with debug log off env: CMAKE_BUILD_TYPE: ${{ matrix.build_type }} - QUIC_TLS: ${{ matrix.openssl }} + QUICER_TLS_VER: ${{ matrix.openssl }} QUIC_ENABLE_LOGGING: ${{ matrix.logging }} run: | echo "github ref: ${{ github.event.ref }}" @@ -123,7 +124,7 @@ jobs: sudo sysctl -w kernel.core_pattern=core ulimit -c unlimited export CMAKE_BUILD_TYPE - export QUIC_TLS + export QUICER_TLS_VER export QUIC_ENABLE_LOGGING if [ "${QUIC_ENABLE_LOGGING}" == "ON" ] ; then export QUIC_LOGGING_TYPE=lttng diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 026644e5..f533a0b6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -49,12 +49,12 @@ jobs: - name: build release if: startsWith(github.ref, 'refs/tags/') env: - QUIC_TLS: ${{ matrix.openssl }} + QUICER_TLS_VER: ${{ matrix.openssl }} run: | wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3 erl -eval 'erlang:display(erlang:system_info(system_version)),halt()' - export QUIC_TLS + export QUICER_TLS_VER BUILD_RELEASE=1 make - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 @@ -65,7 +65,7 @@ jobs: _packages/*.gz _packages/*.gz.sha256 - linux: + emqx-linux: strategy: fail-fast: false matrix: @@ -75,6 +75,7 @@ jobs: openssl: - openssl3 - openssl + - sys arch: - amd64 - arm64 @@ -90,6 +91,9 @@ jobs: - amzn2 - el9 - el8 + exclude: + - os: el9 + openssl: sys runs-on: ubuntu-latest steps: @@ -113,7 +117,7 @@ jobs: run: | IMAGE=ghcr.io/emqx/emqx-builder/5.3-13:1.15.7-${{ matrix.otp }}-${{ matrix.os }} docker run -i --rm -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} \ - -e BUILD_RELEASE=1 -e QUIC_TLS=${{ matrix.openssl }} \ + -e BUILD_RELEASE=1 -e QUICER_TLS_VER=${{ matrix.openssl }} \ $IMAGE bash -euc 'git config --global --add safe.directory /wd; make' - uses: actions/upload-artifact@v4 @@ -128,7 +132,7 @@ jobs: runs-on: ubuntu-latest needs: - mac - - linux + - emqx-linux if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index e9f9db1c..a99ee4e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,18 +35,20 @@ else() set(CMAKE_BUILD_TYPE "RelWithDebInfo") endif() -if (DEFINED ENV{QUIC_USE_SYSTEM_LIBCRYPTO}) - find_package(OpenSSL REQUIRED) - if ("${OPENSSL_VERSION}" MATCHES "3.*") - set(QUIC_TLS openssl3) +if (DEFINED ENV{QUICER_TLS_VER}) + if ($ENV{QUICER_TLS_VER} STREQUAL "sys") + ## Link to sys libcrypto, auto openssl vsn + find_package(OpenSSL REQUIRED) + if ("${OPENSSL_VERSION}" MATCHES "3.*") + set(QUIC_TLS "openssl3" CACHE STRING "QUIC_TLS") + else() + set(QUIC_TLS "openssl" CACHE STRING "QUIC_TLS") + endif() + set(QUIC_USE_SYSTEM_LIBCRYPTO "ON") else() - set(QUIC_TLS openssl) - endif() - set(QUIC_USE_SYSTEM_LIBCRYPTO "ON") -else() - if (DEFINED ENV{QUIC_TLS}) - set(QUIC_TLS $ENV{QUIC_TLS}) + set(QUIC_TLS $ENV{QUICER_TLS_VER}) endif() + endif() if (DEFINED ENV{QUIC_ENABLE_LOGGING}) diff --git a/pkgname.sh b/pkgname.sh index 6fd526be..fe2dafa8 100755 --- a/pkgname.sh +++ b/pkgname.sh @@ -29,7 +29,7 @@ esac ARCH="$(uname -m)" VSN="$(git describe --tags --exact-match | head -1)" -OPENSSL=${QUIC_TLS:-openssl} +OPENSSL=${QUICER_TLS_VER:-openssl} if [ -z "$VSN" ]; then exit 0