Skip to content

fix(go/adbc/pkg): add PowerShell option to run when executing in a Windows-based ADO pipeline#3124

Merged
lidavidm merged 3 commits into
apache:mainfrom
davidhcoe:dev/github-pipeline-issue
Jul 10, 2025
Merged

fix(go/adbc/pkg): add PowerShell option to run when executing in a Windows-based ADO pipeline#3124
lidavidm merged 3 commits into
apache:mainfrom
davidhcoe:dev/github-pipeline-issue

Conversation

@davidhcoe

Copy link
Copy Markdown
Contributor

When running from the PowerShell script as part of an ADO pipeline, the line

GIT_VERSION=$(shell git tag ...

was generating the error:

EXEC : error : malformed object name '--sort=-v:refname' [C:\__w\1\s\arrow-adbc\csharp\src\Drivers\Interop\FlightSql\Apache.Arrow.Adbc.Drivers.Interop.FlightSql.csproj]

This change swaps some of the commands but also has a separate PowerShell command for the Windows OS instead of the shell command.

@davidhcoe davidhcoe requested a review from zeroshade as a code owner July 9, 2025 20:57
@github-actions github-actions Bot added this to the ADBC Libraries 20 milestone Jul 9, 2025
@davidhcoe

Copy link
Copy Markdown
Contributor Author

@zeroshade - we verified this against the ADO pipeline. Can you verify it doesn't mess up anything with the versioning that you did for the Go drivers?

Comment thread go/adbc/pkg/Makefile
RM=del
GIT_VERSION=$(shell powershell -Command "git tag --sort=-v:refname --points-at $(git rev-list --tags --max-count=1) | Select-Object -First 1")
else
SUFFIX=dylib

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.

Doesn't this omit macOS? Maybe there should be a separate ifeq windows [powershell] else [git]?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch. fixed.

@zeroshade zeroshade left a comment

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.

@davidhcoe as long as that powershell command returns the same "go/adbc/v#.#.#" string that we get from on Linux/unix then it shouldn't cause any issues with the version embedding.

I'm not familiar with the ?= syntax in makefiles, but I assume it's essentially that it assigns iff it's currently empty/unset, right? If so, all should be good.

@davidhcoe

Copy link
Copy Markdown
Contributor Author

I need to run 1 more pipeline test to verify again after my recent push.

@davidhcoe

Copy link
Copy Markdown
Contributor Author

ok, all set. The PowerShell output looks like:

PS C:\[...]\pkg> make libadbc_driver_snowflake.dll
go build -buildvcs=true -tags driverlib -o libadbc_driver_snowflake.dll -buildmode=c-shared -ldflags "-s -w -X github.com/apache/arrow-adbc/go/adbc/driver/internal/driverbase.infoDriverVersion=v1.7.0" ./snowflake

@zeroshade

Copy link
Copy Markdown
Member

Looks good!

@lidavidm lidavidm merged commit 50addb4 into apache:main Jul 10, 2025
42 checks passed
@davidhcoe davidhcoe deleted the dev/github-pipeline-issue branch October 24, 2025 10:14
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