Comments (4)
By design, cargo mirai
behaves as much as possible as cargo check
does. If you have not yet run cargo mirai
on a workspace, it should be rebuilding all members of the workspace because it needs to run rustc with different compiler flags than is the case with cargo check
.
Something that may be tripping you up is that you only see diagnostics for issues that are reachable from an entry point. Only public, non generic functions can be entry points. Even then, by default, you only see issues that are very likely to be real issues. See the discussion here: https://github.com/facebookexperimental/MIRAI/blob/main/documentation/Overview.md
It seems that a much more extensive tutorial would be useful. Perhaps we can collaborate on producing one. I have significant time constraints, so it would be very helpful if you take the lead on it, if this interests you.
from mirai.
Also, perhaps start out with MIRAI_FLAGS="--diag=paranoid" and then downgrade from there as you become more comfortable with how to run MIRAI and more annoyed with all the false positives.
from mirai.
Herman, thanks for taking the time to respond. Your reminder about reachability is great but I do still think there is a bug. Consider the earlier modification to examples/tag_analysis, making it a workspace with members of "timing_channels", "trait_methods", "verification_status". We can run cargo mirai
and get no results. We can even make modifications to the main routine of trait_methods such as:
--- a/examples/tag_analysis/trait_methods/src/lib.rs
+++ b/examples/tag_analysis/trait_methods/src/lib.rs
@@ -46,6 +46,7 @@ impl ProcessWithoutTaint for Block {
pub fn main() {
let mut block = Block { content: 99991 };
+ add_tag!(&block, SecretTaint);
verify!(does_not_have_tag!(&block, SecretTaint));
If we cd examples/tag_analysis/trait_methods ; cargo mirai
then we do see the error on line 50 of a " provably false verification condition". So far so good.
If we cd examples/tag_anslysis ; cargo clean
with our workspace in place and cargo mirai
then there are absolutely no errors. Did I misunderstand? Should this issue errors for all reachable code for all packages in the workspace?
from mirai.
I think the problem might be due to a heuristic that causes MIRAI to suppress any error message that does not originate in the root crate of a compilation. Perhaps when you run it over a workspace such as examples/tag_analysis, it treats the workspace as the root and suppresses the errors that come from the members of the workspace. I don't have time to chase this down and fix it. If you set the directory to a particular example, you will see output.
from mirai.
Related Issues (20)
- Environment variable MIRAI_FLAGS or MIRAI_LOG do not work HOT 2
- MIRAI fails analysing: error: could not compile <bin> HOT 2
- feature request: Annotating traits for attaching tags HOT 3
- question: propagation through closure containing tagged values HOT 14
- suggestion: add example + usage in the README HOT 1
- Memory Usage for rebuild_std.sh HOT 3
- Question: Foreign contracts HOT 6
- Add JSON structure reporting HOT 1
- Compiler unexpectedly panicked when execute `cargo mirai`
- How to pass `--cfg` to mirai? HOT 1
- Does the behavior of add_tag!() and does_not_have_tag!() be affected by type and clone()? HOT 1
- Evaluate Profile-Guided Optimization (PGO) and LLVM BOLT
- No warnings shown for library methods HOT 6
- Is it possible for it to work with async code
- OOM during cargo mirai project analysis
- MacOS Mirai errors HOT 1
- Panic while compiling `libm` HOT 3
- Panic on `std::f64::<impl f64>::log2` HOT 1
- Compilation issues on older versions of crates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mirai.