Skip to content

Commit bfe9de7

Browse files
committed
Should fix errors
1 parent 8e31048 commit bfe9de7

5 files changed

Lines changed: 80 additions & 7 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build Custom OpenSSL
2+
description: Download, configure, and build OpenSSL from source with sanitizer flags
3+
4+
inputs:
5+
openssl-version:
6+
description: OpenSSL version to build
7+
required: true
8+
install-prefix:
9+
description: Installation prefix path
10+
required: true
11+
sanitizer-flags:
12+
description: Sanitizer compiler/linker flags
13+
required: true
14+
cache-key:
15+
description: Cache key for this OpenSSL build
16+
required: true
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Install OpenSSL build tools
22+
shell: bash
23+
run: |
24+
apt-get update
25+
apt-get install -y perl make curl
26+
27+
- name: Restore OpenSSL cache
28+
id: cache-openssl
29+
uses: actions/cache@v4
30+
with:
31+
path: ${{ inputs.install-prefix }}
32+
key: ${{ inputs.cache-key }}
33+
34+
- name: Build OpenSSL
35+
if: steps.cache-openssl.outputs.cache-hit != 'true'
36+
shell: bash
37+
env:
38+
CC: clang
39+
CXX: clang++
40+
run: |
41+
set -euxo pipefail
42+
OPENSSL_VERSION="${{ inputs.openssl-version }}"
43+
OPENSSL_PREFIX="${{ inputs.install-prefix }}"
44+
SAN_FLAGS="${{ inputs.sanitizer-flags }}"
45+
46+
mkdir -p "$(dirname "$OPENSSL_PREFIX")"
47+
curl -fsSL "https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz" \
48+
-o "/tmp/openssl-${OPENSSL_VERSION}.tar.gz"
49+
tar -xzf "/tmp/openssl-${OPENSSL_VERSION}.tar.gz" -C /tmp
50+
51+
cd "/tmp/openssl-${OPENSSL_VERSION}"
52+
export CFLAGS="$SAN_FLAGS"
53+
export CXXFLAGS="$SAN_FLAGS"
54+
export LDFLAGS="$SAN_FLAGS"
55+
./Configure linux-x86_64 no-shared no-tests no-module no-asm \
56+
--prefix="$OPENSSL_PREFIX" \
57+
--openssldir="$OPENSSL_PREFIX/ssl"
58+
make -j"$(nproc)"
59+
make install_sw

‎.github/workflows/debug.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install analysis dependencies
2424
run: |
2525
apt-get update
26-
apt-get install -y cmake ninja-build libssl-dev clang lld llvm cppcheck clang-tidy
26+
apt-get install -y cmake ninja-build libssl-dev zlib1g-dev libzstd-dev clang lld llvm cppcheck clang-tidy
2727
2828
- name: Configure compile database
2929
env:
@@ -57,7 +57,7 @@ jobs:
5757
- name: Install dependencies
5858
run: |
5959
apt-get update
60-
apt-get install -y cmake ninja-build libssl-dev clang lld llvm
60+
apt-get install -y cmake ninja-build libssl-dev zlib1g-dev libzstd-dev clang lld llvm
6161
6262
- name: Configure CMake
6363
env:
@@ -91,11 +91,14 @@ jobs:
9191
steps:
9292
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9393

94+
- name: Install OpenSSL
95+
run: choco install openssl -y --no-progress
96+
9497
- name: Configure CMake
9598
env:
9699
CC: clang
97100
CXX: clang++
98-
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBYEBYEVPN_ENABLE_TESTS=OFF -DBYEBYEVPN_WARNINGS_AS_ERRORS=ON
101+
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBYEBYEVPN_ENABLE_TESTS=OFF -DBYEBYEVPN_WARNINGS_AS_ERRORS=ON -DOPENSSL_ROOT_DIR="C:/Program Files/OpenSSL-Win64"
99102

100103
- name: Build
101104
run: cmake --build build --parallel
@@ -125,7 +128,7 @@ jobs:
125128
- name: Install dependencies
126129
run: |
127130
apt-get update
128-
apt-get install -y cmake ninja-build libssl-dev clang lld llvm
131+
apt-get install -y cmake ninja-build libssl-dev zlib1g-dev libzstd-dev clang lld llvm
129132
130133
- name: Configure CMake (coverage)
131134
env:

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
apt-get update
23-
apt-get install -y cmake ninja-build libssl-dev clang lld llvm
23+
apt-get install -y cmake ninja-build libssl-dev zlib1g-dev libzstd-dev clang lld llvm
2424
2525
- name: Configure CMake
2626
env:
@@ -56,11 +56,14 @@ jobs:
5656
steps:
5757
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5858

59+
- name: Install OpenSSL
60+
run: choco install openssl -y --no-progress
61+
5962
- name: Configure CMake
6063
env:
6164
CC: clang
6265
CXX: clang++
63-
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBYEBYEVPN_ENABLE_TESTS=ON -DBYEBYEVPN_WARNINGS_AS_ERRORS=ON
66+
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBYEBYEVPN_ENABLE_TESTS=ON -DBYEBYEVPN_WARNINGS_AS_ERRORS=ON -DOPENSSL_ROOT_DIR="C:/Program Files/OpenSSL-Win64"
6467

6568
- name: Build
6669
run: cmake --build build --parallel

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CTestTestfile.cmake
4141
_deps
4242

4343
# Build directories
44-
build*/
44+
/build*/
4545
bin/
4646
out/
4747
.ninja_*

‎CMakeLists.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ if(WIN32)
115115
list(APPEND BYEBYEVPN_PLATFORM_LIBS ws2_32 iphlpapi crypt32 advapi32 user32 gdi32)
116116
else()
117117
list(APPEND BYEBYEVPN_PLATFORM_LIBS pthread dl)
118+
find_package(ZLIB QUIET)
119+
if(ZLIB_FOUND)
120+
list(APPEND BYEBYEVPN_PLATFORM_LIBS ZLIB::ZLIB)
121+
endif()
122+
find_library(ZSTD_LIBRARY NAMES zstd)
123+
if(ZSTD_LIBRARY)
124+
list(APPEND BYEBYEVPN_PLATFORM_LIBS ${ZSTD_LIBRARY})
125+
endif()
118126
endif()
119127

120128
add_library(byebyevpn_core STATIC ${BYEBYEVPN_CORE_SOURCES})

0 commit comments

Comments
 (0)