Skip to content

Commit 88f7507

Browse files
committed
release(emqx): link to system libcrypto
new build envvar QUICER_TLS_VER
1 parent 146a167 commit 88f7507

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

.github/workflows/main.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
openssl:
9494
- openssl3
9595
- openssl
96+
- sys
9697
rebar3:
9798
- 3.23.0
9899
build_type:
@@ -115,15 +116,15 @@ jobs:
115116
- name: release build with debug log off
116117
env:
117118
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
118-
QUIC_TLS: ${{ matrix.openssl }}
119+
QUICER_TLS_VER: ${{ matrix.openssl }}
119120
QUIC_ENABLE_LOGGING: ${{ matrix.logging }}
120121
run: |
121122
echo "github ref: ${{ github.event.ref }}"
122123
echo "github ref: ${{ github.ref }}"
123124
sudo sysctl -w kernel.core_pattern=core
124125
ulimit -c unlimited
125126
export CMAKE_BUILD_TYPE
126-
export QUIC_TLS
127+
export QUICER_TLS_VER
127128
export QUIC_ENABLE_LOGGING
128129
if [ "${QUIC_ENABLE_LOGGING}" == "ON" ] ; then
129130
export QUIC_LOGGING_TYPE=lttng

.github/workflows/release.yaml

+9-5
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ jobs:
4949
- name: build release
5050
if: startsWith(github.ref, 'refs/tags/')
5151
env:
52-
QUIC_TLS: ${{ matrix.openssl }}
52+
QUICER_TLS_VER: ${{ matrix.openssl }}
5353
run: |
5454
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
5555
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
5656
erl -eval 'erlang:display(erlang:system_info(system_version)),halt()'
57-
export QUIC_TLS
57+
export QUICER_TLS_VER
5858
BUILD_RELEASE=1 make
5959
6060
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
@@ -65,7 +65,7 @@ jobs:
6565
_packages/*.gz
6666
_packages/*.gz.sha256
6767
68-
linux:
68+
emqx-linux:
6969
strategy:
7070
fail-fast: false
7171
matrix:
@@ -75,6 +75,7 @@ jobs:
7575
openssl:
7676
- openssl3
7777
- openssl
78+
- sys
7879
arch:
7980
- amd64
8081
- arm64
@@ -90,6 +91,9 @@ jobs:
9091
- amzn2
9192
- el9
9293
- el8
94+
exclude:
95+
- os: el9
96+
openssl: sys
9397
runs-on: ubuntu-latest
9498

9599
steps:
@@ -113,7 +117,7 @@ jobs:
113117
run: |
114118
IMAGE=ghcr.io/emqx/emqx-builder/5.3-13:1.15.7-${{ matrix.otp }}-${{ matrix.os }}
115119
docker run -i --rm -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} \
116-
-e BUILD_RELEASE=1 -e QUIC_TLS=${{ matrix.openssl }} \
120+
-e BUILD_RELEASE=1 -e QUICER_TLS_VER=${{ matrix.openssl }} \
117121
$IMAGE bash -euc 'git config --global --add safe.directory /wd; make'
118122
119123
- uses: actions/upload-artifact@v4
@@ -128,7 +132,7 @@ jobs:
128132
runs-on: ubuntu-latest
129133
needs:
130134
- mac
131-
- linux
135+
- emqx-linux
132136
if: startsWith(github.ref, 'refs/tags/')
133137
steps:
134138
- uses: actions/download-artifact@v4

CMakeLists.txt

+12-10
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@ else()
3535
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
3636
endif()
3737

38-
if (DEFINED ENV{QUIC_USE_SYSTEM_LIBCRYPTO})
39-
find_package(OpenSSL REQUIRED)
40-
if ("${OPENSSL_VERSION}" MATCHES "3.*")
41-
set(QUIC_TLS openssl3)
38+
if (DEFINED ENV{QUICER_TLS_VER})
39+
if ($ENV{QUICER_TLS_VER} STREQUAL "sys")
40+
## Link to sys libcrypto, auto openssl vsn
41+
find_package(OpenSSL REQUIRED)
42+
if ("${OPENSSL_VERSION}" MATCHES "3.*")
43+
set(QUIC_TLS "openssl3" CACHE STRING "QUIC_TLS")
44+
else()
45+
set(QUIC_TLS "openssl" CACHE STRING "QUIC_TLS")
46+
endif()
47+
set(QUIC_USE_SYSTEM_LIBCRYPTO "ON")
4248
else()
43-
set(QUIC_TLS openssl)
44-
endif()
45-
set(QUIC_USE_SYSTEM_LIBCRYPTO "ON")
46-
else()
47-
if (DEFINED ENV{QUIC_TLS})
48-
set(QUIC_TLS $ENV{QUIC_TLS})
49+
set(QUIC_TLS $ENV{QUICER_TLS_VER})
4950
endif()
51+
5052
endif()
5153

5254
if (DEFINED ENV{QUIC_ENABLE_LOGGING})

pkgname.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ esac
2929
ARCH="$(uname -m)"
3030
VSN="$(git describe --tags --exact-match | head -1)"
3131

32-
OPENSSL=${QUIC_TLS:-openssl}
32+
OPENSSL=${QUICER_TLS_VER:-openssl}
3333

3434
if [ -z "$VSN" ]; then
3535
exit 0

0 commit comments

Comments
 (0)