skerkour / black-hat-rust

Applied offensive security with Rust - https://kerkour.com/black-hat-rust
https://kerkour.com/black-hat-rust
MIT License
3.29k stars 362 forks source link

sqlx v0.6.0 causes compilation errors (ch. 9 Phishing) #80

Closed tsgoten closed 2 years ago

tsgoten commented 2 years ago

The current server/Cargo.toml file causes a compile error due to sqlx.

wasm-pack build --target web --out-name wasm --out-dir ./dist --dev --no-typescript webapp
Error: Error during execution of `cargo metadata`: error: failed to select a version for `sqlx-core`.
    ... required by package `sqlx v0.6.0`
    ... which satisfies dependency `sqlx = "^0.6"` (locked to 0.6.0) of package `server v0.1.0 (/Users/tarang/Developer/rust/black-hat-rust/ch_09/phishing/server)`
versions that meet the requirements `^0.6.0` are: 0.6.0

the package `sqlx` depends on `sqlx-core`, with features: `sqlx` but `sqlx-core` does not have these features.

failed to select a version for `sqlx-core` which could resolve this conflict

make: *** [webapp_debug] Error 1

The fix for now is to downgrade to sqlx v0.5.0

sylvain101010 commented 2 years ago

Hi @tsgoten ,

Thank you for the report!

Can you please share your rustc --version and which command are you running that produces this result.

I just tested and for me make webapp and make webapp_debug are working without any issue.

tsgoten commented 2 years ago

Ah that fixed it! I was on rustc 1.57.0.

Sincerest apologies!