est31 / warnalyzer

Show unused code from multi-crate Rust projects
Other
89 stars 4 forks source link

rust-analyzer puts out non UTF-8 characters and warnanalyzer chokes on them? #13

Closed OvidiusCicero closed 1 hour ago

OvidiusCicero commented 3 hours ago

I do

rust-analyzer scip .

Indeed the file looks strange:

head index.scip

�,
rust-analyzer.81.0 (eeb90cd 2024-09-04)�Vfile:///home/christian/Nextcloud/computer_sync_hardlink/rustmake/rmake_zweiter-versuch �w"rust
parser_test/build.-rust-analyzer cargo parser_test 0.1.0 mailocalocal�Jrust-analyzer cargo std https://github.com/rust-lang/rust/library/std en"Srust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var_os()4_rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#unwrap().
�5rust-analyzer cargo lalrpop 0.21.0 api/Configuratio;rust-analyzer cargo lalrpop 0.21.0 api/Configuration#new(),Brust-analyzer cargo lalrpop 0.21.0 api/Configuration#set_in_dir().=Crust-analyzer cargo lalrpop 0.21.0 api/Configuration#set_out_dir(Elocal N?rust-analyzer cargo lalrpop 0.21.0 api/Configuration#process()W_rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#unwrap().�b
-rust-analyzer cargo parser_test 0.1.0 main().(2main:)"rust
parser_test/build.rs*   fn main()0�z
local 0(=2out_dir:5"rust
parser_test/build.rs*let out_dir: OsString0B-rust-analyzer cargo parser_test 0.1.0 main().��H
local 1��G# The Rust Standard Library

When I run warnanalyzer I indeed get an error:

> warnalyzer index.scip
Error: StrErr("stream did not contain valid UTF-8")
bjorn3 commented 2 hours ago

ScIP is a protobuf based file format. As protobuf is a binary format, it is expected that it is not UTF-8. Which warnalyzer version are you using? Are you using the version from crates.io? That is a very outdated version from before the move th SCIP. You need to use the latest commit in this repo instead.

OvidiusCicero commented 1 hour ago

ah crap thank you!