Skip to content

New GitHub Actions workflow. #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

fdcastel
Copy link
Member

@fdcastel fdcastel commented May 31, 2025

Initial work to solve #231. Based on @asfernandes work on Firebird project. 🚀

GitHub release can be seen here.

v1: Original PR

Changes

  • The release workflow is now triggered when a tag starting with v is pushed.
  • Replaced pguyot/arm-runner-action with native ubuntu-22.04-arm runners
  • Fixed build paths from Builds/Msvc2019 to Builds/MsVc2022.win
  • Unified artifact naming: firebird-odbc-{platform}-{arch}
  • Single workflow file instead of separate per-platform workflows

Advantages over previous pipeline

Native ARM64 Execution: No more Raspberry Pi emulation
Faster Builds: Native runners are much faster than emulated ones
Simplified Maintenance: Matrix strategy reduces code duplication
Better Reliability: No complex emulation dependencies
Consistent Environment: Same OS versions across architectures
Automatic Releases: GitHub releases created automatically with all artifacts

v2: New workflows:

1. Build Workflow (build.yml)

  • Trigger: Every push and pull request on any branch (including forks)
  • Purpose: Continuous Integration - validates that code compiles
  • Runs on: All repositories (official and forks)

2. Release Workflow (release.yml)

  • Trigger: Only when tags starting with v* are pushed (e.g., v1.0.0)
  • Purpose: Creates official releases with packaged binaries
  • Runs on: Only the official repository (FirebirdSQL/firebird-odbc-driver)

ToDo

  • Run tests before release?
  • Add Windows-ARM64 builds?
  • Automatic release notes
  • Fix Debug builds
    • Add new -debug.zip file with debug symbols (done in 6cb0812)
    • Use -with-debug-symbols suffix (like Firebird)
  • Refactor InnoSetup script
    • Remove MakePackage.bat and sed (done in e85c062)
    • Call iscc.exe direcly, using /F to override OutputBaseFilename (done in e85c062)
    • Replace InnoSetup with WIX?

RFC @irodushka @asfernandes @mrotteveel

- Fix Windows x86/x64 builds.
@mrotteveel
Copy link
Member

@fdcastel You can convert a PR to a draft, then it can't be accidentally merged (see right menu bar, "Convert to draft").

@fdcastel fdcastel marked this pull request as draft May 31, 2025 19:17
@mrotteveel
Copy link
Member

I have not looked at the jobs themselves in-depth, as I'm not that well-versed in C++ builds.

@fdcastel
Copy link
Member Author

I have not looked at the jobs themselves in-depth, as I'm not that well-versed in C++ builds.

Same here 🤣.

That said, I didn’t touch the build scripts, just the YAML workflow. So I doubt I broke anything there.

In a past life, I had quite a bit of experience with Inno Setup. I intend to help out on that front soon.

@irodushka
Copy link
Contributor

irodushka commented May 31, 2025 via email

@fdcastel fdcastel changed the title [WIP/Do not merge] New GitHub Actions workflow. New GitHub Actions workflow. May 31, 2025
@fdcastel
Copy link
Member Author

@irodushka Before I can make changes to Install\Win32\OdbcJdbcSetup.iss, I need to know the encoding it was saved with.

The file contains some Russian translations, so I want to ensure it's correctly converted to UTF-8 without corrupting the text.

In VSCode, when opened with the "Windows 1251" encoding, it displays as:

image

@fdcastel
Copy link
Member Author

fdcastel commented May 31, 2025

Can we remove these old Windows build environments?

Builds\MsSDK64.win
Builds\MsVc60.win
Builds\MsVc70.win
Builds\MsVc80.win
Builds\MsVc90.win

Actually, it seems like quite a few files in /Builds might no longer be needed.

@fdcastel
Copy link
Member Author

fdcastel commented Jun 1, 2025

Something seems off with the MSBuild project configuration.

That’s why .pdb files are being generated.

P.s.: The latest release build shows the same issue. Are the currently distributed binaries actually DEBUG builds? Or am I missing something?


Answering my own question: No. The binaries are actually RELEASE binaries, but they do include debug symbols in separate .pdb files.

According to this:

The /DEBUG option puts the debugging information from linked object and library files into a program database (PDB) file. (...)

The linker uses the base name of the program and the extension .pdb (...). To override this default, set the /PDB option and specify a different file name.

In other words:

  • The /DEBUG option here is what actually causes the .pdb files to be generated (not tied to whether the build is a DEBUG build); and
  • The /PDB option simply specifies the name of the .pdb file.

@mrotteveel
Copy link
Member

mrotteveel commented Jun 1, 2025

Something seems off with the MSBuild project configuration.

That’s why .pdb files are being generated.

This is caused by <GenerateDebugInformation>true</GenerateDebugInformation> in the definitions in OdbcFb.vcxproj for Release|Win32 and Release|x64

@irodushka
Copy link
Contributor

What's the point of excluding pdb files from the Release build?.. The package size economy?
You should understand that debug & release binaries are very different, and not just in terms of debug information. Pdb file may be extremely useful. Or you think that the Release builds never crash?))

If we want to reduce the installation packages sizes, it's better to store pdb as a separate artefact for optional download/installation.
But I am strongly against excluding pdb files from the MSBuild process, both Debug and Release.

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

What's the point of excluding pdb files from the Release build?

Sorry for the confusion, @irodushka. I reverted this in later commits.

If we want to reduce the installation packages sizes, it's better to store pdb as a separate artefact for optional download/installation.

That's exactly what I did 😉 -- I added new packages with the -debug suffix. Please see them here.

@irodushka
Copy link
Contributor

@irodushka Before I can make changes to Install\Win32\OdbcJdbcSetup.iss, I need to know the encoding it was saved with.

The file contains some Russian translations, so I want to ensure it's correctly converted to UTF-8 without corrupting the text.

In VSCode, when opened with the "Windows 1251" encoding, it displays as:

Yes, it's correct, win1251.
No problem to convert it to UTF8 if InnoSetup supports this properly.

@irodushka
Copy link
Contributor

What's the point of excluding pdb files from the Release build?

Sorry for the confusion, @irodushka. I reverted this in later commits.

If we want to reduce the installation packages sizes, it's better to store pdb as a separate artefact for optional download/installation.

That's exactly what I did 😉 -- I added new packages with the -debug suffix. Please see them here.

Do I understand right that *-debug packages contain Debug build artefacts? Debug dll binary and a corresponding pdb?
What I want to say - debug and release dlls are different, and it's not just about debug info. The Release dll contains compiler optimizations, it just different binary code. So, a pdb file from a Debug build cannot be used to debug a Release dll.

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

I haven't modified the build scripts. Only the packaging.

The output binaries are built exactly as they were before.

As far as I understand, the current scripts produce RELEASE binaries (with optimizations). Along with a PDB file to support auxiliary debugging in production.

The confusion originated from my incorrect assumption that seeing /DEBUG in the LINK.EXE command line arguments meant the build was a DEBUG build (i.e., without optimizations). It is not.

The only difference between the -debug and main .zip files are that the -debug package includes the PDB file (and is significantly larger).

@irodushka
Copy link
Contributor

Aaaa!... So the regular (wo suffix) windows package and the -debug package contain the same dll binary - the release one? And the only difference between the normal & debug packages is the pdb file inside?
Ok, I got it.
The confusing part is the -debug suffix, i.e. the naming issue) Let's use cmake style naming, it has a special build type "RelWithDebInfo" = release_with_debug_info.

@irodushka
Copy link
Contributor

Well... and where's my favorite VirusTotal action?..)
It's not just for fun. There are sporadic troubles with InnoSetup - Windows antivirus detects malware in Inno binaries from time to time. It's a real headache.

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

So the regular (wo suffix) windows package and the -debug package contain the same dll binary - the release one?

Exactly! 👍🏻

And the only difference between the normal & debug packages is the pdb file inside?

Exactly! 👍🏻

Let's use cmake style naming, it has a special build type "RelWithDebInfo" = release_with_debug_info.

Sorry. Not totally clear on what you mean 😅. But if you can show me a few examples, I’ll tailor it exactly how you want.

@irodushka
Copy link
Contributor

