Skip to content

Conversation

@davidhcoe
Copy link
Contributor

We have pre-production workstreams with the Go drivers in them, but when we need to get the driver version, it always comes back as (unknown or development build) which makes debugging issues that much more difficult. Dependencies used by the ADBC stack (like gosnowflake and arrow) have a static version that can be used to update the metadata. This PR adds support for a static version number that can be accessed via the metadata call.


package adbc

const DriverVersion = "1.7.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zeroshade - I am assuming this is the most controversial part of this PR. We track the PREVIOUS_VERSION_NATIVE and increment that when the releases happen, but we don't have anything to indicate the current version. Here I am following the pattern established by the dependency DLLs, but if you have thoughts on better ways to do this, I am all ears.

Copy link
Member

Choose a reason for hiding this comment

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

At least from my point of view, this is OK, but I'd rather have it be per-driver rather than in the nominally core library. (We'd also need to update the version bump script to account for this.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm open to whatever. I based this off of https://github.com/apache/arrow-adbc/releases where it appears all of the Go drivers have the same version (just like C#, where all of the C# drivers end up with the same build version).

@zeroshade
Copy link
Member

What's the workflow you're using to build the binary in the pre -production stream? Go should be making the version available via runtime/debug.BuildInfo

@davidhcoe
Copy link
Contributor Author

What's the workflow you're using to build the binary in the pre -production stream? Go should be making the version available via runtime/debug.BuildInfo

We pull the repo and build a NuGet package which internally runs make libadbc_driver_snowflake.dll command to create the DLL.

When I ran it in testing, the value of the build info came back as something like 0.0.0-20250523[somenumbers]+dirty. But when we are asking for the version information, we do it via the GetInfo call for the driver version and that is when the unknown value is shown.

@zeroshade
Copy link
Member

Okay, so we probably aren't using the BuildInfo properly which is why it's getting the "unknown" value. That's easy enough to fix.

As for the 0.0.0-20250523[somenumbers]+dirty that's gonna identify the commit sha. You might need to explicitly pull down the tags when you pull the repo to get the full version instead of just the Sha. I'll play with it a bit tomorrow and see if I can figure it out. Using the build info will definitely be the better route if we can get it working the way we want, that way we don't need to add stuff to the version upgrade script etc.

@davidhcoe
Copy link
Contributor Author

Okay, so we probably aren't using the BuildInfo properly which is why it's getting the "unknown" value. That's easy enough to fix.

As for the 0.0.0-20250523[somenumbers]+dirty that's gonna identify the commit sha. You might need to explicitly pull down the tags when you pull the repo to get the full version instead of just the Sha. I'll play with it a bit tomorrow and see if I can figure it out. Using the build info will definitely be the better route if we can get it working the way we want, that way we don't need to add stuff to the version upgrade script etc.

Did you get a chance to trial this @zeroshade ?

@zeroshade
Copy link
Member

Sorry for the delay here, i played with this a bit.

It looks like the internal build info doesn't seem to pick up the tags for the non-root module tag. If I add a local tag of v1.6.0 then the build info picks up properly and gives a version of v1.6.0+dirty. Otherwise you get a pseudo-version of v0.0.0-<current commit date>-<commit sha>+dirty.

In both cases, it should be easy enough to update the local variable to use debug.BuildInfo to get the version, so the question is going to be a matter of updating the build scripts to get it to pick up the version. (Looks like it'll only embed the subdirectory version when using go install or go get, neither of which works for building a shared object library.

Updating the build script to set the tag before building is still probably better than needing an internal var to update the version etc. Do you want me to update this PR? Or poke it yourself?

@davidhcoe
Copy link
Contributor Author

I think this is more your area of expertise than mine if you have some time :)

lidavidm added a commit that referenced this pull request Jun 19, 2025
expanding the solution from #2889 We can make sure that we inject the
proper version string into the internal/driverbase handling. This should
populate the GetInfo correctly with the driver version via vcs
information.

---------

Co-authored-by: David Li <[email protected]>
@lidavidm
Copy link
Member

I think we can close this now?

@zeroshade
Copy link
Member

I'm gonna close it, if the updates is insufficient, we can file a new issue/PR

@zeroshade zeroshade closed this Jun 20, 2025
@davidhcoe davidhcoe deleted the dev/snowflake-driverversion branch October 24, 2025 10:15
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