Skip to content

Commit

Permalink
release(emqx): link to system libcrypto
Browse files Browse the repository at this point in the history
new build envvar QUICER_TLS_VER
  • Loading branch information
qzhuyan committed Sep 27, 2024
1 parent 146a167 commit 88f7507
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
openssl:
- openssl3
- openssl
- sys
rebar3:
- 3.23.0
build_type:
Expand All @@ -115,15 +116,15 @@ 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 }}"
echo "github ref: ${{ github.ref }}"
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
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -65,7 +65,7 @@ jobs:
_packages/*.gz
_packages/*.gz.sha256
linux:
emqx-linux:
strategy:
fail-fast: false
matrix:
Expand All @@ -75,6 +75,7 @@ jobs:
openssl:
- openssl3
- openssl
- sys
arch:
- amd64
- arm64
Expand All @@ -90,6 +91,9 @@ jobs:
- amzn2
- el9
- el8
exclude:
- os: el9
openssl: sys
runs-on: ubuntu-latest

steps:
Expand All @@ -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
Expand All @@ -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
Expand Down
22 changes: 12 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion pkgname.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88f7507

Please sign in to comment.