irodushka commented Jun 2, 2025 via email

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

There are sporadic troubles with InnoSetup...

InnoSetup is built with Delphi, which -- for reasons only antivirus developers seem to understand -- tends to attract these kinds of false positives like a magnet.

By the way, I'm also planning to replace InnoSetup with WIX, unless anyone has objections. WIX can generate MSI files, which are generally more suitable for enterprise environments.

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

I mean to replace the package suffix _debug with _relwithdebinfo or _release_with_debuginfo

I found the improvement a bit subtle, to be honest. 😄

I would lean toward following the approach used by the Firebird Project.

At first, -withDebugSymbols seemed a bit odd to me, but now I see it from a different perspective.

@irodushka
Copy link
Contributor

irodushka commented Jun 2, 2025 via email

@irodushka
Copy link
Contributor

I mean to replace the package suffix _debug with _relwithdebinfo or _release_with_debuginfo

I found the improvement a bit subtle, to be honest. 😄

I would lean toward following the approach [used by the Firebird Project]

Yes, it' fine for me.

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

@irodushka Are there any tests for this project? If so, could you briefly explain how you've been handling them? I had a look at the code, but honestly, I couldn't make much sense of it.

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

@irodushka Did you give the ARM64 build a shot? If yes, how did it go?

@irodushka
Copy link
Contributor

irodushka commented Jun 2, 2025 via email

@fdcastel
Copy link
Member Author

fdcastel commented Jun 2, 2025

For Ubuntu only. Yes, tried the ARM build on Raspberry, and it worked fine.

🎉 Fantastic news! I'll investigate.

Last time I looked, there were no Windows ARM runners available on github.

Look again: 😄👀
https://github.blog/changelog/2025-04-14-windows-arm64-hosted-runners-now-available-in-public-preview/

@irodushka
Copy link
Contributor

irodushka commented Jun 2, 2025 via email

@irodushka
Copy link
Contributor

irodushka commented Jun 3, 2025

@fdcastel

I would like to mention that it makes sense to retain the ability to do autobuilds for every commit into the master (not for releases only but for intermediate feature-branches merges).

Another interesting question - what happens when some of the builds in the strategy matrix fail? I mean - windows build is ok, linux ok, but ARM fails. Does this mean that the entire build failed? Or can we issue a warning that the build succeeded for some platforms and failed for the others?

@fdcastel
Copy link
Member Author

fdcastel commented Jun 3, 2025

I would like to mention that it makes sense to retain the ability to do autobuilds for every commit into the master (not for releases only but for intermediate feature-branches merges).

Sure! I was just talking about this with @asfernandes. Take a look at this new workflow proposal I suggested for another project.

Another interesting question - what happens when some of the builds in the strategy matrix fail? I mean - windows build is ok, linux ok, but ARM fails. Does this mean that the entire build failed?

Short answer: Yes.

The BUILD jobs are marked with fail-fast: false which means they WILL PROCEED in case some parts of matrix fail.

However, the RELEASE job requires all dependent jobs to complete successfully; otherwise, the packages will NOT be published.

Or can we issue a warning that the build succeeded for some platforms and failed for the others?

GitHub will let us know for sure.

@irodushka
Copy link
Contributor

However, the RELEASE job [requires] all dependent jobs to complete successfully; otherwise, the packages will NOT be published.

It's okay

- Adds build.yml (for builds after pushes/PR).
- Updates release.yml to run only on official repository.
- Updates README.md build status badges.
@fdcastel
Copy link
Member Author

fdcastel commented Jun 3, 2025

New commits:

  • Uses the -with-debug-symbols suffix. Unlike the main Firebird project, I adopted an all-lowercase naming convention for consistency.
  • New workflows:

1. Build Workflow (build.yml)

  • Trigger: Every push and pull request on any branch (including forks)
  • Purpose: Continuous Integration - validates that code compiles
  • Runs on: All repositories (official and forks)

2. Release Workflow (release.yml)

  • Trigger: Only when tags starting with v* are pushed (e.g., v1.0.0)
  • Purpose: Creates official releases with packaged binaries
  • Runs on: Only the official repository (FirebirdSQL/firebird-odbc-driver)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants