Skip to content

Commit 6ff99bf

Browse files
authored
Merge pull request #13 from asfernandes/work/vcpkg-firebird-client
Use Firebird client from vcpkg
2 parents e533b41 + d998622 commit 6ff99bf

79 files changed

Lines changed: 248 additions & 41743 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ jobs:
5858
run: |
5959
sudo apt-get update
6060
sudo apt-get install --no-install-recommends -y \
61+
autoconf \
62+
autoconf-archive \
63+
automake \
64+
libtool \
65+
libtool-bin \
6166
doxygen \
6267
graphviz \
6368
ninja-build \
@@ -73,27 +78,38 @@ jobs:
7378
7479
- name: Configure Firebird
7580
run: |
76-
{
77-
echo "FIREBIRD=/opt/firebird"
78-
echo "FIREBIRD_LOCK=${RUNNER_TEMP}"
79-
echo "LD_LIBRARY_PATH=/opt/firebird/lib:${LD_LIBRARY_PATH}"
80-
} >> "$GITHUB_ENV"
81+
sudo systemctl stop firebird
82+
echo "alter user SYSDBA password 'masterkey';" | \
83+
sudo /opt/firebird/bin/isql employee -user SYSDBA -q
84+
sudo systemctl start firebird
8185
8286
- name: Bootstrap vcpkg
8387
run: |
8488
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
8589
8690
- name: Configure CMake
8791
run: |
88-
cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja
92+
./gen-linux-x64-release.sh
93+
94+
- name: Upload vcpkg failure logs
95+
if: failure()
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: vcpkg-logs-${{ github.job }}
99+
path: vcpkg/buildtrees/**/*.log
100+
if-no-files-found: ignore
89101

90102
- name: Build Release targets
91103
run: |
92104
cmake --build build/Release
93105
94106
- name: Run tests
95107
run: |
96-
./build/Release/out/bin/fb-cpp-test --log_level=all
108+
export ISC_USER=sysdba
109+
export ISC_PASSWORD=masterkey
110+
export FBCPP_TEST_SERVER=localhost
111+
export FBCPP_TEST_DIR=/tmp
112+
./build/Release/out/bin/fb-cpp-test
97113
98114
- name: Build documentation
99115
run: |
@@ -136,7 +152,14 @@ jobs:
136152
- name: Configure Firebird
137153
shell: cmd
138154
run: |
139-
echo C:\Firebird>>%GITHUB_PATH%
155+
echo create user SYSDBA password 'masterkey'; ^
156+
| "C:\Firebird\isql.exe" employee -user SYSDBA -q
157+
158+
- name: Start Firebird Server
159+
shell: cmd
160+
working-directory: C:\Firebird
161+
run: |
162+
call install_service.bat
140163
141164
- name: Bootstrap vcpkg
142165
shell: cmd
@@ -146,7 +169,15 @@ jobs:
146169
- name: Configure CMake
147170
shell: cmd
148171
run: |
149-
cmake -S . -B build -G "Visual Studio 17 2022"
172+
.\gen-windows.bat
173+
174+
- name: Upload vcpkg failure logs
175+
if: failure()
176+
uses: actions/upload-artifact@v4
177+
with:
178+
name: vcpkg-logs-${{ github.job }}
179+
path: vcpkg/buildtrees/**/*.log
180+
if-no-files-found: ignore
150181

151182
- name: Build Release targets
152183
shell: cmd
@@ -156,6 +187,9 @@ jobs:
156187
- name: Run tests
157188
shell: cmd
158189
run: |
190+
set ISC_USER=sysdba
191+
set ISC_PASSWORD=masterkey
192+
set FBCPP_TEST_SERVER=localhost
159193
build\out\bin\Release\fb-cpp-test.exe
160194
161195
build-macos:
@@ -179,6 +213,14 @@ jobs:
179213
restore-keys: |
180214
${{ runner.os }}-vcpkg-
181215
216+
- name: Install system dependencies
217+
run: |
218+
brew install \
219+
autoconf \
220+
autoconf-archive \
221+
automake \
222+
libtool
223+
182224
- name: Install Firebird
183225
run: |
184226
wget -nv -O Firebird-5.0.3.1683-0-macos-arm64.pkg \
@@ -187,28 +229,37 @@ jobs:
187229
188230
- name: Configure Firebird
189231
run: |
190-
{
191-
echo "FIREBIRD_LOCK=${RUNNER_TEMP}"
192-
echo "DYLD_LIBRARY_PATH=/Library/Frameworks/Firebird.framework/Resources/lib:${DYLD_LIBRARY_PATH}"
193-
echo "ISC_USER=sysdba"
194-
echo "ISC_PASSWORD=masterkey"
195-
} >> "$GITHUB_ENV"
232+
sudo launchctl unload /Library/LaunchDaemons/org.firebird.gds.plist
233+
echo "alter user SYSDBA password 'masterkey';" | \
234+
sudo /Library/Frameworks/Firebird.framework/Versions/A/Resources/bin/isql employee -user SYSDBA -q
235+
sudo launchctl load /Library/LaunchDaemons/org.firebird.gds.plist
196236
197237
- name: Bootstrap vcpkg
198238
run: |
199239
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
200240
201241
- name: Configure CMake
202242
run: |
203-
cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja
243+
./gen-osx-arm64-release.sh
244+
245+
- name: Upload vcpkg failure logs
246+
if: failure()
247+
uses: actions/upload-artifact@v4
248+
with:
249+
name: vcpkg-logs-${{ github.job }}
250+
path: vcpkg/buildtrees/**/*.log
251+
if-no-files-found: ignore
204252

