From 60282a53935ca0c950d231ef5c098dc321e47cab Mon Sep 17 00:00:00 2001 From: "Bruce Irschick (Bit Quill Technologies Inc)" Date: Wed, 2 Sep 2026 17:13:01 -0700 Subject: [PATCH 1/2] chore(go/adbc): allow symbol table and debug info to be included in go libraries --- .../FlightSql/Build-FlightSqlDriver.ps1 | 39 +++++++++++-------- go/adbc/pkg/Makefile | 11 +++++- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 b/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 index fd7dee0690..8fc1df4bc0 100644 --- a/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 +++ b/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 @@ -35,29 +35,36 @@ $location = Get-Location $file = "libadbc_driver_flightsql.dll" -if(Test-Path $file) -{ +if (Test-Path $file) { exit } -cd ..\..\..\..\..\go\adbc\pkg +try { + Set-Location ..\..\..\..\..\go\adbc\pkg -make $file + # Ensure full symbols and debug info + $env:INCLUDE_SYMBOL_TABLES="true" + $env:INCLUDE_DEBUG_INFO="true" -if(Test-Path $file) -{ - $processes = Get-Process | Where-Object { $_.Modules.ModuleName -contains $file } + make $file - if ($processes.Count -eq 0) { - try { - # File is not being used, copy it to the destination - Copy-Item -Path $file -Destination $location - Write-Host "File copied successfully." + if (Test-Path $file) { + $processes = Get-Process | Where-Object { $_.Modules.ModuleName -contains $file } + + if ($processes.Count -eq 0) { + try { + # File is not being used, copy it to the destination + Copy-Item -Path $file -Destination $location + Write-Host "File copied successfully." + } + catch { + Write-Host "Caught error: $_" + } } - catch { - Write-Host "Caught error: $_" + else { + Write-Host "File is being used by another process. Cannot copy." } - } else { - Write-Host "File is being used by another process. Cannot copy." } +} finally { + Set-Location $location } diff --git a/go/adbc/pkg/Makefile b/go/adbc/pkg/Makefile index 4f834ab736..984fbf50bc 100644 --- a/go/adbc/pkg/Makefile +++ b/go/adbc/pkg/Makefile @@ -37,6 +37,15 @@ endif GIT_VERSION ?= unknown VERSION=$(subst go/adbc/,,$(GIT_VERSION)) +EXCLUDE_SYMBOL_TABLES ?= -s +ifeq ($(INCLUDE_SYMBOL_TABLES),true) + EXCLUDE_SYMBOL_TABLES = +endif +EXCLUDE_DEBUG_INFO ?= -w +ifeq ($(INCLUDE_DEBUG_INFO),true) + EXCLUDE_DEBUG_INFO = +endif + # Expand dynamically libadbc_driver_.SUFFIX DRIVERS := $(addsuffix .$(SUFFIX),$(addprefix libadbc_driver_,$(MANAGERS))) @@ -48,7 +57,7 @@ DRIVERS := $(addsuffix .$(SUFFIX),$(addprefix libadbc_driver_,$(MANAGERS))) all: $(DRIVERS) libadbc_driver_%.$(SUFFIX): % ../driver/% ../go.mod ../go.sum - $(GO_BUILD) -buildvcs=true -tags driverlib -o $@ -buildmode=c-shared -ldflags "-s -w -X github.com/apache/arrow-adbc/go/adbc/driver/internal/driverbase.infoDriverVersion=$(VERSION)" ./$* + $(GO_BUILD) -buildvcs=true -tags driverlib -o $@ -buildmode=c-shared -ldflags "$(EXCLUDE_SYMBOL_TABLES) $(EXCLUDE_DEBUG_INFO) -X github.com/apache/arrow-adbc/go/adbc/driver/internal/driverbase.infoDriverVersion=$(VERSION)" ./$* $(RM) $(basename $@).h regenerate: From b2da66859fd2acaa77ef6fb4828325998f18b6fd Mon Sep 17 00:00:00 2001 From: "Bruce Irschick (Bit Quill Technologies Inc)" Date: Wed, 2 Sep 2026 17:23:59 -0700 Subject: [PATCH 2/2] ensure debug symbols and info always generated --- .../Interop/FlightSql/Build-FlightSqlDriver.ps1 | 4 ---- go/adbc/pkg/Makefile | 11 +---------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 b/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 index 8fc1df4bc0..67b92d22e4 100644 --- a/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 +++ b/csharp/src/Drivers/Interop/FlightSql/Build-FlightSqlDriver.ps1 @@ -42,10 +42,6 @@ if (Test-Path $file) { try { Set-Location ..\..\..\..\..\go\adbc\pkg - # Ensure full symbols and debug info - $env:INCLUDE_SYMBOL_TABLES="true" - $env:INCLUDE_DEBUG_INFO="true" - make $file if (Test-Path $file) { diff --git a/go/adbc/pkg/Makefile b/go/adbc/pkg/Makefile index 984fbf50bc..fc31007aa7 100644 --- a/go/adbc/pkg/Makefile +++ b/go/adbc/pkg/Makefile @@ -37,15 +37,6 @@ endif GIT_VERSION ?= unknown VERSION=$(subst go/adbc/,,$(GIT_VERSION)) -EXCLUDE_SYMBOL_TABLES ?= -s -ifeq ($(INCLUDE_SYMBOL_TABLES),true) - EXCLUDE_SYMBOL_TABLES = -endif -EXCLUDE_DEBUG_INFO ?= -w -ifeq ($(INCLUDE_DEBUG_INFO),true) - EXCLUDE_DEBUG_INFO = -endif - # Expand dynamically libadbc_driver_.SUFFIX DRIVERS := $(addsuffix .$(SUFFIX),$(addprefix libadbc_driver_,$(MANAGERS))) @@ -57,7 +48,7 @@ DRIVERS := $(addsuffix .$(SUFFIX),$(addprefix libadbc_driver_,$(MANAGERS))) all: $(DRIVERS) libadbc_driver_%.$(SUFFIX): % ../driver/% ../go.mod ../go.sum - $(GO_BUILD) -buildvcs=true -tags driverlib -o $@ -buildmode=c-shared -ldflags "$(EXCLUDE_SYMBOL_TABLES) $(EXCLUDE_DEBUG_INFO) -X github.com/apache/arrow-adbc/go/adbc/driver/internal/driverbase.infoDriverVersion=$(VERSION)" ./$* + $(GO_BUILD) -buildvcs=true -tags driverlib -o $@ -buildmode=c-shared -ldflags "-X github.com/apache/arrow-adbc/go/adbc/driver/internal/driverbase.infoDriverVersion=$(VERSION)" ./$* $(RM) $(basename $@).h regenerate: