status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
724 stars 244 forks source link

Using go1.21 is not possible due to `anacrolix/torrent` #4564

Closed richard-ramos closed 2 months ago

richard-ramos commented 7 months ago

While attempting to upgrade to go1.21, I was stopped by errors like these:

[2024-01-10T19:51:53.371Z] ld: error: duplicate symbol: sqlite3_aggregate_context
[2024-01-10T19:51:53.371Z] >>> defined at sqlite3.c:89125
[2024-01-10T19:51:53.371Z] >>>            ../../go-link-3238948430/000084.o:(sqlite3_aggregate_context)
[2024-01-10T19:51:53.371Z] >>> defined at sqlite3.c:89261 (/home/jenkins/workspace/status-go_prs_android_PR-4522@tmp/go/src/github.com/status-im/status-go/vendor/github.com/go-llsqlite/crawshaw/./c/sqlite3.c:89261)
[2024-01-10T19:51:53.371Z] >>>            ../../go-link-3238948430/000111.o:(.text+0x103A0)
[2024-01-10T19:51:53.371Z] 
[2024-01-10T19:51:53.371Z] ld: error: duplicate symbol: sqlite3_auto_extension
[2024-01-10T19:51:53.371Z] >>> defined at sqlite3.c:138759
[2024-01-10T19:51:53.371Z] >>>            ../../go-link-3238948430/000084.o:(sqlite3_auto_extension)
[2024-01-10T19:51:53.371Z] >>> defined at sqlite3.c:134211 (/home/jenkins/workspace/status-go_prs_android_PR-4522@tmp/go/src/github.com/status-im/status-go/vendor/github.com/go-llsqlite/crawshaw/./c/sqlite3.c:134211)
[2024-01-10T19:51:53.371Z] >>>            ../../go-link-3238948430/000111.o:(.text+0x180E0)

It seems that a recent anacrolix/torrent version introduced the use of go-llsqlite/crawshaw, which uses sqlite. Since sqlcipher has the same function definitions as sqlite, status-go fails to build the library due to having duplicated function definitions

cc: @siddarthkay

siddarthkay commented 7 months ago

Thanks @richard-ramos, I will take a look 👍🏻

siddarthkay commented 3 months ago

seems to work here -> https://github.com/status-im/status-go/pull/5216