tursodatabase / tursodatabase/libsql

Error related to `libsql_experimental.a` when used with golang sqlite3 driver

Open
#1,029 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Hi,

I'm using golang and am using go-libsql.

When I import sqlite3 and libsql, both drivers, the error below occurs.

import (
	_ "github.com/libsql/go-libsql"
	_ "github.com/mattn/go-sqlite3"
)
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
duplicate symbol '_sqlite3_vsnprintf' in:
    /private/var/folders/16/lvgrynkd1n93dqjg140gs5wm0000gn/T/go-link-3924145887/000013.o
    /Users/sejunpark/go/pkg/mod/github.com/libsql/go-libsql@v0.0.0-20240210093909-f14a170a8487/lib/darwin_arm64/libsql_experimental.a[102](sqlite3.o)
duplicate symbol '_sqlite3_column_count' in:
    /private/var/folders/16/lvgrynkd1n93dqjg140gs5wm0000gn/T/go-link-3924145887/000013.o
    /Users/sejunpark/go/pkg/mod/github.com/libsql/go-libsql@v0.0.0-20240210093909-f14a170a8487/lib/darwin_arm64/libsql_experimental.a[102](sqlite3.o)
duplicate symbol '_sqlite3_vfs_find' in:
    /private/var/folders/16/lvgrynkd1n93dqjg140gs5wm0000gn/T/go-link-3924145887/000013.o
    /Users/sejunpark/go/pkg/mod/github.com/libsql/go-libsql@v0.0.0-20240210093909-f14a170a8487/lib/darwin_arm64/libsql_experimental.a[102](sqlite3.o)

(omitted)

ld: 266 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I thought this was an error related to bindings/c/Makefile

@haaawk Can you help check this out if possible? Thanks again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bindings/c/Makefile and the two imported drivers in the reported Go example. Reproduce the macOS ARM64 link failure, inspect how libsql_experimental.a and the sqlite3 driver provide SQLite symbols, and verify that both drivers can link without duplicate symbols.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, go, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.