Skip to content

chore: embed SpannerLib in ADO.NET driver#660

Merged
olavloite merged 2 commits intomainfrom
embed-spanner-lib
Jan 27, 2026
Merged

chore: embed SpannerLib in ADO.NET driver#660
olavloite merged 2 commits intomainfrom
embed-spanner-lib

Conversation

@olavloite
Copy link
Collaborator

Embed the relevant code from SpannerLib in the ADO.NET driver to remove the need to create nuget packages for SpannerLib. This change also includes scripts for copying the relevant code, and for building the required binaries for the driver.

@gemini-code-assist
Copy link

Summary of Changes

Hello @olavloite, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the Google Cloud Spanner ADO.NET driver's dependency model by embedding the SpannerLib source code and its native gRPC server binaries directly within the driver project. This change aims to streamline the build and distribution process, reduce external NuGet package dependencies, and provide a more self-contained solution. It involves adding the SpannerLib source, introducing scripts to manage its lifecycle (copying source, building binaries), and updating the project configuration to include these embedded components and their native runtime assets.

Highlights

  • SpannerLib Embedding: The core SpannerLib functionality is now embedded directly into the ADO.NET driver, eliminating external NuGet package dependencies for SpannerLib.
  • Dependency Simplification: Removed Alpha.Google.Cloud.SpannerLib and its related GRPC/Native implementation package references from the .csproj file.
  • New Source Files: Introduced numerous C# files (AbstractLibObject.cs, Connection.cs, ISpannerLib.cs, Pool.cs, Rows.cs, SpannerException.cs, GrpcBidiConnection.cs, GrpcLibSpanner.cs, StreamingRows.cs, Server.cs, SpannerlibGrpc.cs) that constitute the embedded SpannerLib.
  • Build and Copy Scripts: Added shell scripts (build-binaries.sh, copy-spannerlib-source.sh, spanner-lib-version.sh) to automate the process of fetching SpannerLib source, building native gRPC server binaries, and copying them into the project structure.
  • Runtime Inclusion: The .csproj file now explicitly includes native runtime binaries for various platforms (Linux x64/arm64, OSX arm64, Windows x64) directly within the NuGet package.
  • Codebase Refactoring: The SpannerPool.cs file was updated to remove references to the now-removed native SpannerLib implementation, exclusively utilizing the embedded gRPC implementation.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ado-net-tests.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request embeds the SpannerLib into the ADO.NET driver, removing the need for external NuGet packages. The changes involve adding the SpannerLib source code, updating project references, and including scripts for copying source and building native binaries. The overall approach aligns with the goal of self-containment. However, there are several areas related to asynchronous programming patterns and exception handling that require attention to prevent potential deadlocks and ensure consistent error propagation.

@olavloite olavloite force-pushed the embed-spanner-lib branch 4 times, most recently from a567053 to afecb8e Compare January 22, 2026 16:40
@olavloite olavloite force-pushed the embed-spanner-lib branch 2 times, most recently from 2bd345c to f543536 Compare January 23, 2026 08:51
Embed the relevant code from SpannerLib in the ADO.NET driver to remove the
need to create nuget packages for SpannerLib. This change also includes
scripts for copying the relevant code, and for building the required binaries
for the driver.
@olavloite olavloite marked this pull request as ready for review January 23, 2026 08:54
@olavloite olavloite requested a review from bhatt4982 January 23, 2026 08:55
Copy link
Collaborator

@bhatt4982 bhatt4982 left a comment

Choose a reason for hiding this comment

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

LGTM...

@olavloite olavloite merged commit deb5fd1 into main Jan 27, 2026
17 checks passed
@olavloite olavloite deleted the embed-spanner-lib branch January 27, 2026 12:23
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.

2 participants