Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo geiger --help may need some work #18

Closed
vi opened this issue Jul 19, 2018 · 4 comments
Closed

cargo geiger --help may need some work #18

vi opened this issue Jul 19, 2018 · 4 comments

Comments

@vi
Copy link

vi commented Jul 19, 2018

$ cargo geiger --help
cargo-geiger 0.3.0
anderejd <[email protected]>
Display a tree visualization of a dependency graph
...

The description should be updated.

Also where is the option advertised on Reddit to filter out unused unsafes?

@anderejd
Copy link
Contributor

Thanks for the report, that looks rather sloppy :D

Description fixed by: anderejd@99382eb

Also where is the option advertised on Reddit to filter out unused unsafes?

This functionality is always on in 0.3.0, sorry for the confusion. Every metric is now printed with two numbers divided by a slash, eg. 123/124, that means that 123 samples of that unsafe metric was used by the build and there are 124 samples total in that crate. Does that make sense?

@vi
Copy link
Author

vi commented Jul 19, 2018

Reddit post called that feature experimental, so I expected an opt-in.

And I see 2/2 where I expect 0/2 (for my own crate where I know those methods are not used).

And openssl-sys is green and is used. (How can a -sys crate be green at all?)

Metric output format: x/y
x = unsafe code used by the build
y = total unsafe code found in the crate

Now I see, it's documented.

@anderejd
Copy link
Contributor

anderejd commented Jul 19, 2018

Reddit post called that feature experimental, so I expected an opt-in.

Thanks for this feedback, communication is hard :) I just edited the reddit post to clarify that I consider the entire tool as an experiment, not just the new feature.

And I see 2/2 where I expect 0/2 (for my own crate where I know those methods are not used).

Can you share this crate? EDIT: I just spotted the link you posted to #22

There are known issues with false positives (I suppose I should add that to the Known issues list). For example test functions are still included unless they are located in an .rs file that only contains test code, the used / not used filtering is done on .rs file level at this time.

Related to: https://github.com/anderejd/cargo-geiger/issues/3

And openssl-sys is green and is used. (How can a -sys crate be green at all?)

This is unexpected, I just did a quick eyeball based check and it contains plenty of unsafe, as expected. I tried cargo-geiger on cargo-tree that I knew depend on openssl-sys and it gave me the numbers:

30/43 24/50 0/0 0/0 0/0

Are you getting 0/0 for all metrics?

There are at this time known issues / limitations for macro and build.rs generated unsafe code. See Known Issues in the README.md. https://github.com/anderejd/cargo-geiger#known-issues

Related to: https://github.com/anderejd/cargo-geiger/issues/7

@anderejd
Copy link
Contributor

Closing this since the structopt description is fixed in master and the rest is addressed in issue #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants