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: init at 0.7.3 #72633
cargo-geiger: init at 0.7.3 #72633
Conversation
bcc3f7f
to
4cec128
Compare
sha256 = "1lm8dx19svdpg99zbpfcm1272n18y63sq756hf6k99zi51av17xc"; | ||
}; | ||
|
||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why exclude tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network access.
---- test_package::case_3 stdout ----
-------------- TEST START --------------
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Snapshot Differences ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Snapshot file: cargo-geiger/tests/snapshots/mod__test3_package_with_nested_deps.stderr.snap
Snapshot: test3_package_with_nested_deps.stderr
Source: cargo-geiger/tests/mod.rs:44
Old: n.a.
New: Sun, 3 Nov 2019 00:26:17 +0000
+new results
────────────────────────────────────────────────────────────────────────────────
stderr
────────────┬───────────────────────────────────────────────────────────────────
1 │+error: failed to load source for a dependency on `itertools`
2 │+
3 │+Caused by:
4 │+ Unable to update https://github.com/rust-itertools/itertools.git?rev=8761fbefb3b209
5 │+
6 │+Caused by:
7 │+ failed to clone into: /build/git/db/itertools-eb89fd56766bcf43
8 │+
9 │+Caused by:
10 │+ failed to resolve address for github.com: Name or service not known; class=Net (12)
11 │+
────────────┴───────────────────────────────────────────────────────────────────
Oddly enough, tests seemed to fail even outside of nix-build
for the release I selected here, but passed on master.
Regardless, it looks like they won't work without network connectivity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to selectively disable certain tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh I’d rather not selectively disable tests, but I do want to look at cargo insta which this crate seems to use.
Going to see if there’s anything I can do in preCheck
or etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case that doesn't work, then yes, skipping specific tests seems pretty straight-forward to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decided to settle on disabling a few tests for now.
I was able to compile after skipping 3 out of 7 tests.
I also added a note on how we might be able to run these in the future.
- Add note on how we might be able to run all tests in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix-review
passes on NiXOS
diff LGTM
executable seems to work
https://github.com/NixOS/nixpkgs/pull/72633
1 package were build:
cargo-geiger
ty for enabling the tests which work well with sandbox :) |
Motivation for this change
cargo-geiger: Detects usage of unsafe Rust in a Rust crate and its dependencies.
I recently discovered safety-dance and figured cargo-geiger would be a nice utility to have on nixpkgs.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Seems to work fine without any tweaks.
Some sample output from the url crate:
I had to use
rev = "${pname}-${version}";
forrev
as there are two programs in the repository (including the releases section): cargo-geiger and geiger.I'm following the updates for
cargo-geiger
, so I have to use this rather than e.g.v${version}
.Happy to do whatever is cleanest, though.
Also, I have not tested on a Mac, but would be happy if somebody was able to do so.
Aside from installation, all that needs to be done for testing is running
cargo geiger
from a "normal" (/singular) Rust project -- e.g. not a virtual workspace, such as the root of the main Rust repo.Finally, I noticed there are categories for
development/tools/rust
andtools/package-management
.There seemed to be some overlap between the two categories, so I just settled with
development/tools/rust
for now.Happy to modify this if there is a better option.