-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
C-ABI: Add method to create symbolic archive from bytes buffer #250
Conversation
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.
Thanks, this features makes a lot of sense.
No worries about the header, I'll try to convert and try to address compilation errors if I encounter any
|
||
archive = Archive.from_bytes(buf) | ||
obj = archive.get_object(arch="x86_64") | ||
assert obj.features == set(["symtab", "unwind"]) |
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.
Thanks for adding a test! Would you mind moving this into a separate test function to keep the concerns separated?
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.
done
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.
Thank you!
I took the liberty to run cbindgen
on my machine to recreate the header.
@@ -28,7 +28,7 @@ enum SymbolicErrorCode { | |||
SYMBOLIC_ERROR_CODE_OBJECT_ERROR_UNSUPPORTED_OBJECT = 2101, | |||
SYMBOLIC_ERROR_CODE_OBJECT_ERROR_BAD_BREAKPAD_OBJECT = 2102, | |||
SYMBOLIC_ERROR_CODE_OBJECT_ERROR_BAD_ELF_OBJECT = 2103, | |||
SYMBOLIC_ERROR_CODE_OBJECT_ERROR_BAD_MACH_OOBJECT = 2104, | |||
SYMBOLIC_ERROR_CODE_OBJECT_ERROR_BAD_MACH_O_OBJECT = 2104, |
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.
heads up! I manually reverted this line when working on proguard
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.
👍 Thanks. I evaluated this again and thought it's OK to change this now. WDYT?
It would be nice to have the method to create an archive from bytes buffer.
For instance, I have a zip archive with dSYM files and I have to unpack the zip archive to a temp directory, then call the method symbolic_archive_open for each file in order to get symbolic archive instance.
Instead of it, I want to just read the slice of bytes from the zip archive and create the symbolic archive instance from it without the necessity to save the buffer to a temporary file to open it further using current exposed methods
p.s. I've tried to generate heard file calling make file command but it failed due to rust compilation error, so I just added the new method to the file manually (I'm not good in rust to fix such errors)