Skip to content

fix: add workaround for driver manager venv path bug - #92

Closed
amoeba wants to merge 0 commit into
columnar-tech:mainfrom
amoeba:fix/venv-workaround
Closed

amoeba wants to merge 0 commit into
columnar-tech:mainfrom
amoeba:fix/venv-workaround

Conversation

@amoeba

@amoeba amoeba commented Sep 24, 2025 •

Copy link
Copy Markdown
Member

This works around a bug we identified with the 1.8.0 driver managers when using virtual environments. They are supposed to locate drivers in $VIRTUAL_ENV/etc/adbc/drivers but they look in $VIRTUAL_ENV/etc/adbc/. There may be a patch release soon to fix this but, in the mean time, we can work around this by symlinking manifests from $VIRTUAL_ENV/etc/adbc/drivers to $VIRTUAL_ENV/etc/adbc/. The manifests use absolute paths so it's fine.

This PR also adds an integration workflow which is how I tested my change. I don't think we want to run it on every single commit to the repo so we might discuss here when we might want to run something like this or if we want to run it in another repo.

@amoeba

amoeba commented Sep 25, 2025

Copy link
Copy Markdown
Member Author

One thing to think about..

There are two reasonable approaches here: Create a symlink or duplicate the file. The symlink approach seems to work on Linux and I expect it will work on macOS but, on Windows, symlinks a trickier. Windows normally requires admin privs to create symlinks but Go supports detection of "Developer Mode" (an OS-wide setting IIRC) which lets non-admin users create symlinks.

We could fall back to duplicating the manifest instead of symlinking on Windows.

@amoeba

amoeba commented Sep 25, 2025

Copy link
Copy Markdown
Member Author

At least in CI (which I bet has developer mode turned on), the symlink approach seems to work fine. I'll keep working on this tomorrow.

@amoeba

amoeba commented Sep 26, 2025

Copy link
Copy Markdown
Member Author

I'm happy with this but as a final test, I've commented out the code change and am letting CI test.

@amoeba

amoeba commented Sep 26, 2025 •

Copy link
Copy Markdown
Member Author

Okay this looks good. Without this change, the GHA workflow fails each OS:

Linux fails: additional search path: /home/runner/work/dbc/dbc/.venv/etc/adbc
macOS fails: additional search path: /Users/runner/work/dbc/dbc/.venv/etc/adbc
Windows fails: additional search path: D:\a\dbc\dbc\.venv\etc/adbc

See the associated run: https://github.com/columnar-tech/dbc/actions/runs/18027435968/job/51297285706.

@amoeba

amoeba commented Sep 26, 2025

Copy link
Copy Markdown
Member Author

@amoeba
amoeba marked this pull request as ready for review September 26, 2025 04:06
@amoeba amoeba changed the title draft: test 1.8.0 driver manager workaround fix: add workaround for driver manager venv path bug Sep 26, 2025
@amoeba

amoeba commented Sep 26, 2025

Copy link
Copy Markdown
Member Author

Ready for 👀 @zeroshade

Comment thread .github/workflows/integration.yml Outdated
Comment on lines +55 to +59
if [[ "$RUNNER_OS" == "Windows" ]]; then
go build -o dbc.exe ./cmd/dbc
else
go build -o dbc ./cmd/dbc
fi

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.

This can be simplified as just go build ./cmd/dbc it will automatically use dbc or dbc.exe without us needing to maintain the logic with -o

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh, nice. I had a heck of a time finding the right incantation to run dbc on Windows in CI. I'll change this.

Comment thread ci/scripts/run_integration.sh Outdated
Comment on lines +3 to +11
set -eux

python -m venv .venv

if [ -f ".venv/bin/activate" ]; then
. ".venv/bin/activate"
else
. ".venv/Scripts/activate"
fi

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.

should we rename this better as run_venv_integration?

Comment thread scripts/install.sh Resolved
Comment thread scripts/install.sh Resolved
@amoeba amoeba closed this Sep 26, 2025
@netlify

netlify Bot commented Sep 26, 2025 •

Copy link
Copy Markdown

❌ Deploy Preview for columnar-dbc failed.

Name Link
🔨 Latest commit 2d185ab2c24f254c9fcadccd43837c4750649bbb
🔍 Latest deploy log https://app.netlify.com/projects/columnar-dbc/deploys/68d6e98b55448d0008bb6aa4

@amoeba

amoeba commented Sep 26, 2025

Copy link
Copy Markdown
Member Author

Hrm, not sure what closed the PR.

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