Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat ci: add alpine build #769

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Alpine Linux

'on':
pull_request:
push:
branches:
- master
- develop
- feature/**

env:
UBSAN_OPTIONS: print_stacktrace=1
ASAN_OPTIONS: detect_odr_violation=2
CXX: clang++-18

jobs:
posix:
strategy:
fail-fast: false

name: Alpine Linux
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup latest Alpine Linux
uses: jirutka/setup-alpine@v1

- name: Run script inside Alpine chroot as root
shell: alpine.sh --root {0}
run: |
pwd
cat /etc/alpine-release
apk add $(cat scripts/docs/en/deps/alpine.md)

- name: Run cmake
shell: alpine.sh {0}
run: |
pwd
mkdir build_debug
cd build_debug
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DUSERVER_NO_WERROR=OFF \
-DUSERVER_BUILD_ALL_COMPONENTS=1 \
-DUSERVER_BUILD_SAMPLES=1 \
-DUSERVER_BUILD_TESTS=1 \
-DUSERVER_FEATURE_JEMALLOC=OFF \
-DUSERVER_FEATURE_KAFKA=OFF \
-DUSERVER_FEATURE_STACKTRACE=OFF \
-DUSERVER_DOWNLOAD_PACKAGE_PROTOBUF=ON \
-DUSERVER_DISABLE_RSEQ_ACCELERATION=YES \
..

- name: Compile
shell: alpine.sh {0}
run: |
cd build_debug
make -j$(nproc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

cmake --build . -j$(nproc)


- name: Run tests
shell: alpine.sh {0}
run: |
cd build_debug
ctest -V
2 changes: 1 addition & 1 deletion cmake/SetupRocksDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(DownloadUsingCPM)
CPMAddPackage(
NAME rocksdb
GITHUB_REPOSITORY facebook/rocksdb
GIT_TAG v8.11.3
GIT_TAG v9.7.4
OPTIONS
"ROCKSDB_BUILD_SHARED OFF"
"WITH_TESTS OFF"
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/FindHiredis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ _userver_module_begin(
RPM_NAMES hiredis-devel
PACMAN_NAMES hiredis
PKG_NAMES hiredis
PKG_CONFIG_NAMES hiredis
)

_userver_module_find_include(
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/Findbson.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ _userver_module_begin(
FORMULA_NAMES mongo-c-driver
RPM_NAMES mongo-c-driver-devel
PACMAN_NAMES mongo-c-driver
PKG_CONFIG_NAMES libbson-1.0
)

_userver_module_find_include(
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/Findlibmariadb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ _userver_module_begin(
NAME libmariadb
VERSION 3.0.3
DEBIAN_NAMES libmariadb-dev
PKG_CONFIG_NAMES mariadb
)

_userver_module_find_include(
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/Findmongoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ _userver_module_begin(
FORMULA_NAMES mongo-c-driver
RPM_NAMES mongo-c-driver-devel
PACMAN_NAMES mongo-c-driver
PKG_CONFIG_NAMES libmongoc-1.0
)

_userver_module_find_include(
Expand Down
4 changes: 4 additions & 0 deletions core/src/engine/task/exception_hacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ void* dlopen(const char* filename, int flags) {
return reinterpret_cast<DlOpenSignature>(func)(filename, flags);
}

#ifdef LM_ID_BASE // no dlmopen in musl

#ifndef __clang__
[[gnu::visibility("default")]] [[gnu::externally_visible]]
#endif
Expand All @@ -296,6 +298,8 @@ void* dlmopen(Lmid_t lmid, const char *filename, int flags) {
return reinterpret_cast<DlMOpenSignature>(func)(lmid, filename, flags);
}

#endif // LM_ID_BASE

#ifndef __clang__
[[gnu::visibility("default")]] [[gnu::externally_visible]]
#endif
Expand Down
4 changes: 3 additions & 1 deletion mysql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ if (USERVER_MYSQL_ALLOW_BUGGY_LIBMARIADB)
endif()
if(USERVER_MYSQL_OLD_INCLUDE)
target_compile_definitions(${PROJECT_NAME} PRIVATE -DUSERVER_MYSQL_OLD_INCLUDE=1)
target_compile_definitions(${PROJECT_NAME}-dbtest PRIVATE -DUSERVER_MYSQL_OLD_INCLUDE=1)
if(USERVER_BUILD_TESTS)
target_compile_definitions(${PROJECT_NAME}-dbtest PRIVATE -DUSERVER_MYSQL_OLD_INCLUDE=1)
endif()
endif()

_userver_directory_install(COMPONENT mysql FILES
Expand Down
36 changes: 36 additions & 0 deletions scripts/docs/en/deps/alpine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
boost1.84-dev
clang17-extra-tools
clang18
cmake
curl-dev
gflags-dev
git
grpc-cpp
grpc-dev
hiredis-dev
jemalloc-dev
krb5-dev
libev-dev
lz4-dev
lz4-static
make
mariadb-dev
mariadb-static
mongo-c-driver-dev
nghttp2-dev
openldap-dev
postgresql16
postgresql16-dev
protobuf-c-compiler
protobuf-c-dev
protobuf-dev
protoc
pugixml-dev
py3-jinja2
py3-protobuf
python3
python3-dev
snappy-dev
snappy-static
yaml-cpp-dev
compiler-rt
24 changes: 23 additions & 1 deletion scripts/docs/en/userver/build/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ CMAKE_COMMON_FLAGS += \
\b Dependencies: @ref scripts/docs/en/deps/gentoo.md "third_party/userver/scripts/docs/en/deps/gentoo.md"

Dependencies could be installed via:

```bash
sudo emerge --ask --update --oneshot $(cat scripts/docs/en/deps/gentoo.md | tr '\n' ' ')
```
Expand All @@ -155,6 +155,28 @@ CMAKE_COMMON_FLAGS += \
```


### Alpine

\b Dependencies: @ref scripts/docs/en/deps/alpine.md "third_party/userver/scripts/docs/en/deps/alpine.md"

Dependencies could be installed via:

```bash
sudo apk add $(cat scripts/docs/en/deps/alpine.md)
```

\b Recommended \b Makefile.local:

```cmake
CMAKE_COMMON_FLAGS += \
-DUSERVER_FEATURE_JEMALLOC=OFF \
-DUSERVER_FEATURE_STACKTRACE=OFF \
-DUSERVER_FEATURE_KAFKA=OFF \
-DUSERVER_DOWNLOAD_PACKAGE_PROTOBUF=ON \
-DUSERVER_DISABLE_RSEQ_ACCELERATION=YES
```


### Arch, Manjaro

\b Dependencies: @ref scripts/docs/en/deps/arch.md "third_party/userver/scripts/docs/en/deps/arch.md"
Expand Down
Loading