Namely, in scripts that alter the search paths for dylibs, ensure to
invoke `/usr/bin/xcrun` directly to run `dyld_info` and
`install_name_tool`, and validate that each argument is a valid path.
Addresses rdar://160463033
This library uses GenericMetadataBuilder with a ReaderWriter that can read data and resolve pointers from MachO files, and emit a JSON representation of a dylib containing the built metadata.
We use LLVM's binary file readers to parse the MachO files and resolve fixups so we can follow pointers. This code is somewhat MachO specific, but could be generalized to other formats that LLVM supports.
rdar://116592577
Use `task_read_for_pid()` rather than having the crashing program pass its
own task port through. This opts us in to additional OS security measures
surrounding the use of this call.
rdar://107362003
* [Build] Update scripts to use dyld_info
dyldinfo has been deprecated and will no longer be available on newer Xcode releases. It has been replaced with dyld_info. To stay compatible with older releases, we are still falling back to dyldinfo, if dyld_info is not available.
rdar://98570807
* Apply suggestions from code review
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
In Python 3, subprocess output is read as binary data by default, which isn’t what we want.
Instead of reading process output as byte strings, then manually decoding them into strings, simply pass `text=True` to functions in the `subprocess` module, so that we get properly decoded strings right out the box.
This fixes places that forget to do the decoding step — most especially, the `update-checkout` script. That script prints Git output as byte strings, which leads to unreadable results.
Additionally, in shell.run, use the same pipe for capturing both stdout and stderr. The distinction is pretty pointless in this use case; however, keeping the two channels separate means that we lose the original ordering of printed messages, which does matter.