Documentation ¶
Index ¶
- func CollectDeps(graph *DependencyGraph, opts *CollectorOptions) error
- func DepsPrettyPrint(dep *Dependency)
- func FindFatMachOFiles(folder string) ([]string, error)
- func FixupToplevels(graph *DependencyGraph, opts *CollectorOptions) error
- func IsFatMachO(file string) (bool, error)
- func IsSpecialPath(path string) bool
- func LogError(format string, args ...interface{})
- func LogInfo(format string, args ...interface{})
- func LogInit(noColor, quiet bool)
- func LogNote(format string, args ...interface{})
- func LogWarn(format string, args ...interface{})
- func ResolveAbsPath(path string) (string, error)
- type ArchType
- type ByPath
- type CollectorOptions
- type Dependency
- type DependencyGraph
- type DependencyOptions
- type Dylib
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectDeps ¶
func CollectDeps(graph *DependencyGraph, opts *CollectorOptions) error
func DepsPrettyPrint ¶
func DepsPrettyPrint(dep *Dependency)
DepsPrettyPrint prints a dependency graph in a format similar to the output from ldd.
func FindFatMachOFiles ¶
FindFatMachOFiles will recursively search the specified folder for Fat files or Mach-O files. Symlinked folders are ignored.
func FixupToplevels ¶
func FixupToplevels(graph *DependencyGraph, opts *CollectorOptions) error
func IsFatMachO ¶
IsFatMachO reads the first four bytes of the given file to determine if it is either a Mach-O or Universal (fat) file. On error, the result is false, and the error value is also returned.
func IsSpecialPath ¶
func ResolveAbsPath ¶
ResolveAbsPath resolves a given filepath to an absolute path, following symlinks if necessary.
Types ¶
type ByPath ¶
type ByPath []*Dependency
ByPath sorts a Dependency slice by the Path field
type CollectorOptions ¶
type CollectorOptions struct { Folder string // The folder to dump libraries into PreferredOrder []string // If there are library conflicts, this specifies an order to choose from Overwrite bool // Whether or not to overwrite existing deps ModifySpecialPaths bool // Whether or not to modify paths beginnig with @, e.g. @executable_path CollectFrameworks bool // Whether or not to also collect frameworks Jobs int // Number of concurrent jobs }
CollectorOptions specifies the options for the collector
type Dependency ¶
type Dependency struct { Name string // The name of the library Path string // The path to the library, as specified by the load command RealPath string // The real path to the library, if available (or same as Path) Info string // Compatibility and current version info Pruned bool // Indicates if checking the dependencies of this library were skipped PrunedByFlatDeps bool // Indicates if the libs were removed because they were listed in another subtree (for JSON serialisation only) NotResolved bool // Indicates if the dependencies could not be resolved (could not determine dependencies) IsWeakDep bool // Indicates if this dependency is from a weak load command Deps *[]*Dependency // List of dependencies that this dependency depends on. Ugh we need these pointers because multiple Dependencies can share this. RPaths []string // The rpaths associated with this file }
Dependency contains information about a file and any dependencies that it has.
type DependencyGraph ¶
type DependencyGraph struct { TopDeps []*Dependency // Slice of top level dependencies FlatDeps map[string]*Dependency // Contains all unique, non-pruned referenced dependencies // contains filtered or unexported fields }
DependencyGraph contains information about the dependencies for a collection of files.
func DepsGetJSONSerialisableVersion ¶
func DepsGetJSONSerialisableVersion(graph *DependencyGraph) *DependencyGraph
DepsGetJSONSerialisableVersion returns a dependency graph that's amenable to serialisation. The graph emitted from DepsRead reuses pointers for subtrees to save on computation time. However, on JSON serialisation, this causes subtrees to potentially be repeated over and over again. This method ensures that in a dependency graph, dependencies are only emitted once.
func DepsRead ¶
func DepsRead(opts DependencyOptions, files ...string) (*DependencyGraph, error)
DepsRead calculates the dependency graph for the list of files provided.
type DependencyOptions ¶
type DependencyOptions struct { ExecutablePath string IgnoredPrefixes []string IgnoredFiles []string Recursive bool SkipWeakLibs bool Jobs int }
DependencyOptions specifies the options to be used while calculating the dependency graph.
type Dylib ¶
type Dylib struct { Path string // The path to the library Time uint32 // Time of library CurrentVersion uint32 // Library version CompatVersion uint32 // Compatibility version Weak bool // Whether this is a weakly loaded library Arch *ArchType // Architecture type }
func GetDylibInfo ¶ added in v0.1.0
GetDylibInfo gets information about the file itself, if available. For example, if the file is a dylib, it returns information about the Dylib itself.
func ReadDylibs ¶
ReadDylibs returns the list of dynamic libraries referenced by a file. The file may either be a fat file or a normal Mach-O file. This method will search for both normal libs and weakly loaded libs.