Skip to content
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

Support Framework Build Phase, Rework Dependency Mapping #45

Merged
merged 15 commits into from
Dec 1, 2023

Conversation

NinjaLikesCheez
Copy link
Collaborator

@NinjaLikesCheez NinjaLikesCheez commented Aug 23, 2023

Gen IR parses through Xcode files that represents the project - pbxproj files - and uses PBXNativeTarget (and others) to represent the main targets. This is also used to do a lot of the dependency tracking as they have a helpful dependency and packageProductDependencies arrays which we can use.

Turns out, as is often the case with this undocumented format, that is not the only way Xcode handles dependencies! There also exists a special build phase (PBXFrameworksBuildPhase - more commonly known to developers as ‘Link Binary with Libraries’) that doesn’t list targets in the dependency arrays. Instead, this phase has a files array - which lists some additional dependencies (some of which are included in either the dependency or package array… but it turns out not all!).

This change adds support for parsing this file list.

In addition, this change also adds a new and improved way of tracking dependencies via a directed graph which improves our ability to control how and when we move files - so as not to miss transitive dependencies.

@NinjaLikesCheez NinjaLikesCheez force-pushed the missing_dependency_tracking branch from dba950b to d6540bb Compare September 11, 2023 13:32
@NinjaLikesCheez NinjaLikesCheez changed the title Support Framework Build Phase Support Framework Build Phase, Rework Dependency Mapping Sep 25, 2023
@NinjaLikesCheez NinjaLikesCheez changed the base branch from main to unstable October 20, 2023 12:27
@NinjaLikesCheez NinjaLikesCheez changed the base branch from unstable to main October 23, 2023 11:44
This allows for determining the 'Link Binary with Libraries' build phase (which... for no reason... isn't listed as a dependency in the target?!)
This change adds:

* the ability to write a DOT file representing the
dependency graph of the project with new CLI option
* fixes the graph by correcting a mistake where edges could be linked
  multiple times, and removes original transitive depependency finding
  since that's now in the graph
* adds support for 'embed frameworks' copy files build phase
@NinjaLikesCheez NinjaLikesCheez force-pushed the missing_dependency_tracking branch from 08d0779 to de5d42d Compare December 1, 2023 10:28
@NinjaLikesCheez NinjaLikesCheez changed the base branch from main to develop December 1, 2023 10:28
@NinjaLikesCheez NinjaLikesCheez merged commit 1171006 into develop Dec 1, 2023
2 of 3 checks passed
@NinjaLikesCheez NinjaLikesCheez deleted the missing_dependency_tracking branch December 1, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant