Skip to content
Merged
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
363 changes: 363 additions & 0 deletions .github/workflows/static-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,363 @@
name: Static Client Build

on:
workflow_dispatch:

env:
ISC_USER: sysdba
ISC_PASSWORD: masterkey

jobs:

build-linux-static-client:
name: build-linux-static-client-${{ matrix.arch }}
runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }}

strategy:
fail-fast: false
matrix:
arch: [x64, x86]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10

- name: Firebird install
env:
FB_ARCH: ${{ matrix.arch }}
run: |
set -e
if [ "$FB_ARCH" = "x86" ]; then
sudo dpkg --add-architecture i386 && sudo apt-get update
FB_LIBS="libicu74:i386 libtommath1:i386 libz1:i386"
else
FB_LIBS="libtommath1"
fi
sudo apt-get install -y $FB_LIBS
FB_PACKAGE="Firebird-5.0.4.1812-0-linux-${FB_ARCH}.tar.gz"
FB_DIR="Firebird-5.0.4.1812-0-linux-${FB_ARCH}"
wget -nv -O "$FB_PACKAGE" "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$FB_PACKAGE"
tar xzvf "$FB_PACKAGE"
(cd "$FB_DIR"; sudo ./install.sh -silent)
FB_PASSWORD=$(sudo awk -F= '$1 == "ISC_PASSWORD" {print $2}' /opt/firebird/SYSDBA.password)
sudo /opt/firebird/bin/gsec -user sysdba -password "$FB_PASSWORD" -modify sysdba -pw masterkey
sudo sed -i \
-e 's/^ISC_PASSWORD=.*/ISC_PASSWORD=masterkey/' \
-e 's/^ISC_PASSWD=.*/ISC_PASSWD=masterkey/' \
/opt/firebird/SYSDBA.password
sudo usermod -a -G firebird "$(whoami)"
sudo gpasswd -r firebird
sudo mkdir -p /tmp/firebird-static
sudo chmod 777 /tmp/firebird-static
- name: Write build script
run: |
mkdir -p gen
cat > /tmp/build-static-client.sh <<'EOF'
#!/bin/sh
set -e
gcc -v
ld -v
make -v
cd /firebird
./autogen.sh \
--host=$BUILD_ARCH \
--prefix=/opt/firebird \
--enable-binreloc \
--with-builtin-tomcrypt \
--with-termlib=:libncurses.a \
--with-atomiclib=:libatomic.a \
--enable-client-only
make client_static -j$(nproc)
# CXX lives in gen/make.defaults (substituted by configure). The
# top-level Makefile only forwards targets to gen/ and has no CXX=.
CXX=$(sed -n 's/^[[:space:]]*CXX[[:space:]]*=[[:space:]]*//p' gen/make.defaults | head -n 1)
if test -z "$CXX"; then
echo "error: could not determine CXX from gen/make.defaults" >&2
exit 1
fi
echo "Linking example with CXX=$CXX"
"$CXX" examples/interfaces/01.create.cpp \
-I/firebird/src/include \
-Igen/Release/firebird/include \
-Lgen/Release/firebird/lib \
-Ltemp/Release \
-lfbclient -ltommath -ltomcrypt -lz -ldl -pthread \
-o /firebird/01.create
EOF
chmod +x /tmp/build-static-client.sh
- name: Build
run: |
docker run --platform ${{ (matrix.arch == 'x64' && 'amd64') || 'i386' }} --rm \
--user $(id -u):$(id -g) \
-v ${{ github.workspace }}:/firebird \
-v /tmp/build-static-client.sh:/build.sh:ro \
asfernandes/firebird-builder:fb5-${{ matrix.arch }}-ng-v1
- name: Run interface example
run: |
mkdir -p static-client
cp -a 01.create /opt/firebird/lib/libtom* static-client/
LD_LIBRARY_PATH="$PWD/static-client" \
ISC_PATH=localhost:/tmp/firebird-static static-client/01.create
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-linux-${{ matrix.arch }}-static-client
path: gen/Release/firebird/lib/libfbclient.a

build-linux-static-client-arm64:
name: build-linux-static-client-arm64
runs-on: ubuntu-24.04-arm

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10

