embed default corpus#2
Open
evanrichter wants to merge 1 commit into
Open
Conversation
Owner
|
Hello. Thank you for your PR. I'd be happy to merge it if there's a way to embed the corpus when using "cargo install". Unfortunately I could not find a simple way to do that. Do you have any idea on how to do this? |
Author
|
That's precisely what this PR does! You can verify with something like cd /tmp # no corpus here
cargo install --force --git https://github.com/evanrichter/cpu_rec_rs
ls -lah ~/.cargo/bin/cpu_rec_rs # verify binary size is ~32 MB |
Owner
|
Sorry, I forgot "only" in embed the corpus only when using "cargo install". |
Author
|
We could make it conditional on release vs. debug, but I don't know a way to change behavior of |
Author
|
rebased to fix conflicts |
jevinskie
added a commit
to jevinskie/cpu_rec_rs
that referenced
this pull request
May 25, 2024
…4 to avoid needing to know compression/decompression size. Bugs with manual corpus dir specificiation remain
though this does increase binary size by ~40MB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hey thanks for this tool, it came in handy identifying 8051 firmware today!
when in doubt, it's always 8051 ;)
anyway, I hit a small snag when trying to just
cargo install --git https://github.com/trou/cpu_rec_rsand go (because the corpus wasn't on my local disk). Not too big of a deal, but a self-contained binary would be more convenient than keeping a copy of the corpus files around.This obviously bloats the binary size. I chose postcard to encode the corpus, which is relatively compact, but the corpus still weighs in around 40MB.
So then I compressed it with lz4 and landed around 32MB for the executable (apple m1 mach-o binary).
In my opinion that's a good tradeoff, what do you think?