-
Notifications
You must be signed in to change notification settings - Fork 30
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
Dependency data not embedded unless inject_dependency_list!()
return value is used
#9
Comments
version_info()
is usedversion_info()
is called
version_info()
is calledinject_dependency_list!()
return value is used
I tested this project in our commercial project and there's something I don't understand. You advice to add
in our main.rs so the variable is used and thus added into the binary strings. This, if course, prints something when the program starts. Obviously I and pretty much everybody don't want anything printed in their console. I can't use nightly either, so the black box trick won't do. Is there any other tricks to use? Or maybe a better question: should we use this project or the only end goal is to add it into cargo and then we use it? |
You can only print it if a certain command-line parameter is passed, like with
The eventual goal is to add it to Cargo itself, but before that it would be great to see how the approach works in practice and if there is anything we need to change before stabilizing the format. So please use it and provide feedback - it's much easier to act on it here than after it's merged into cargo! |
The crate bencher implements unsafe {
// Safety: u8 is Copy.
ptr::read_volatile(&COMPRESSED_DEPENDENCY_LIST[0]);
} |
The relevant issue (rust-lang/rust#47384) appears to have been quietly fixed, and is now closed as of a week ago |
It still isn't usable for ELF - we need I think the way to go is to implement external injection instead, as discussed in #29. I have a prototype in a branch already. |
Oh okay. I was just making sure you were aware that the issue had closed |
External injection via |
Dependency information will not be present in the final binary, unless the data returned by
auditable::inject_dependency_list!()
is actually used somewhere in the binary (printed, put intotest::black_box
, etc).This is actually a bug in rustc: rust-lang/rust#47384
The text was updated successfully, but these errors were encountered: