Skip to content

Commit 62e7ebb

Browse files
authored
Merge pull request #7251 from FirebirdSQL/work/windows-build-ang-gh
Windows build (installer, dev experience, speed, GH actions) and GH refactor
2 parents 7d7a810 + bffb43d commit 62e7ebb

Some content is hidden

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

63 files changed

+595
-624
lines changed

.github/workflows/main.yml

Lines changed: 311 additions & 275 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
temp/
22
/gen/
3-
output_Win32/
4-
output_x64/
3+
output_Win32_*/
4+
output_x64_*/
55
examples/prebuilt/
66
.vs/
77
m4/

builds/docker/windows/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN `
4444
refreshenv && `
4545
setx PATH "%PATH%;C:\Program Files\Git\usr\bin"
4646

47-
ENV SEVENZIP='"C:\Program Files\7-Zip"'
48-
ENV INNO6_SETUP_PATH='"C:\Program Files (x86)\Inno Setup 6"'
47+
ENV SEVENZIP='C:\Program Files\7-Zip'
48+
ENV INNO6_SETUP_PATH='C:\Program Files (x86)\Inno Setup 6'
4949

5050
COPY scripts\* C:\fbscripts\

builds/docker/windows/run.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@echo off
2-
docker run --rm -v %cd%\..\..\..:C:\firebird -v %cd%\..\..\..\output:C:\firebird-out asfernandes/firebird-builder:5 %1
2+
docker run --rm -v %cd%\..\..\..:C:\firebird asfernandes/firebird-builder:5 %1
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REM FIXME @echo off
1+
@echo off
22

33
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" -arch=amd64
44

@@ -8,9 +8,8 @@ set FB_OUTPUT_SUFFIX=x64
88
xcopy /h /e /i /q C:\firebird C:\firebird-build
99
cd /d C:\firebird-build\builds\win32
1010

11-
REM call run_all.bat
12-
call run_all.bat JUSTBUILD
11+
call run_all.bat
1312

1413
call run_tests.bat
1514

16-
xcopy /h /e /i /q C:\firebird-build\output_%FB_OUTPUT_SUFFIX%\* C:\firebird-out
15+
copy C:\firebird-build\builds\install_images\* C:\firebird\builds\install_images

builds/docker/windows/scripts/build-x86.bat

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ set FB_OUTPUT_SUFFIX=win32
88
xcopy /h /e /i /q C:\firebird C:\firebird-build
99
cd /d C:\firebird-build\builds\win32
1010

11-
REM call run_all.bat
12-
call run_all.bat JUSTBUILD
11+
call run_all.bat
1312

1413
call run_tests.bat
1514

16-
xcopy /h /e /i /q C:\firebird-build\output_%FB_OUTPUT_SUFFIX%\* C:\firebird-out
15+
copy C:\firebird-build\builds\install_images\* C:\firebird\builds\install_images

builds/install/arch-specific/win32/BuildExecutableInstall.bat

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ if "%FB2_SNAPSHOT%"=="1" (
6565
:: let's bail out now.
6666

6767
@echo o Checking for sed...
68-
(cmd /c "sed.exe --version 2>&1 | findstr version > nul ") || ( call :ERROR Could not locate sed && @goto :EOF )
68+
(cmd /c "sed.exe --version 2>&1 > nul ") || ( call :ERROR Could not locate sed && @goto :EOF )
6969

7070
@echo o Checking for unix2dos...
71-
(cmd /c "unix2dos.exe --version 2>&1 | findstr version > nul" ) || ( call :ERROR Could not locate unix2dos && @goto :EOF )
71+
(cmd /c "unix2dos.exe --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos && @goto :EOF )
7272

7373
@for /f "usebackq tokens=*" %%c in (`where /f touch 2^>nul`) do set TOUCH_COMMAND=%%c
7474
if defined TOUCH_COMMAND (
@@ -93,7 +93,7 @@ if %FBBUILD_ZIP_PACK% EQU 1 (
9393
if %FBBUILD_ISX_PACK% NEQ 1 goto :SKIP_INNO
9494

9595
if defined INNO6_SETUP_PATH (
96-
set ISCC_COMMAND=%INNO6_SETUP_PATH%\iscc.exe
96+
set ISCC_COMMAND="%INNO6_SETUP_PATH%\iscc.exe"
9797
)
9898
:: If the environment variable is not set let's search in PATH
9999
if not defined ISCC_COMMAND (
@@ -445,7 +445,7 @@ copy %FB_ROOT_PATH%\builds\install\misc\databases.conf %FB_OUTPUT_DIR%\databases
445445
:: that and they all have windows EOL
446446
::===============================================
447447
for /R %FB_OUTPUT_DIR% %%W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.pas *.e *.def *.rc *.md *.html ) do (
448-
unix2dos -q --safe %%W || exit /b 1
448+
unix2dos --safe %%W || exit /b 1
449449
)
450450

451451
::End of SET_CRLF
@@ -458,7 +458,7 @@ for /R %FB_OUTPUT_DIR% %%W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.p
458458
:: Forcefully disable delayed expansion because of exclamation marks in 7z switches
459459
setlocal DisableDelayedExpansion
460460

461-
set SKIP_FILES=-x!installation_readme.txt
461+
set SKIP_FILES=-x!*.log -x!*.exp -x!*_test.exe -x!installation_readme.txt
462462

463463
if "%FBBUILD_SHIP_PDB%" == "ship_pdb" (
464464
set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%-pdb%FBBUILD_FILENAME_SUFFIX%.zip
@@ -476,7 +476,7 @@ if exist %FBBUILD_ZIPFILE% (
476476
@del %FBBUILD_ZIPFILE%
477477
)
478478

479-
%SEVENZIP%\7z.exe a -r -tzip -mx9 %SKIP_FILES% %FBBUILD_ZIPFILE% %FB_OUTPUT_DIR%\*
479+
"%SEVENZIP%\7z.exe" a -r -tzip -mx9 %SKIP_FILES% %FBBUILD_ZIPFILE% %FB_OUTPUT_DIR%\*
480480

481481
endlocal
482482

@@ -652,7 +652,7 @@ for %%v in ( %1 %2 %3 %4 %5 %6 %7 %8 %9 ) do (
652652

653653
pushd ..\..\..\win32
654654
::This must be called from the directory it resides in.
655-
@call setenvvar.bat
655+
@call setenvvar.bat %*
656656
popd
657657
@if errorlevel 1 (goto :END)
658658

builds/install/arch-specific/win32/FirebirdInstall.iss

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@
117117
;We speed up compilation (and hence testing) by not compressing contents.
118118
#undef compression
119119

120-
;Default to x64 for testing
120+
;Default to x64_release for testing
121121
#define PlatformTarget "x64"
122+
#define ConfigurationTarget "release"
122123
#endif
123124
;-------#ifdef iss_debug
124125

@@ -216,6 +217,15 @@
216217
#endif
217218
#endif
218219

220+
;---- If we haven't already set ConfigurationTarget then pick it up from the environment.
221+
#ifndef ConfigurationTarget
222+
#define ConfigurationTarget GetEnv("FBBUILD_BUILDTYPE")
223+
#endif
224+
#if ConfigurationTarget == ""
225+
;Assume release
226+
#define ConfigurationTarget "release"
227+
#endif
228+
219229
#if FB_BUILD_TYPE == "T"
220230
;If we are still under development we can ignore some missing files.
221231
#define SkipFileIfDevStatus " skipifsourcedoesntexist "
@@ -224,7 +234,7 @@
224234
#endif
225235

226236
;This location is relative to SourceDir (declared below)
227-
#define FilesDir="output_" + PlatformTarget
237+
#define FilesDir="output_" + PlatformTarget + "_" + ConfigurationTarget
228238
#if PlatformTarget == "x64"
229239
#define WOW64Dir="output_win32"
230240
#endif
@@ -397,7 +407,7 @@ Filename: {app}\instreg.exe; Parameters: "install "; StatusMsg: {cm:instreg}; Mi
397407
Filename: {app}\instclient.exe; Parameters: "install fbclient"; StatusMsg: {cm:instclientCopyFbClient}; MinVersion: {#MinVer}; Components: ClientComponent; Flags: runminimized; Check: CopyFBClientLib;
398408
Filename: {app}\instclient.exe; Parameters: "install gds32"; StatusMsg: {cm:instclientGenGds32}; MinVersion: {#MinVer}; Components: ClientComponent; Flags: runminimized; Check: CopyGds32
399409
#if PlatformTarget == "x64"
400-
Filename: {app}\WOW64\instclient.exe; Parameters: "install fbclient"; StatusMsg: {cm:instclientCopyFbClient}; MinVersion: {#MinVer}; Components: ClientComponent; Flags: runminimized 32bit; Check: CopyFBClientLib;
410+
Filename: {app}\WOW64\instclient.exe; Parameters: "install fbclient"; StatusMsg: {cm:instclientCopyFbClient}; MinVersion: {#MinVer}; Components: ClientComponent; Flags: runminimized 32bit; Check: CopyFBClientLib
401411
Filename: {app}\WOW64\instclient.exe; Parameters: "install gds32"; StatusMsg: {cm:instclientGenGds32}; MinVersion: {#MinVer}; Components: ClientComponent; Flags: runminimized 32bit; Check: CopyGds32
402412
#endif
403413

@@ -500,10 +510,10 @@ Source: {#FilesDir}\icuin??.dll; DestDir: {app}; Components: ClientComponent; Fl
500510
Source: {#FilesDir}\icudt??.dll; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion
501511
Source: {#FilesDir}\icudt*.dat; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion
502512
#if PlatformTarget == "x64"
503-
Source: {#WOW64Dir}\icuuc??.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion
504-
Source: {#WOW64Dir}\icuin??.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion
505-
Source: {#WOW64Dir}\icudt??.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion
506-
Source: {#WOW64Dir}\icudt*.dat; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion
513+
Source: {#WOW64Dir}\icuuc??.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion {#SkipFileIfDevStatus}
514+
Source: {#WOW64Dir}\icuin??.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion {#SkipFileIfDevStatus}
515+
Source: {#WOW64Dir}\icudt??.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion {#SkipFileIfDevStatus}
516+
Source: {#WOW64Dir}\icudt*.dat; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion {#SkipFileIfDevStatus}
507517
#endif
508518

509519
#if PlatformTarget =="Win32"
@@ -512,7 +522,7 @@ Source: {#FilesDir}\fbrmclib.dll; DestDir: {app}; Components: ServerComponent; F
512522

513523
Source: {#FilesDir}\zlib1.dll; DestDir: {app}; Components: ClientComponent; Flags: sharedfile ignoreversion
514524
#if PlatformTarget == "x64"
515-
Source: {#WOW64Dir}\zlib1.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion
525+
Source: {#WOW64Dir}\zlib1.dll; DestDir: {app}\WOW64; Components: ClientComponent; Flags: sharedfile ignoreversion {#SkipFileIfDevStatus}
516526
#endif
517527

518528
;Rules for installation of MS runtimes are simplified with MSVC10
@@ -549,7 +559,7 @@ Source: {#FilesDir}\doc\sql.extensions\*.*; DestDir: {app}\doc\sql.extensions; C
549559
Source: {#FilesDir}\include\*.*; DestDir: {app}\include; Components: DevAdminComponent; Flags: ignoreversion recursesubdirs createallsubdirs;
550560
Source: {#FilesDir}\intl\fbintl.dll; DestDir: {app}\intl; Components: ServerComponent; Flags: sharedfile ignoreversion;
551561
Source: {#FilesDir}\intl\fbintl.conf; DestDir: {app}\intl; Components: ServerComponent; Flags: onlyifdoesntexist
552-
Source: {#FilesDir}\lib\*.*; DestDir: {app}\lib; Components: DevAdminComponent; Flags: ignoreversion;
562+
Source: {#FilesDir}\lib\*.lib; DestDir: {app}\lib; Components: DevAdminComponent; Flags: ignoreversion;
553563
#if PlatformTarget == "x64"
554564
Source: {#WOW64Dir}\lib\*.lib; DestDir: {app}\WOW64\lib; Components: DevAdminComponent; Flags: ignoreversion {#SkipFileIfDevStatus}
555565
#endif
@@ -566,7 +576,7 @@ Source: {#FilesDir}\plugins\chacha.dll; DestDir: {app}\plugins; Components: Clie
566576
Source: {#FilesDir}\plugins\*.conf; DestDir: {app}\plugins; Components: ServerComponent; Flags: ignoreversion;
567577
Source: {#FilesDir}\plugins\udr\*.*; DestDir: {app}\plugins\udr; Components: ServerComponent; Flags: ignoreversion;
568578
#if PlatformTarget == "x64"
569-
Source: {#WOW64Dir}\plugins\chacha*.dll; DestDir: {app}\WOW64\plugins; Components: ClientComponent; Flags: ignoreversion;
579+
Source: {#WOW64Dir}\plugins\chacha*.dll; DestDir: {app}\WOW64\plugins; Components: ClientComponent; Flags: ignoreversion {#SkipFileIfDevStatus};
570580
#endif
571581

572582
Source: {#FilesDir}\misc\*.*; DestDir: {app}\misc; Components: ServerComponent; Flags: ignoreversion createallsubdirs recursesubdirs ;
@@ -588,7 +598,7 @@ Source: {#FilesDir}\gfix.pdb; DestDir: {app}; Components: DevAdminComponent;
588598
Source: {#FilesDir}\isql.pdb; DestDir: {app}; Components: ClientComponent;
589599
Source: {#FilesDir}\plugins\*.pdb; DestDir: {app}\plugins; Components: ServerComponent;
590600
#if PlatformTarget == "x64"
591-
Source: {#WOW64Dir}\fbclient.pdb; DestDir: {app}\WOW64; Components: ClientComponent;
601+
Source: {#WOW64Dir}\fbclient.pdb; DestDir: {app}\WOW64; Components: ClientComponent; Flags: {#SkipFileIfDevStatus};
592602
#endif
593603
#endif
594604

builds/win32/clean_all.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22

3-
@call setenvvar.bat
3+
@call setenvvar.bat %*
44
@if errorlevel 1 (goto :END)
55

66
set FB_CLEAN_SHARED=

builds/win32/create_msgs.bat

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
@echo off
22

3-
@call setenvvar.bat
3+
@call setenvvar.bat %*
44
@if errorlevel 1 (goto :END)
5-
@if not defined FB_BIN_DIR (@call set_build_target.bat %*)
65

76
@echo Building build_msg (%FB_OBJ_DIR%)...
87
@call compile.bat builds\win32\%VS_VER%\FirebirdBoot build_msg_%FB_TARGET_PLATFORM%.log build_msg
98
@if errorlevel 1 (goto :END)
109

1110
@echo Building message file...
12-
@%FB_BIN_DIR%\build_msg -f %FB_GEN_DB_DIR%\firebird.msg -c %FB_OUTPUT_DIR%\include\firebird\impl\iberror_c.h
11+
@%FB_BOOT_BIN_DIR%\build_msg -f %FB_GEN_DB_DIR%\firebird.msg -c %FB_OUTPUT_DIR%\include\firebird\impl\iberror_c.h
1312
@copy %FB_GEN_DIR%\firebird.msg %FB_BIN_DIR% > nul
1413

1514
:END

0 commit comments

Comments
 (0)