Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f296f44
Move gds.cpp to common.
asfernandes Jul 18, 2022
8740a38
Move gds_proto.h to common.
asfernandes Jul 18, 2022
6a8de73
Import boost_1_79_0 test and dependent library's headers using bcp.
asfernandes Jul 18, 2022
bb5a1e0
Add test framework in common library.
asfernandes Jul 18, 2022
2139d4a
Add tests for common/classes/Aligner.
asfernandes Jul 18, 2022
5e13cb6
Add tests for common/classes/Array.
asfernandes Jul 18, 2022
f18f5eb
Add methods to DoublyLinkedList.
asfernandes Jul 18, 2022
b4ba747
Add tests for common/classes/DoublyLinkedList.
asfernandes Jul 18, 2022
76dbad5
Add test framework in engine library.
asfernandes Jul 18, 2022
cf63ea5
Add tests for jrd/RecordNumber.
asfernandes Jul 18, 2022
ef361bc
Separate projects in groups in Firebird.sln.
asfernandes Jul 18, 2022
ecbbc9a
Put tests in Firebird.sln.
asfernandes Jul 18, 2022
3dda315
Remove old and unused things from the Windows build.
asfernandes Jul 18, 2022
cae5a21
Correction in GH Actions Windows workflow.
asfernandes Jul 18, 2022
bb16777
Update Linux builder Dockerfile - should update and push the image.
asfernandes Jul 18, 2022
78b95b3
Move tests directory to avoid problem with non-system shared libraries.
asfernandes Jul 20, 2022
637c924
Build and use static libc++ in MacOS.
asfernandes Jul 20, 2022
3028ec9
Cache MacOS libicu build in GitHub Action.
asfernandes Jul 21, 2022
f93852a
Revert "Move gds_proto.h to common."
asfernandes Jul 21, 2022
28058cf
Revert "Move gds.cpp to common."
asfernandes Jul 21, 2022
30ff90b
Reference gds.cpp in src/yvalve.
asfernandes Jul 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
111 changes: 87 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
run: |
CC=clang CXX=clang++ ./autogen.sh --enable-binreloc --prefix=/opt/firebird
make -j4
make tests -j4
make run_tests
make dist
tar xzvf gen/Firebird-[0-9]*.tar.gz
(cd Firebird-[0-9]*; sudo ./install.sh -silent)
Expand All @@ -82,54 +84,114 @@ jobs:
run: |
./autogen.sh --enable-binreloc-threads --with-builtin-tommath --with-builtin-tomcrypt --prefix=/opt/firebird
make -j4
make tests -j4
make run_tests
make dist
tar xzvf gen/Firebird-[0-9]*.tar.gz

- name: Prepare (MacOS)
- name: Prepare - Install tools (MacOS)
if: matrix.os == 'macOS-latest'
run: |
brew install automake libtool
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool
brew install automake libtool ninja

- name: Cache - libc++ install (MacOS)
id: cache-libcxx-install-macos
if: matrix.os == 'macOS-latest'
uses: actions/cache@v3
with:
key: ${{ runner.os }}-libcxx-install-13.0.1
path: |
extern/libcxx-macos-install

- name: Download libc++ sources (MacOS)
if: matrix.os == 'macOS-latest' && steps.cache-libcxx-install-macos.outputs.cache-hit != 'true'
run: |
mkdir extern/libcxx-macos
pushd extern/libcxx-macos
curl -OL https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/llvm-project-13.0.1.src.tar.xz
tar xJf llvm-project-13.0.1.src.tar.xz
popd

- name: Build libc++ (MacOS)
if: matrix.os == 'macOS-latest' && steps.cache-libcxx-install-macos.outputs.cache-hit != 'true'
run: |
LIBCXX_BUILD_PATH=`pwd`/extern/libcxx-macos-build
LIBCXX_INSTALL_PATH=`pwd`/extern/libcxx-macos-install
mkdir $LIBCXX_BUILD_PATH
pushd extern/libcxx-macos/llvm-project-13.0.1.src
export MACOSX_DEPLOYMENT_TARGET=10.9
cmake -G Ninja -S llvm -B $LIBCXX_BUILD_PATH \
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
-DCMAKE_INSTALL_PREFIX=$LIBCXX_INSTALL_PATH \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_ENABLE_SHARED=false \
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=true
ninja -C $LIBCXX_BUILD_PATH cxx cxxabi
ninja -C $LIBCXX_BUILD_PATH install-cxx install-cxxabi
popd

- name: Cache - libicu install (MacOS)
id: cache-libicu-install-macos
if: matrix.os == 'macOS-latest'
uses: actions/cache@v3
with:
key: ${{ runner.os }}-libicu-install-63.2
path: |
extern/libicu-macos-install

mkdir extern/icu-macos
pushd extern/icu-macos
- name: Download and patch libicu sources (MacOS)
if: matrix.os == 'macOS-latest' && steps.cache-libicu-install-macos.outputs.cache-hit != 'true'
run: |
mkdir extern/libicu-macos
pushd extern/libicu-macos
curl -OL https://github.com/unicode-org/icu/releases/download/release-63-2/icu4c-63_2-src.tgz
curl -OL https://github.com/unicode-org/icu/commit/24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
tar xzf icu4c-63_2-src.tgz
ICU_INSTALL_PATH=`pwd`/install
cd icu/source
patch -p3 < ../../24aeb9a5a5874f4ce5db912e30670ac3ae236971.patch
./runConfigureICU MacOSX --prefix=$ICU_INSTALL_PATH
popd

- name: Build libicu (MacOS)
if: matrix.os == 'macOS-latest' && steps.cache-libicu-install-macos.outputs.cache-hit != 'true'
run: |
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool

LIBICU_INSTALL_PATH=`pwd`/extern/libicu-macos-install
pushd extern/libicu-macos/icu/source
./runConfigureICU MacOSX --prefix=$LIBICU_INSTALL_PATH
make -j4
make install
install_name_tool -id @rpath/lib/libicuuc.dylib $ICU_INSTALL_PATH/lib/libicuuc.dylib
install_name_tool -id @rpath/lib/libicui18n.dylib $ICU_INSTALL_PATH/lib/libicui18n.dylib
install_name_tool -id @rpath/lib/libicudata.dylib $ICU_INSTALL_PATH/lib/libicudata.dylib
install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicuuc.63.dylib
install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib
install_name_tool -change libicuuc.63.dylib @loader_path/libicuuc.63.dylib $ICU_INSTALL_PATH/lib/libicui18n.63.dylib
install_name_tool -id @rpath/lib/libicuuc.dylib $LIBICU_INSTALL_PATH/lib/libicuuc.dylib
install_name_tool -id @rpath/lib/libicui18n.dylib $LIBICU_INSTALL_PATH/lib/libicui18n.dylib
install_name_tool -id @rpath/lib/libicudata.dylib $LIBICU_INSTALL_PATH/lib/libicudata.dylib
install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $LIBICU_INSTALL_PATH/lib/libicuuc.63.dylib
install_name_tool -change libicudata.63.dylib @loader_path/libicudata.63.dylib $LIBICU_INSTALL_PATH/lib/libicui18n.63.dylib
install_name_tool -change libicuuc.63.dylib @loader_path/libicuuc.63.dylib $LIBICU_INSTALL_PATH/lib/libicui18n.63.dylib
popd
mkdir -p gen/Release/firebird/lib
mkdir -p gen/Debug/firebird/lib
cp -R $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Release/firebird/lib/
cp -R $ICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Debug/firebird/lib/

- name: Build (MacOS)
if: matrix.os == 'macOS-latest'
run: |
export LIBTOOLIZE=glibtoolize
export LIBTOOL=glibtool

ICU_INSTALL_PATH=`pwd`/extern/icu-macos/install
LIBCXX_INSTALL_PATH=`pwd`/extern/libcxx-macos-install
LIBICU_INSTALL_PATH=`pwd`/extern/libicu-macos-install

mkdir -p gen/Release/firebird/lib
cp -R $LIBICU_INSTALL_PATH/lib/libicu{data,i18n,uc}.*dylib gen/Release/firebird/lib/

export C_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$C_INCLUDE_PATH"
export CPLUS_INCLUDE_PATH="$ICU_INSTALL_PATH/include:$CPLUS_INCLUDE_PATH"
export C_INCLUDE_PATH="$LIBICU_INSTALL_PATH/include:`xcrun --show-sdk-path`/usr/include"
export CPLUS_INCLUDE_PATH="$LIBCXX_INSTALL_PATH/include/c++/v1:$LIBICU_INSTALL_PATH/include:`xcrun --show-sdk-path`/usr/include"
export LIBRARY_PATH="$LIBCXX_INSTALL_PATH/lib:$LIBICU_INSTALL_PATH/lib:$LIBRARY_PATH"

LIBRARY_PATH="$ICU_INSTALL_PATH/lib:$LIBRARY_PATH" ./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt
./autogen.sh --with-builtin-tommath --with-builtin-tomcrypt
make -j4
make tests -j4
make run_tests

(cd gen; make -B -f make.platform.postfix ICU_LOC="$ICU_INSTALL_PATH/lib/")
(cd gen; make -B -f make.platform.postfix ICU_LOC="$LIBICU_INSTALL_PATH/lib/")
(cd gen; make -B -f Makefile.install)

# Rename directory to make sure the build is relocatable.
Expand Down Expand Up @@ -166,7 +228,8 @@ jobs:
if "%PLATFORM%" == "x86" set FB_OUTPUT_SUFFIX=win32
call "%VS_SCRIPT%" -arch=%FB_VS_ARCH%
cd builds\win32
run_all.bat JUSTBUILD
call run_all.bat JUSTBUILD
call run_tests.bat

- name: Build (Windows, Docker)
if: startsWith(matrix.os, 'windows-') && matrix.docker
Expand Down
2 changes: 2 additions & 0 deletions builds/docker/linux/i586-x86_64/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ sed -i 's/AC_CHECK_LIB(atomic, main)/AC_CHECK_LIB(:libatomic.a, main)/g' configu

./autogen.sh --build=$BUILD_ARCH --prefix=/opt/firebird --enable-binreloc --with-builtin-tomcrypt --with-termlib=:libncurses.a
make -j${CPUCOUNT}
make tests -j${CPUCOUNT}
make run_tests
make dist
2 changes: 2 additions & 0 deletions builds/docker/windows/scripts/build-x64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ cd /d C:\firebird-build\builds\win32
REM call run_all.bat
call run_all.bat JUSTBUILD

call run_tests.bat

xcopy /h /e /i /q C:\firebird-build\output_%FB_OUTPUT_SUFFIX%\* C:\firebird-out
2 changes: 2 additions & 0 deletions builds/docker/windows/scripts/build-x86.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ cd /d C:\firebird-build\builds\win32
REM call run_all.bat
call run_all.bat JUSTBUILD

call run_tests.bat

xcopy /h /e /i /q C:\firebird-build\output_%FB_OUTPUT_SUFFIX%\* C:\firebird-out
26 changes: 25 additions & 1 deletion builds/posix/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ $(COMMON_LIB): $(Common_Objects)
-$(RM) $@
$(STATICLIB_LINK) $@ $^

$(COMMON_TEST): $(Common_Test_Objects) $(COMMON_LIB)
$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ -L$(LIB) $(LINK_LIBS)

#___________________________________________________________________________
# gpre_boot
Expand All @@ -369,7 +371,7 @@ $(COMMON_LIB): $(Common_Objects)
boot: $(GPRE_BOOT)

$(GPRE_BOOT): $(GPRE_Boot_Objects) $(COMMON_LIB)
$(STATICEXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ -L$(LIB) $(LINK_LIBS)
$(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ -L$(LIB) $(LINK_LIBS)
-$(RM) $(GPRE_CURRENT)
(cd $(@D); $(LN) $(@F) $(notdir $(GPRE_CURRENT)))

Expand Down Expand Up @@ -404,6 +406,9 @@ engine: $(ENGINE_SONAME)
$(ENGINE_SONAME): $(Engine_Objects) $(SVC_Objects) $(COMMON_LIB)
$(LINK_ENGINE) -o $@ $^ $(LINK_ENGINE_LIBS) $(call LIB_LINK_DARWIN_INSTALL_NAME,plugins/$(EngineSoName))

$(ENGINE_TEST): $(Engine_Objects) $(Engine_Test_Objects) $(SVC_Objects) $(COMMON_LIB)
$(EXE_LINK) -o $@ $^ $(EXE_LINK_OPTIONS) $(LINK_ENGINE_LIBS)


#___________________________________________________________________________
# intl support
Expand Down Expand Up @@ -711,6 +716,25 @@ install install-embedded silent_install package packages dist:
$(MAKE) -f Makefile.install $@


#___________________________________________________________________________
# tests
#

.PHONY: tests tests_process run_tests run_tests_process

tests:
$(MAKE) TARGET=$(DefaultTarget) tests_process

tests_process: $(COMMON_TEST) $(ENGINE_TEST)

run_tests:
$(MAKE) TARGET=$(DefaultTarget) run_tests_process

run_tests_process: tests_process
$(COMMON_TEST) --log_level=all
$(ENGINE_TEST) --log_level=all


#___________________________________________________________________________
# various cleaning
#
Expand Down
5 changes: 4 additions & 1 deletion builds/posix/make.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ RE2_BUILD_FLG=@RE2_BUILD@
SYSTEM_BOOST_FLG=@SYSTEM_BOOST@

FB_BUILD=$(GEN_ROOT)/$(TARGET)/firebird

ifeq ($(IsCross), Y)
FIREBIRD=$(GEN_ROOT)/Native/firebird
else
Expand All @@ -71,6 +72,7 @@ LIB=$(FB_BUILD)/lib
BIN=$(FB_BUILD)/bin
PLUGINS=$(FB_BUILD)/plugins
RBIN=$(FIREBIRD)/bin
FB_TESTS_DIR=$(FB_BUILD)/tests

# This picks up the current directory and maps it to the equivalent module
# in the src and gen area.
Expand Down Expand Up @@ -198,7 +200,6 @@ EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) -static-libstdc++
endif

STATICLIB_LINK = $(AR) crus
STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) -static-libstdc++

LINK_LIBS = @LIBS@ $(DECLIB) $(RE2LIB) $(I128LIB)
SO_LINK_LIBS = @LIBS@ $(DECLIB) $(RE2LIB) $(I128LIB)
Expand Down Expand Up @@ -253,6 +254,7 @@ LIBFIREBIRD_BASENAME = $(LIB)/$(LibrarySoName)
EngineFileName=libEngine${OdsVersion}
EngineSoName=$(EngineFileName).${SHRLIB_EXT}
ENGINE_SONAME = $(PLUGINS)/$(EngineSoName)
ENGINE_TEST = $(FB_TESTS_DIR)/$(EngineFileName)_test$(EXEC_EXT)

# intl will load dynamically, and having the whole soname set with version
# confuses the dynamic load process. So we only have the .$(SHRLIB_EXT) file
Expand Down Expand Up @@ -386,6 +388,7 @@ LINK_PLUG_LIBS = -L$(LIB) $(SO_LINK_LIBS)
# Pay attention - we place common library into obj, not lib dir
# It's just a set of object files, prepared to be used by ld, not an output library
COMMON_LIB = $(OBJ)/common.a
COMMON_TEST = $(FB_TESTS_DIR)/common_test$(EXEC_EXT)

# From utilities
CREATE_DB = $(RBIN)/create_db$(EXEC_EXT)
Expand Down
4 changes: 4 additions & 0 deletions builds/posix/make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
# Please don't use compiler/platform specific flags here - nmcc 02-Nov-2002
WFLAGS =-I$(SRC_ROOT)/include/gen -I$(SRC_ROOT)/include $(CPPFLAGS) $(LTCSOURCE)

ifneq ($(SYSTEM_BOOST_FLG),Y)
WFLAGS += -I$(ROOT)/extern/boost
endif

ifeq ($(TOMMATH_BUILD_FLG),Y)
WFLAGS += -I$(TOMMATH_INC)
endif
Expand Down
11 changes: 10 additions & 1 deletion builds/posix/make.shared.variables
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ Common_Objects:= $(CO1) $(CO2) $(CO3) $(CO4)

AllObjects += $(Common_Objects)

# Common test files
COT1:= $(call dirObjects,common/tests)
COT2:= $(call dirObjects,common/classes/tests)
Common_Test_Objects:= $(COT1) $(COT2) $(call makeObjects,yvalve,gds.cpp)

AllObjects += $(Common_Test_Objects)


# gpre
GPRE_Common_Objects:= $(call dirObjects,gpre) $(call makeObjects,gpre/languages,@GPRE_LANGUAGE_MODULES@)
Expand Down Expand Up @@ -80,7 +87,9 @@ Engine_Objects:= $(call dirObjects,jrd) $(call dirObjects,dsql) $(call dirObject
$(call dirObjects,jrd/optimizer) $(call dirObjects,jrd/recsrc) $(call dirObjects,jrd/replication) $(call dirObjects,jrd/trace) \
$(call makeObjects,lock,lock.cpp)

AllObjects += $(Engine_Objects)
Engine_Test_Objects:= $(call dirObjects,jrd/tests)

AllObjects += $(Engine_Objects) $(Engine_Test_Objects)


# services
Expand Down
1 change: 1 addition & 0 deletions builds/win32/make_all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ if errorlevel 1 call :ERROR build failed - see make_all_%FB_TARGET_PLATFORM%.log
@mkdir %FB_OUTPUT_DIR%\plugins\udr 2>nul

@copy %FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\firebird\* %FB_OUTPUT_DIR% >nul
@del %FB_OUTPUT_DIR%\*_test.exe >nul
@copy %FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\firebird\intl\* %FB_OUTPUT_DIR%\intl >nul
@copy %FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\firebird\tzdata\* %FB_OUTPUT_DIR%\tzdata >nul
@copy %FB_ROOT_PATH%\temp\%FB_OBJ_DIR%\firebird\system32\* %FB_OUTPUT_DIR%\system32 >nul
Expand Down
17 changes: 5 additions & 12 deletions builds/win32/make_boot.bat
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ if "%ERRLEV%"=="1" goto :END
@call :msgs
if "%ERRLEV%"=="1" goto :END

@call :codes
if "%ERRLEV%"=="1" goto :END

::=======
@call create_msgs.bat msg
::=======
Expand Down Expand Up @@ -231,8 +228,8 @@ goto :EOF
:engine
@echo.
@echo Building engine (%FB_OBJ_DIR%)...
@call compile.bat builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log engine
@call compile.bat builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log ib_util
@call compile.bat builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log DLLs\engine
@call compile.bat builds\win32\%VS_VER%\Firebird engine_%FB_TARGET_PLATFORM%.log DLLs\ib_util
if errorlevel 1 call :boot2 engine
@goto :EOF

Expand All @@ -241,7 +238,7 @@ if errorlevel 1 call :boot2 engine
:gbak
@echo.
@echo Building gbak (%FB_OBJ_DIR%)...
@call compile.bat builds\win32\%VS_VER%\Firebird gbak_%FB_TARGET_PLATFORM%.log gbak
@call compile.bat builds\win32\%VS_VER%\Firebird gbak_%FB_TARGET_PLATFORM%.log EXEs\gbak
if errorlevel 1 call :boot2 gbak
@goto :EOF

Expand All @@ -250,7 +247,7 @@ if errorlevel 1 call :boot2 gbak
:gpre
@echo.
@echo Building gpre (%FB_OBJ_DIR%)...
@call compile.bat builds\win32\%VS_VER%\Firebird gpre_%FB_TARGET_PLATFORM%.log gpre
@call compile.bat builds\win32\%VS_VER%\Firebird gpre_%FB_TARGET_PLATFORM%.log EXEs\gpre
if errorlevel 1 call :boot2 gpre
@goto :EOF

Expand All @@ -259,7 +256,7 @@ if errorlevel 1 call :boot2 gpre
:isql
@echo.
@echo Building isql (%FB_OBJ_DIR%)...
@call compile.bat builds\win32\%VS_VER%\Firebird isql_%FB_TARGET_PLATFORM%.log isql
@call compile.bat builds\win32\%VS_VER%\Firebird isql_%FB_TARGET_PLATFORM%.log EXEs\isql
if errorlevel 1 call :boot2 isql
@goto :EOF

Expand Down Expand Up @@ -299,10 +296,6 @@ goto :EOF
@"%FB_BIN_DIR%\isql" -q %FB_GEN_DB_DIR%/dbs/security5.fdb -i %FB_ROOT_PATH%\src\dbs\security.sql
@copy %FB_GEN_DIR%\dbs\security5.fdb %FB_GEN_DIR%\dbs\security.fdb > nul

@echo Creating metadata.fdb...
@echo create database '%FB_GEN_DB_DIR%/dbs/metadata.fdb'; | "%FB_BIN_DIR%\isql" -q -sqldialect 1
@copy %FB_GEN_DIR%\dbs\metadata.fdb %FB_GEN_DIR%\dbs\yachts.lnk > nul

@call create_msgs.bat db

@goto :EOF
Expand Down
Loading