- name: Firebird install
run: |
set -e
sudo apt-get install -y libtommath-dev libtomcrypt-dev
FB_PACKAGE=Firebird-5.0.4.1812-0-linux-arm64.tar.gz
FB_DIR=Firebird-5.0.4.1812-0-linux-arm64
wget -nv -O "$FB_PACKAGE" "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$FB_PACKAGE"
tar xzvf "$FB_PACKAGE"
(cd "$FB_DIR"; sudo ./install.sh -silent)
FB_PASSWORD=$(sudo awk -F= '$1 == "ISC_PASSWORD" {print $2}' /opt/firebird/SYSDBA.password)
sudo /opt/firebird/bin/gsec -user sysdba -password "$FB_PASSWORD" -modify sysdba -pw masterkey
sudo sed -i \
-e 's/^ISC_PASSWORD=.*/ISC_PASSWORD=masterkey/' \
-e 's/^ISC_PASSWD=.*/ISC_PASSWD=masterkey/' \
/opt/firebird/SYSDBA.password
sudo usermod -a -G firebird "$(whoami)"
sudo gpasswd -r firebird
sudo mkdir -p /tmp/firebird-static
sudo chmod 777 /tmp/firebird-static
- name: Prepare
run: |
sudo apt-get install -y libtool-bin automake autoconf-archive libtool libicu-dev zlib1g-dev cmake
- name: Build
run: |
./autogen.sh \
--without-editline \
--enable-binreloc \
--prefix=/opt/firebird \
--enable-client-only
make client_static -j$(nproc)
- name: Compile and link interface example
run: |
g++ examples/interfaces/01.create.cpp \
-Isrc/include \
-Igen/Release/firebird/include \
-Lgen/Release/firebird/lib \
-Ltemp/Release \
-lfbclient -ltommath -ltomcrypt -lz -ldl -pthread \
-o /tmp/01.create
- name: Run interface example
run: |
ISC_PATH=localhost:/tmp/firebird-static /tmp/01.create
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-linux-arm64-static-client
path: gen/Release/firebird/lib/libfbclient.a

build-macos-static-client:
name: build-macos-static-client-${{ matrix.arch }}
runs-on: ${{ (matrix.arch == 'arm64' && 'macos-15') || 'macos-15-intel' }}

strategy:
fail-fast: false
matrix:
arch: [x64, arm64]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
submodules: 'true'

- name: Prepare - Install tools
run: |
brew install --quiet automake autoconf-archive libtool ninja python-setuptools
- name: Firebird install
env:
FB_ARCH: ${{ matrix.arch }}
run: |
set -e
sudo chmod +a "everyone allow read,write,execute,delete,add_file,add_subdirectory,file_inherit,directory_inherit" /tmp
FB_PACKAGE="Firebird-5.0.4.1812-0-macos-${FB_ARCH}.pkg"
wget -nv -O "$FB_PACKAGE" "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$FB_PACKAGE"
sudo installer -verbose -pkg "$FB_PACKAGE" -target /
sudo mkdir -p /tmp/firebird-static
sudo chmod 777 /tmp/firebird-static
- name: Restore vcpkg cache
uses: actions/cache/restore@v4
id: restore-vcpkg-cache
with:
path: ~/.cache/vcpkg/archives
key: vcpkg-cache-${{ runner.os }}-${{ matrix.arch }}-staticclient-${{ hashFiles('vcpkg-custom/**', 'vcpkg.json', 'vcpkg-configuration.json') }}
restore-keys: |
vcpkg-cache-${{ runner.os }}-${{ matrix.arch }}-staticclient-
vcpkg-cache-${{ runner.os }}-${{ matrix.arch }}-
- name: Build
run: |
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool
export PATH="$(brew --prefix python@3.11)/bin:$PATH"
export SDKROOT=$(xcrun --show-sdk-path)
./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt --enable-client-only
make client_static -j4
- name: Compile and link interface example
run: |
clang++ examples/interfaces/01.create.cpp \
-Isrc/include \
-Igen/Release/firebird/include \
-Lgen/Release/firebird/lib \
-Ltemp/Release \
-lfbclient -ltommath -ltomcrypt -lz \
-liconv -lobjc -framework CoreFoundation -framework Foundation -framework Security \
-Wl,-rpath,"$GITHUB_WORKSPACE/gen/Release/firebird" \
-dead_strip \
-o /tmp/01.create
- name: Run interface example
run: |
ISC_PATH=localhost:/tmp/firebird-static /tmp/01.create
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-macos-${{ matrix.arch }}-static-client
path: gen/Release/firebird/lib/libfbclient.a

- name: Save vcpkg cache
uses: actions/cache/save@v4
if: steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
with:
path: ~/.cache/vcpkg/archives
key: ${{ steps.restore-vcpkg-cache.outputs.cache-primary-key }}

build-windows-static-client:
name: build-windows-static-client-${{ matrix.platform }}
runs-on: ${{ (matrix.platform == 'arm64' && 'windows-11-arm') || 'windows-2025' }}
env:
VS_VERSION: '2026'

strategy:
fail-fast: false
matrix:
platform: [x64, x86, arm64]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10

- name: Prepare
shell: cmd
run: |
for /r %%i in (*.bat) do unix2dos "%%i"
- name: Prepare envs
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
run: |
if "%PLATFORM%" == "x64" set FB_VS_ARCH=amd64
if "%PLATFORM%" == "x64" set FB_PROCESSOR_ARCHITECTURE=AMD64
if "%PLATFORM%" == "x86" set FB_VS_ARCH=x86
if "%PLATFORM%" == "x86" set FB_PROCESSOR_ARCHITECTURE=x86
if "%PLATFORM%" == "x86" set FB_LIBRARY_PLATFORM=Win32
if "%PLATFORM%" == "arm64" set FB_VS_ARCH=arm64
if "%PLATFORM%" == "arm64" set FB_PROCESSOR_ARCHITECTURE=ARM64
if not "%PLATFORM%" == "x86" set FB_LIBRARY_PLATFORM=%PLATFORM%
echo FB_VS_ARCH=%FB_VS_ARCH%>>%GITHUB_ENV%
echo FB_PROCESSOR_ARCHITECTURE=%FB_PROCESSOR_ARCHITECTURE%>>%GITHUB_ENV%
echo FB_LIBRARY_PLATFORM=%FB_LIBRARY_PLATFORM%>>%GITHUB_ENV%
if "%PLATFORM%" == "arm64" (
echo FB_SYSTEM_LIBS=WITH_SYSTEM_ICU WITH_SYSTEM_ZLIB>>%GITHUB_ENV%
echo FBBUILD_SYSTEM_INCLUDE_DIR=%VCPKG_INSTALLATION_ROOT%\installed\arm64-windows\include>>%GITHUB_ENV%
)
# Windows/ARM64 build requires system ICU and zlib (no bundled arm64 binaries in this branch)
- name: Install ICU and zlib (system)
if: ${{ matrix.platform == 'arm64' }}
shell: cmd
run: |
vcpkg install --classic icu:arm64-windows zlib:arm64-windows
echo PATH=%VCPKG_INSTALLATION_ROOT%\installed\arm64-windows\bin;%PATH%>> %GITHUB_ENV%
# No 5.0.4 for ARM64 in Windows
- name: Firebird install
if: ${{ matrix.platform != 'arm64' }}
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
run: |
set FB_ZIP=Firebird-5.0.4.1812-0-windows-%PLATFORM%.zip
powershell Invoke-WebRequest "https://github.com/FirebirdSQL/firebird/releases/download/v5.0.4/$env:FB_ZIP" -OutFile "$env:FB_ZIP"
7z x -oC:\Firebird %FB_ZIP%
echo C:\Firebird>>%GITHUB_PATH%
set "PATH=C:\Firebird;%PATH%"
cd /d C:\Firebird
instreg install -z
> init-security.sql echo create user SYSDBA password 'masterkey';
>> init-security.sql echo quit;
isql -user sysdba employee -i init-security.sql
del init-security.sql
instsvc install -z
instsvc start
powershell -NoProfile -Command "Start-Sleep -Seconds 2"
- name: Build
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
VS_SCRIPT: C:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\Tools\VsDevCmd.bat
run: |
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
set "PATH=%VSINSTALLDIR%VC\Tools\Llvm\x64\bin;%PATH%"
cd builds\win32
call run_all.bat CLIENT_ONLY=STATIC JUSTBUILD NOCLEAN %FB_SYSTEM_LIBS%
- name: Compile and link interface example
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
VS_SCRIPT: C:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\Tools\VsDevCmd.bat
run: |
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
cl /nologo /EHsc /MD /Isrc\include /Ioutput_%FB_LIBRARY_PLATFORM%_release\include examples\interfaces\01.create.cpp output_%FB_LIBRARY_PLATFORM%_release\lib\fbclient_static_ms.lib extern\libtommath\lib\%FB_LIBRARY_PLATFORM%\Release\tommath.lib extern\libtomcrypt\lib\%FB_LIBRARY_PLATFORM%\Release\tomcrypt.lib advapi32.lib bcrypt.lib legacy_stdio_definitions.lib mpr.lib ole32.lib psapi.lib shell32.lib user32.lib ws2_32.lib /Fe:%TEMP%\01.create.exe
- name: Run interface example
if: ${{ matrix.platform != 'arm64' }}
shell: cmd
run: |
set "PATH=C:\Firebird;%PATH%"
if not exist C:\Windows\Temp\firebird-static mkdir C:\Windows\Temp\firebird-static
set ISC_PATH=localhost:C:/Windows/Temp/firebird-static
"%TEMP%\01.create.exe"
- name: Upload static library
uses: actions/upload-artifact@v4
with:
name: firebird-windows-${{ matrix.platform }}-static-client
path: output_${{ env.FB_LIBRARY_PLATFORM }}_release\lib\fbclient_static_ms.lib
1 change: 1 addition & 0 deletions builds/cmake/Configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
endif()

set(ENABLE_BINRELOC 1)
set(HAVE_TOMCRYPT 1)

string(TOUPPER ${CMAKE_SYSTEM_NAME} CMAKE_SYSTEM_NAME_UPPER)
set(${CMAKE_SYSTEM_NAME_UPPER} 1)
Expand Down
Loading
Loading