Windows diesel link issue sqlite - only with cargo test

Hi

I created a sample project https://github.com/ta32/issues/tree/master/clion_sqlite_build

I installed cargo install diesel_cli --no-default-features --features “sqlite-bundled”

The project builds fine with cargo build
But you get a link error when you do ‘cargo test’

s\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-b5aae910499df009.rlib" “C:\Users\aluwihat\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcompiler_builtins-9a7454af4f639d0b.rlib” “kernel32.lib” “sqlite3.lib” “advapi32.lib” “ws2_32.lib” “userenv.lib” “msvcrt.lib”
= note: LINK : fatal error LNK1181: cannot open input file ‘sqlite3.lib’

error: aborting due to previous error

error: could not compile clion_sqlite_build.
To learn more, run the command again with --verbose.

i don’t understand why cargo build works and cargo test has a link error aren’t both using the debug build?

this is not a clion bug because i can reproduce with cargo now

solved the issue
I needed an additional dependency
libsqlite3-sys = { version = “^0”, features = [“bundled”] }

It’s possible somehow cargo was finding the library somewhere on my path. But when you build with cargo test, it needs to rebuild with additional dependencies and it cant use the version linked with when you do cargo build