Comments (7)
Oh okay. I was just making sure you were aware that the issue had closed
from cargo-auditable.
I tested this project in our commercial project and there's something I don't understand. You advice to add
println!("{}", COMPRESSED_DEPENDENCY_LIST[0]);
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?
from cargo-auditable.
Is there any other tricks to use?
You can only print it if a certain command-line parameter is passed, like with --help
. Anything that uses the data in some way will work.
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?
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!
from cargo-auditable.
The crate bencher implements black_box
in stable Rust like https://docs.rs/bencher/0.1.5/src/bencher/lib.rs.html#590-596, because the optimizer currently does not remove volatile reads. It's a bit sad to resort to unsafe, though:
unsafe {
// Safety: u8 is Copy.
ptr::read_volatile(&COMPRESSED_DEPENDENCY_LIST[0]);
}
from cargo-auditable.
The relevant issue (rust-lang/rust#47384) appears to have been quietly fixed, and is now closed as of a week ago
from cargo-auditable.
It still isn't usable for ELF - we need #[used(linker)]
rather than the current #[used]
which is equivalent to #[used(compiler)]
. It's difficult to support because only very recent ELF linkers implement the required flags.
I think the way to go is to implement external injection instead, as discussed in #29. I have a prototype in a branch already.
from cargo-auditable.
External injection via cargo auditable
is now the default, and it avoids this problem.
from cargo-auditable.
Related Issues (20)
- Track C libraries somehow
- Empty copyright placeholder HOT 2
- Upgrade to `object` 0.30
- Add more fields to categories HOT 1
- Proper MSVC support HOT 6
- No way to pass `-C link-arg=` when using both naked LLD and LLD via a compiler wrapper HOT 1
- Include commit hashes for git dependencies HOT 9
- Can't build recent `gitoxide` versions HOT 6
- How does cargo-auditable construct the information that it includes in the binary? HOT 1
- cargo metadata tries to collect dev dependencies HOT 1
- Cargo.lock is outdated HOT 11
- Run CI with `--frozen` HOT 1
- Incompatibility with sccache on long builds HOT 28
- Provide a documented way to use `cargo auditable` as a drop-in replacement for `cargo` HOT 9
- Support `RUSTC` environment variable HOT 1
- Auditability / Cheating HOT 8
- Use cargo-auditable with cross? HOT 6
- Out of the box support for other formats HOT 5
- Add actual git repository for source HOT 4
- Extend with additional (non-rust) dependencies HOT 3
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 cargo-auditable.