AppleUniversalBinary

class starlark_tugger.AppleUniversalBinary

Represents a universal/fat/multi-architecture Mach-O binary - the executable file format used by Apple operating systems.

Instances exist to facilitate the creation of universal binaries from source Mach-O binaries. This type provides similar functionality to the lipo tool, which is Apple’s tool for interfacing with universal binaries.

__init__(filename: str) AppleUniversalBinary

Construct a new instance representing an empty binary having the given filename.

add_path(path: str)

Add a binary from a given filesystem path to this instance.

This effectively marks the binary for inclusion when we go to produce a new universal binary.

The file can be a single architecture Mach-O or universal Mach-O. If universal, all architectures within that file will be added.

add_file(content: FileContent)

Add a binary from the given FileContent instance to this instance.

This is like AppleUniversalBinary.add_path() except the content of the binary comes from a FileContent instance instead of the filesystem.

to_file_content() FileContent

Convert this instance to a FileContent.

The content of the returned object will be a just-in-time produced universal Mach-O binary.

write_to_directory(path: str) str

Write a file containing this universal Mach-O binary into the directory specified.

Absolute paths are accepted as-is. Relative paths are relative to the currently configured build path.

Returns the absolute path of the written file.