From c5da7c8fcdf5b2df3ae1109754c590a67195d55d Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Fri, 18 Jun 2021 13:56:37 -0500 Subject: [PATCH] Remove unused import of ./storage/sqlite from wakunode2 In the `when isMainModule:` section of wakunode2.nim, the module `./storage/message/waku_message_store` is imported, which in turn imports waku's sqlite module and also the sqlite3_abi module from `vendor/`. Outside of the `when isMainModule:` section, imports from waku's sqlite module are not used in wakunode2. However, importing it at the top-level results in the C code underlying sqlite3_abi to be compiled into whatever executable one is building, and this is a problem if nim-waku is being consumed together with another library, e.g. nim-sqlcipher, which links against a different build of sqlite (sqlcipher being a superset of sqlite). The linker step fails with reports of duplicate symbols for sqlite. --- waku/v2/node/wakunode2.nim | 1 - 1 file changed, 1 deletion(-) diff --git a/waku/v2/node/wakunode2.nim b/waku/v2/node/wakunode2.nim index 09949b8eb..5854f3331 100644 --- a/waku/v2/node/wakunode2.nim +++ b/waku/v2/node/wakunode2.nim @@ -22,7 +22,6 @@ import ../protocol/waku_lightpush/waku_lightpush, ../protocol/waku_rln_relay/waku_rln_relay_types, ../utils/peers, - ./storage/sqlite, ./storage/message/message_store, ./storage/peer/peer_storage, ../utils/requests,