205253
- name: Build Release targets
206254
run: |
207255
cmake --build build/Release
208256
209257
- name: Run tests
210258
run: |
211-
./build/Release/out/bin/fb-cpp-test --log_level=all
259+
export ISC_USER=sysdba
260+
export ISC_PASSWORD=masterkey
261+
export FBCPP_TEST_SERVER=localhost
262+
./build/Release/out/bin/fb-cpp-test
212263
213264
deploy-docs:
214265
runs-on: ubuntu-latest

.github/workflows/pull-request.yml

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
run: |
5050
sudo apt-get update
5151
sudo apt-get install --no-install-recommends -y \
52+
autoconf \
53+
autoconf-archive \
54+
automake \
55+
libtool \
56+
libtool-bin \
5257
doxygen \
5358
graphviz \
5459
ninja-build \
@@ -64,27 +69,38 @@ jobs:
6469
6570
- name: Configure Firebird
6671
run: |
67-
{
68-
echo "FIREBIRD=/opt/firebird"
69-
echo "FIREBIRD_LOCK=${RUNNER_TEMP}"
70-
echo "LD_LIBRARY_PATH=/opt/firebird/lib:${LD_LIBRARY_PATH}"
71-
} >> "$GITHUB_ENV"
72+
sudo systemctl stop firebird
73+
echo "alter user SYSDBA password 'masterkey';" | \
74+
sudo /opt/firebird/bin/isql employee -user SYSDBA -q
75+
sudo systemctl start firebird
7276
7377
- name: Bootstrap vcpkg
7478
run: |
7579
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
7680
7781
- name: Configure CMake
7882
run: |
79-
cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja
83+
./gen-linux-x64-release.sh
84+
85+
- name: Upload vcpkg failure logs
86+
if: failure()
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: vcpkg-logs-${{ github.job }}
90+
path: vcpkg/buildtrees/**/*.log
91+
if-no-files-found: ignore
8092

8193
- name: Build Release targets
8294
run: |
8395
cmake --build build/Release
8496
8597
- name: Run tests
8698
run: |
87-
./build/Release/out/bin/fb-cpp-test --log_level=all
99+
export ISC_USER=sysdba
100+
export ISC_PASSWORD=masterkey
101+
export FBCPP_TEST_SERVER=localhost
102+
export FBCPP_TEST_DIR=/tmp
103+
./build/Release/out/bin/fb-cpp-test
88104
89105
- name: Build documentation
90106
run: |
@@ -122,7 +138,14 @@ jobs:
122138
- name: Configure Firebird
123139
shell: cmd
124140
run: |
125-
echo C:\Firebird>>%GITHUB_PATH%
141+
echo create user SYSDBA password 'masterkey'; ^
142+
| "C:\Firebird\isql.exe" employee -user SYSDBA -q
143+
144+
- name: Start Firebird Server
145+
shell: cmd
146+
working-directory: C:\Firebird
147+
run: |
148+
call install_service.bat
126149
127150
- name: Bootstrap vcpkg
128151
shell: cmd
@@ -132,7 +155,15 @@ jobs:
132155
- name: Configure CMake
133156
shell: cmd
134157
run: |
135-
cmake -S . -B build -G "Visual Studio 17 2022"
158+
.\gen-windows.bat
159+
160+
- name: Upload vcpkg failure logs
161+
if: failure()
162+
uses: actions/upload-artifact@v4
163+
with:
164+
name: vcpkg-logs-${{ github.job }}
165+
path: vcpkg/buildtrees/**/*.log
166+
if-no-files-found: ignore
136167

137168
- name: Build Release targets
138169
shell: cmd
@@ -142,6 +173,9 @@ jobs:
142173
- name: Run tests
143174
shell: cmd
144175
run: |
176+
set ISC_USER=sysdba
177+
set ISC_PASSWORD=masterkey
178+
set FBCPP_TEST_SERVER=localhost
145179
build\out\bin\Release\fb-cpp-test.exe
146180
147181
build-macos:
@@ -165,6 +199,14 @@ jobs:
165199
restore-keys: |
166200
${{ runner.os }}-vcpkg-
167201
202+
- name: Install system dependencies
203+
run: |
204+
brew install \
205+
autoconf \
206+
autoconf-archive \
207+
automake \
208+
libtool
209+
168210
- name: Install Firebird
169211
run: |
170212
wget -nv -O Firebird-5.0.3.1683-0-macos-arm64.pkg \
@@ -173,25 +215,34 @@ jobs:
173215
174216
- name: Configure Firebird
175217
run: |
176-
{
177-
echo "FIREBIRD_LOCK=${RUNNER_TEMP}"
178-
echo "DYLD_LIBRARY_PATH=/Library/Frameworks/Firebird.framework/Resources/lib:${DYLD_LIBRARY_PATH}"
179-
echo "ISC_USER=sysdba"
180-
echo "ISC_PASSWORD=masterkey"
181-
} >> "$GITHUB_ENV"
218+
sudo launchctl unload /Library/LaunchDaemons/org.firebird.gds.plist
219+
echo "alter user SYSDBA password 'masterkey';" | \
220+
sudo /Library/Frameworks/Firebird.framework/Versions/A/Resources/bin/isql employee -user SYSDBA -q
221+
sudo launchctl load /Library/LaunchDaemons/org.firebird.gds.plist
182222
183223
- name: Bootstrap vcpkg
184224
run: |
185225
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
186226
187227
- name: Configure CMake
188228
run: |
189-
cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja
229+
./gen-osx-arm64-release.sh
230+
231+
- name: Upload vcpkg failure logs
232+
if: failure()
233+
uses: actions/upload-artifact@v4
234+
with:
235+
name: vcpkg-logs-${{ github.job }}
236+
path: vcpkg/buildtrees/**/*.log
237+
if-no-files-found: ignore
190238

191239
- name: Build Release targets
192240
run: |
193241
cmake --build build/Release
194242
195243
- name: Run tests
196244
run: |
197-
./build/Release/out/bin/fb-cpp-test --log_level=all
245+
export ISC_USER=sysdba
246+
export ISC_PASSWORD=masterkey
247+
export FBCPP_TEST_SERVER=localhost
248+
./build/Release/out/bin/fb-cpp-test

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
```
1717
1818
### Build
19-
- If .cpp files are added, it's necessary to run `./gen-linux-debug.sh` (non-Windows) or `gen-windows.bat` (Windows) from the repo root.
19+
- If .cpp files are added, it's necessary to run `./gen-linux-x64-debug.sh` (non-Windows) or `gen-windows.bat` (Windows) from the repo root.
2020
- Use `cmake --build build/Debug/` (non-Windows) or `cmake --build build --config Debug` (Windows) from the repo root.
2121
2222
### Tests

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.18)
33
set(VCPKG_ROOT "vcpkg")
44
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
55

6+
if(NOT DEFINED VCPKG_OVERLAY_TRIPLETS)
7+
set(VCPKG_OVERLAY_TRIPLETS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/triplets" CACHE STRING "")
8+
endif()
9+
610
set(CMAKE_CXX_STANDARD 20)
711
set(CMAKE_CXX_STANDARD_REQUIRED ON)
812
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set(VCPKG_TARGET_ARCHITECTURE arm64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
5+
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
6+
set(VCPKG_OSX_ARCHITECTURES arm64)
7+
8+
if(PORT MATCHES "^(icu)$")
9+
set(VCPKG_LIBRARY_LINKAGE dynamic)
10+
endif()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set(VCPKG_TARGET_ARCHITECTURE x64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
5+
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
6+
7+
if(PORT MATCHES "^(icu)$")
8+
set(VCPKG_LIBRARY_LINKAGE dynamic)
9+
endif()

gen-linux-debug.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

gen-linux-release.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

gen-linux-x64-debug.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
cmake -S . -B build/Debug \
3+
-DCMAKE_BUILD_TYPE=Debug \
4+
-DCMAKE_VERBOSE_MAKEFILE=ON \
5+
-DVCPKG_TARGET_TRIPLET=x64-linux-custom \
6+
-DVCPKG_OVERLAY_TRIPLETS=cmake/triplets \
7+
-G Ninja

gen-linux-x64-release.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
cmake -S . -B build/Release \
3+
-DCMAKE_BUILD_TYPE=Release \
4+
-DCMAKE_VERBOSE_MAKEFILE=ON \
5+
-DVCPKG_TARGET_TRIPLET=x64-linux-custom \
6+
-DVCPKG_OVERLAY_TRIPLETS=cmake/triplets \
7+
-G Ninja

0 commit comments

Comments
 (0)