Skip to content

fix(csharp): fall back to the standard driver entrypoint - #4815

Merged
CurtHagenlocher merged 3 commits into
apache:mainfrom
efegokdemir:fix/4630-csharp-driver-fallback
Oct 2, 2026
Merged

CurtHagenlocher merged 3 commits into
apache:mainfrom
efegokdemir:fix/4630-csharp-driver-fallback

Conversation

@efegokdemir

@efegokdemir efegokdemir commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

When a native driver does not export the filename-derived entrypoint, the C# driver manager now retries the standard AdbcDriverInit symbol, matching the behavior of the other driver managers. Explicit caller-provided entrypoints remain authoritative.

The AOT fixture regression renames a library that exports only AdbcDriverInit and loads it through AdbcDriverManager, covering the fallback path. On Windows, the test leaves its copied fixture in the disposable CI workspace because DriverManager intentionally keeps native drivers loaded for the process lifetime and Windows cannot delete a loaded DLL.

Fixes #4630

Testing

  • git diff --check — passed
  • dotnet test csharp/test/Apache.Arrow.Adbc.Testing.csproj --no-restore --filter FullyQualifiedName~TomlConnectionProfileTests --framework net8.0 — not run locally: dotnet is not installed in the current environment
  • NativeAOT fixture test — passed in CI on Windows, Ubuntu, and macOS after the Windows cleanup fix
  • All current PR checks passed: C# platform builds, NativeAOT interop, check PR, and pre-commit

The AOT fixture test is skipped unless ADBC_TEST_AOT_FIXTURE_PATH points to a published fixture, as in the repository CI workflow.

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>

@CurtHagenlocher CurtHagenlocher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Manifest-based loading still omits the fallback, and the regression test fails rather than skips without its fixture.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds fallback loading through the standard AdbcDriverInit symbol when a filename-derived entrypoint is unavailable.

Changes:

  • Adds native entrypoint fallback support.
  • Preserves explicit entrypoint behavior.
  • Adds a NativeAOT regression test.
File Description
CAdbcDriverImporter.cs Implements fallback symbol lookup.
AdbcDriverManager.cs Uses fallback for directly loaded native drivers.
AotFixtureTests.cs Tests standard-entrypoint fallback.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread csharp/src/Apache.Arrow.Adbc/DriverManager/AdbcDriverManager.cs
Comment thread csharp/test/AotInterop/Apache.Arrow.Adbc.TestFixture.Tests/AotFixtureTests.cs Outdated
@CurtHagenlocher

Copy link
Copy Markdown
Contributor

Hmm... I should have waited for the Copilot review apparently ;). Both of the points raised look valid to me.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The fallback behavior is correctly scoped and covered by cross-platform regression tests.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@CurtHagenlocher
CurtHagenlocher merged commit 3df4635 into apache:main Oct 2, 2026
9 checks passed
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.

csharp: Fall back to AdbcDriverInit when the derived entrypoint is absent

3 participants