"Duplicate symbol definition" error when using incremental compilation with zig sqlite library

I am running zig build test -fincremental --watch in a minimal repo having had been created with zig init and having had this zig-sqlite package added.

When I make changes to a file, I get compile errors like this until I kill and restart the zig build test process:

Build Summary: 2/5 steps succeeded; 1 failed; 1/1 tests passed
test transitive failure
└─ run test transitive failure
   └─ compile test Debug native 273 errors

test
└─ run test
   └─ compile test Debug native 273 errors
error: duplicate symbol definition: sqlite3_status64
    note: defined by .zig-cache/o/0d9f330882b0082415928ee467f2861d/sqlite3.o
    note: defined by .zig-cache/o/0d9f330882b0082415928ee467f2861d/sqlite3.o
error: duplicate symbol definition: sqlite3_mutex_enter
    note: defined by .zig-cache/o/0d9f330882b0082415928ee467f2861d/sqlite3.o
    note: defined by .zig-cache/o/0d9f330882b0082415928ee467f2861d/sqlite3.o
[it goes on like this for a bit, and then ends with]
error: 273 compilation errors

Build Summary: 2/5 steps succeeded; 1 failed; 1/1 tests passed
test transitive failure
└─ run test transitive failure
   └─ compile test Debug native 273 errors

That is, it works the first time I start the process, but once I make any change and save to trigger the watcher to run again, these duplicate symbol errors show up. Does anyone know why this would be happening, or how to fix it if possible?

Same behavior observed with zig 0.15.1 and 0.15.2

Cheers and thank you!

Incremental should not have any different behavior, so assuming your code works when not using incremental, that’s a bug.

Searching on github, look to see if any of these issues are relevant: GitHub · Where software is built

If they aren’t, then file a new issue on github.

1 Like

I don’t use Github, but thanks anyways

I spaced over the first part; doing a search is a great call, thanks. I did find this: