Skip to content

GH-49537: [C++][FlightRPC] Windows CI to Support ODBC DLL & MSI Signing#49603

Open
alinaliBQ wants to merge 3 commits intoapache:mainfrom
Bit-Quill:gh-49537-ci-sign-win-odbc
Open

GH-49537: [C++][FlightRPC] Windows CI to Support ODBC DLL & MSI Signing#49603
alinaliBQ wants to merge 3 commits intoapache:mainfrom
Bit-Quill:gh-49537-ci-sign-win-odbc

Conversation

@alinaliBQ
Copy link
Copy Markdown
Collaborator

@alinaliBQ alinaliBQ commented Mar 26, 2026

Rationale for this change

GH-49537

What changes are included in this PR?

  • Implement Windows CIs to:
    1. CI A - odbc-msvc-upload-dll Upload unsigned DLL
    2. CI B - odbc-msvc-upload-msi Download signed DLL and upload unsigned MSI
  • Remove odbc-release CI that is replaced by the new CIs.
  • Use composite action to reuse code for building ODBC Windows.
  • The release manager can run CI A first, then download the unsigned DLL and upload signed DLL. Example Command to trigger CI A:
gh workflow run cpp_extra.yml --ref apache-arrow-test-24.0.0-rc0 -f odbc_upload=dll
  • Run CI B to upload unsigned MSI. Then sign the MSI locally, and upload signed MSI to GitHub release. Example Command to trigger CI B:
gh workflow run cpp_extra.yml --ref apache-arrow-test-24.0.0-rc0 -f odbc_upload=msi

Example of 07-flightsqlodbc-upload.sh script (not tested):
We need to either 1) implement a way to get RUN_ID and then call gh run watch,
or 2) enter each command manually and wait for the CI to finish.

export tag=apache-arrow-24.0.0-rc0 
# trigger CI A
gh workflow run cpp_extra.yml --ref $tag -f odbc_upload=dll

# download unsigned DLL
gh release download $tag --pattern arrow_flight_sql_odbc_unsigned.dll

# sign ODBC DLL and upload to GitHub release
jsign arrow_flight_sql_odbc_unsigned.dll ...
mv arrow_flight_sql_odbc_unsigned.dll arrow_flight_sql_odbc.dll
gh release upload $tag --clobber arrow_flight_sql_odbc.dll

# trigger CI B
gh workflow run cpp_extra.yml --ref $tag -f odbc_upload=msi

# download unsigned MSI
gh release download $tag --pattern Apache-Arrow-Flight-SQL-ODBC-*-win64.msi

# sign ODBC MSI and upload to GitHub release
jsign Apache-Arrow-Flight-SQL-ODBC-*-win64.msi ...
gh release upload $tag --clobber Apache-Arrow-Flight-SQL-ODBC-*-win64.msi

# remove ODBC DLLs from GitHub release
gh release delete-asset $tag arrow_flight_sql_odbc_unsigned.dll --yes
gh release delete-asset $tag arrow_flight_sql_odbc.dll --yes

Are these changes tested?

  • The uploading and signing process is tested in my repo
  • Workflows are verified in CI

Are there any user-facing changes?

N/A

* Add draft code for CI A and CI B

Attempt workflow dispatch

Only ODBC Windows original workflow should run.
Later need to add `github.event_name != 'workflow_dispatch' ||` to all existing workflows after uncomment

Use `GITHUB_REF_NAME` directly via push

Add `workflow_dispatch` definitions

Add `ODBC Windows Upload DLL`

Use common ODBC Windows environment variables

Use ODBC as composite action

Create cpp_odbc.yml

Initial draft

temp disable test step

Temp disable non-ODBC Windows workflows

* Clean Up Code

* Remove comments

* Fix Installer path for MSI
Comment on lines +629 to +635
- name: Upload the artifacts to GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${GITHUB_REF_NAME} \
--clobber \
arrow_flight_sql_odbc_unsigned.dll
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since both DLL and MSI need to be signed and unsigned DLL is harder to catch, uploading as arrow_flight_sql_odbc_unsigned.dll to make it clear on GitHub release if the DLL is unsigned.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Mar 26, 2026
@alinaliBQ
Copy link
Copy Markdown
Collaborator Author

@amoeba PR is ready for review. We have an issue for flight-sql-tests ODBC Windows failure: #49465

@alinaliBQ alinaliBQ marked this pull request as ready for review March 27, 2026 17:35
@alinaliBQ
Copy link
Copy Markdown
Collaborator Author

I did an empty commit (a522393) and got this error:

Error: D:\a\arrow\arrow\./.github/actions/odbc-windows\action.yml (Line: 71, Col: 12): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.GITHUB_TOKEN
Error: GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. D:\a\arrow\arrow\./.github/actions/odbc-windows\action.yml (Line: 71, Col: 12): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.GITHUB_TOKEN
   at GitHub.DistributedTask.ObjectTemplating.TemplateValidationErrors.Check()
   at GitHub.Runner.Worker.ActionManifestManagerLegacy.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
   at GitHub.Runner.Worker.ActionManifestManagerLegacy.Load(IExecutionContext executionContext, String manifestFile)
Error: Failed to load D:\a\arrow\arrow\./.github/actions/odbc-windows\action.yml

The same implementation worked yesterday (see https://github.com/apache/arrow/actions/runs/23622018872/job/68803175375). Seems that GitHub might have updated runner, I will look into this.

@alinaliBQ
Copy link
Copy Markdown
Collaborator Author

Error: Failed to load D:\a\arrow\arrow./.github/actions/odbc-windows\action.yml

This issue should be resolved now by commit 95bc75b

@alinaliBQ
Copy link
Copy Markdown
Collaborator Author

@kou @raulcd This PR is ready for review. Please have a look if you have a chance, thank you

gh release download $env:GITHUB_REF_NAME `
--pattern arrow_flight_sql_odbc.dll `
--clobber
- name: Build ODBC Windows
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you have any luck figuring out how to extract just the minimum set of files cpack needs to build the MSI? I see this job is rebuilding everything from scratch so we're building the ODBC driver twice. If it's not possible that's fine, and if we want to work on removing the extra full-build in a follow-up that's fine.

remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}

odbc-release:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we automatically build and upload the unsigned DLL when we tag a release? I think it could speed things up for the release managers. It looks like the way you have it here, the release manager has to manually run odbc-msvc-upload-dll. Is that just because of the renaming step?

uses: ./.github/actions/odbc-windows
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Name Unsigned ODBC DLL
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Name Unsigned ODBC DLL
- name: Rename Unsigned ODBC DLL


odbc-msvc-upload-msi:
needs: check-labels
name: ODBC Windows Upload Unsigned MSI
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: ODBC Windows Upload Unsigned MSI
name: ODBC Windows Build & Upload Unsigned MSI

0 0 * * *
workflow_dispatch:
inputs:
odbc_upload:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion, this seems clearer as to the intent:

Suggested change
odbc_upload:
odbc_release_step:

workflow_dispatch:
inputs:
odbc_upload:
description: 'ODBC Component Upload'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: 'ODBC Component Upload'
description: 'Which ODBC release step to run'

needs: check-labels
name: ODBC Windows Upload Unsigned DLL
runs-on: windows-2022
if: inputs.odbc_upload == 'dll'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: inputs.odbc_upload == 'dll'
if: inputs.odbc_release_step == 'dll'

needs: check-labels
name: ODBC Windows Upload Unsigned MSI
runs-on: windows-2022
if: inputs.odbc_upload == 'msi'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: inputs.odbc_upload == 'msi'
if: inputs.odbc_release_step == 'msi'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting committer review Awaiting committer review CI: Extra: C++ Run extra C++ CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants