-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mysql 8.0.33 alpine static build (#89)
- windows shared build - gnu libc shared build with static ssl
- Loading branch information
Showing
9 changed files
with
415 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: mysql | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
alpine-musl: | ||
if: ${{ vars.CURRENT_TOOL == github.workflow }} | ||
uses: ./.github/workflows/build-alpine.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
|
||
ubuntu-gnu: | ||
if: ${{ vars.CURRENT_TOOL == github.workflow }} | ||
uses: ./.github/workflows/build-ubuntu.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
version: 20.04 | ||
|
||
windows-msvc: | ||
if: ${{ vars.CURRENT_TOOL == github.workflow }} | ||
uses: ./.github/workflows/build-windows.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
toolset: msvc | ||
|
||
test-alpine: | ||
needs: alpine-musl | ||
uses: ./.github/workflows/test-alpine.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-musl | ||
|
||
test-ubuntu-1804-musl: | ||
needs: alpine-musl | ||
uses: ./.github/workflows/test-ubuntu.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-musl | ||
version: 18.04 | ||
|
||
test-ubuntu-musl: | ||
needs: alpine-musl | ||
uses: ./.github/workflows/test-ubuntu.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-musl | ||
|
||
test-ubuntu: | ||
needs: ubuntu-gnu | ||
uses: ./.github/workflows/test-ubuntu.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-gnu | ||
|
||
test-ubuntu-2004: | ||
needs: ubuntu-gnu | ||
uses: ./.github/workflows/test-ubuntu.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-gnu | ||
version: 20.04 | ||
|
||
test-alpine-gnu: | ||
needs: ubuntu-gnu | ||
uses: ./.github/workflows/test-ubuntu.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-gnu | ||
|
||
test-windows: | ||
needs: windows-msvc | ||
uses: ./.github/workflows/test-windows.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
artifact: build-msvc | ||
|
||
release: | ||
needs: [test-alpine, | ||
test-ubuntu-musl, | ||
test-ubuntu-1804-musl, | ||
test-ubuntu, | ||
test-ubuntu-2004, | ||
test-alpine-gnu, | ||
test-windows] | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
workflow: ${{ github.workflow }} | ||
tool_version: '8.0.33' | ||
prepare_body: | | ||
bsdtar -Oxf ./build-musl/build-musl.tar.gz build-musl.md >> body.md | ||
bsdtar -Oxf ./build-gnu/build-gnu.tar.gz build-gnu.md >> body.md | ||
bsdtar -Oxf ./build-msvc/build-msvc.tar.gz build-msvc.md >> body.md | ||
artifacts: ./build-musl/build-musl.tar.gz,./build-gnu/build-gnu.tar.gz,./build-msvc/build-msvc.tar.gz | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
dp0="$(realpath "$(dirname "$0")")" | ||
set -e | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
echo "::group::install deps" | ||
|
||
apt update | ||
apt install -y build-essential cmake wget | ||
apt install -y libaio-dev libudev-dev libssl-dev ncurses-dev libc6-dev | ||
|
||
echo "::endgroup::" | ||
|
||
tool_name="mysql" | ||
tool_version="8.0.33" | ||
self_toolset_name="build-gnu" | ||
release_version_dirpath="$dp0/release/build" | ||
|
||
mkdir -p "$release_version_dirpath" && cd "$dp0/release" | ||
|
||
download_url="https://github.com/mysql/mysql-server/archive/refs/tags/$tool_name-$tool_version.tar.gz" | ||
echo "::group::prepare sources $download_url" | ||
|
||
"$dp0/../.tools/download_bsdtar.sh" | ||
bsdtar="$dp0/release/bsdtar" | ||
|
||
wget "$download_url" -O "tool-$tool_version.tar.gz" | ||
"$bsdtar" -xf "tool-$tool_version.tar.gz" && cd "mysql-server-mysql-$tool_version" | ||
|
||
echo "::endgroup::" | ||
|
||
echo "::group::build" | ||
|
||
cmake . \ | ||
-DDOWNLOAD_BOOST=1 \ | ||
-DWITH_BOOST=./boost \ | ||
-DFORCE_INSOURCE_BUILD=1 \ | ||
-DWITHOUT_SERVER=1 \ | ||
-DBUILD_SHARED_LIBS=0 \ | ||
-DCMAKE_EXE_LINKER_FLAGS="-lssl -lcrypto" \ | ||
-DWITH_UNIT_TESTS=0 \ | ||
-DWITH_BUILD_ID=0 \ | ||
-DREPRODUCIBLE_BUILD=1 \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_CONFIG=mysql_release | ||
|
||
find . -type f -mindepth 2 -maxdepth 5 -name "link.txt" \ | ||
-exec echo replace '.so' "{}" \; \ | ||
-exec sed -i -e 's@/usr/lib/x86_64-linux-gnu/libssl.so@/usr/lib/x86_64-linux-gnu/libssl.a@g' \ | ||
-e 's@/usr/lib/x86_64-linux-gnu/libcrypto.so@/usr/lib/x86_64-linux-gnu/libcrypto.a@g' "{}" \; | ||
|
||
cmake --build . --config Release | ||
|
||
echo "::endgroup::" | ||
|
||
cp -rf "./runtime_output_directory/." "$release_version_dirpath/" | ||
|
||
cd "$release_version_dirpath" | ||
|
||
find . -mindepth 1 -maxdepth 1 -name '*test*' -exec rm -f "{}" \; | ||
find . -mindepth 1 -maxdepth 1 ! -name "mysql*" -exec rm -f "{}" \; | ||
find . -mindepth 1 -maxdepth 1 -exec strip "{}" \; | ||
|
||
ldd "$tool_name" | ||
|
||
{ printf '### %s | ||
%s | ||
<details> | ||
<summary>ldd mysql</summary> | ||
``` | ||
%s | ||
``` | ||
</details> | ||
<details> | ||
<summary>sha256sum ./*</summary> | ||
``` | ||
%s | ||
``` | ||
</details> | ||
' "$self_toolset_name.tar.gz" "$("./$tool_name" --version)" "$(ldd "$tool_name")" "$(sha256sum ./*)" | ||
} > "$self_toolset_name.md" | ||
|
||
cat "$self_toolset_name.md" | ||
|
||
tar -czvf "../$self_toolset_name.tar.gz" . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
dp0="$(realpath "$(dirname "$0")")" | ||
set -e | ||
|
||
echo "::group::install deps" | ||
|
||
echo "::endgroup::" | ||
|
||
tool_name="mysql" | ||
tool_version="8.0.33" | ||
self_toolset_name="build-msvc" | ||
release_version_dirpath="$dp0/release/build" | ||
|
||
mkdir -p "$release_version_dirpath" && cd "$dp0/release" | ||
|
||
download_url="https://github.com/mysql/mysql-server/archive/refs/tags/$tool_name-$tool_version.tar.gz" | ||
echo "::group::prepare sources $download_url" | ||
|
||
"$dp0/../.tools/download_bsdtar.sh" | ||
bsdtar="$dp0/release/bsdtar" | ||
|
||
wget "$download_url" -O "tool-$tool_version.tar.gz" | ||
"$bsdtar" -xf "tool-$tool_version.tar.gz" && cd "mysql-server-mysql-$tool_version" | ||
|
||
echo "::endgroup::" | ||
|
||
echo "::group::build" | ||
|
||
cmake . \ | ||
-DDOWNLOAD_BOOST=1 \ | ||
-DWITH_BOOST=./boost \ | ||
-DFORCE_INSOURCE_BUILD=1 \ | ||
-DWITHOUT_SERVER=1 \ | ||
-DBUILD_SHARED_LIBS=0 \ | ||
-DWITH_UNIT_TESTS=0 \ | ||
-DREPRODUCIBLE_BUILD=1 \ | ||
-G "Visual Studio 16 2019" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_CONFIG=mysql_release | ||
|
||
cmake --build . --config Release | ||
|
||
cp -rf "./runtime_output_directory/Release/." "$release_version_dirpath/" | ||
|
||
cd "$release_version_dirpath" | ||
|
||
find . -mindepth 1 -maxdepth 1 -name '*test*' -exec rm -f "{}" \; | ||
find . -mindepth 1 -maxdepth 1 \( ! -name "mysql*" -and ! -name "lib*" \) -exec rm -f "{}" \; | ||
|
||
{ printf '### %s | ||
%s | ||
<details> | ||
<summary>sha256sum ./*</summary> | ||
``` | ||
%s | ||
``` | ||
</details> | ||
%s | ||
' "$self_toolset_name.tar.gz" "$("./$tool_name" --version)" "$(sha256sum ./*)" "$download_url" | ||
} > "$self_toolset_name.md" | ||
|
||
cat "$self_toolset_name.md" | ||
|
||
tar -czvf "../$self_toolset_name.tar.gz" . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/bin/bash | ||
dp0="$(realpath "$(dirname "$0")")" | ||
set -e | ||
|
||
echo "::group::install deps" | ||
|
||
apk update | ||
apk add --no-cache alpine-sdk linux-headers build-base autoconf cmake | ||
apk add --no-cache libaio-dev eudev-dev openldap-dev openssl-dev openssl-libs-static ncurses-dev ncurses-static | ||
|
||
echo "::endgroup::" | ||
|
||
tool_name="mysql" | ||
tool_version="8.0.33" | ||
self_toolset_name="build-musl" | ||
release_version_dirpath="$dp0/release/build" | ||
|
||
mkdir -p "$release_version_dirpath" && cd "$dp0/release" | ||
|
||
download_url="https://github.com/mysql/mysql-server/archive/refs/tags/$tool_name-$tool_version.tar.gz" | ||
echo "::group::prepare sources $download_url" | ||
|
||
"$dp0/../.tools/download_bsdtar.sh" | ||
bsdtar="$dp0/release/bsdtar" | ||
|
||
wget "$download_url" -O "tool-$tool_version.tar.gz" | ||
"$bsdtar" -xf "tool-$tool_version.tar.gz" && cd "mysql-server-mysql-$tool_version" | ||
|
||
patch "./libmysql/dns_srv.cc" "$dp0/release/mysql-connector-c-8.0.27-res_n.patch" | ||
patch "./sql/memory/aligned_atomic.h" "$dp0/release/_cache_line_size.patch" | ||
|
||
echo "::endgroup::" | ||
|
||
echo "::group::build" | ||
|
||
cmake . \ | ||
-DDOWNLOAD_BOOST=1 \ | ||
-DWITH_BOOST=./boost \ | ||
-DFORCE_INSOURCE_BUILD=1 \ | ||
-DWITHOUT_SERVER=1 \ | ||
-DBUILD_SHARED_LIBS=0 \ | ||
-DCMAKE_EXE_LINKER_FLAGS="-lssl -lcrypto -static" \ | ||
-DWITH_UNIT_TESTS=0 \ | ||
-DWITH_BUILD_ID=0 \ | ||
-DREPRODUCIBLE_BUILD=1 \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DBUILD_CONFIG=mysql_release | ||
|
||
find . -type f -mindepth 2 -maxdepth 5 \( -path "*test*/link.txt" -or -path "*json_binlog_main.dir/link.txt" \) \ | ||
-exec echo remove '-static' "{}" \; \ | ||
-exec sed -i -e 's@ -static @ @g' "{}" \; | ||
|
||
find . -type f -mindepth 2 -maxdepth 5 -name "link.txt" \ | ||
-exec echo replace '.so' "{}" \; \ | ||
-exec sed -i -e 's@/usr/lib/libssl.so@/usr/lib/libssl.a@g' \ | ||
-e 's@/usr/lib/libcrypto.so@/usr/lib/libcrypto.a@g' \ | ||
"{}" \; | ||
|
||
cmake --build . --config Release | ||
|
||
echo "::endgroup::" | ||
|
||
cp -rf "./runtime_output_directory/." "$release_version_dirpath/" | ||
|
||
cd "$release_version_dirpath" | ||
|
||
find . -mindepth 1 -maxdepth 1 -name '*test*' -exec rm -f "{}" \; | ||
find . -mindepth 1 -maxdepth 1 ! -name "mysql*" -exec rm -f "{}" \; | ||
find . -mindepth 1 -maxdepth 1 -exec strip "{}" \; | ||
|
||
{ printf '### %s | ||
%s | ||
<details> | ||
<summary>sha256sum ./*</summary> | ||
``` | ||
%s | ||
``` | ||
</details> | ||
' "$self_toolset_name.tar.gz" "$("./$tool_name" --version)" "$(sha256sum ./*)" | ||
} > "$self_toolset_name.md" | ||
|
||
cat "$self_toolset_name.md" | ||
|
||
tar -czvf "../$self_toolset_name.tar.gz" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# commit dcfbe3e4b7ad1ded9b17fa04743e9f97b8aad9fa | ||
# Author: Sam James <[email protected]> | ||
# Date: Sun Apr 9 04:04:06 2023 +0100 | ||
# | ||
# sql/memory: Fix build on musl | ||
# | ||
# _SC_LEVEL1_DCACHE_LINESIZE is not always available on Linux, e.g. with musl libc. | ||
# | ||
# It's provided by glibc instead and is a glibc-internal. | ||
# | ||
# diff --git a/sql/memory/aligned_atomic.h b/sql/memory/aligned_atomic.h | ||
# index d13d45b9dee..bd19c0cf4d6 100644 | ||
--- a/sql/memory/aligned_atomic.h | ||
+++ b/sql/memory/aligned_atomic.h | ||
@@ -76,7 +76,7 @@ static inline size_t _cache_line_size() { | ||
return line_size; | ||
} | ||
|
||
-#elif defined(__linux__) | ||
+#elif defined(__GLIBC__) | ||
static inline size_t _cache_line_size() { | ||
long size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); | ||
if (size == -1) return 64; |
Oops, something went wrong.