Skip to content

Add recursive package memory for quicker builds - #726

Open
tylerjonesio wants to merge 1 commit into
skiptools:mainfrom
tylerjonesio:recursive-graph-fix
Open

Add recursive package memory for quicker builds#726
tylerjonesio wants to merge 1 commit into
skiptools:mainfrom
tylerjonesio:recursive-graph-fix

Conversation

@tylerjonesio

Copy link
Copy Markdown

This PR fixes #709. With large package graphs, running the skipstone build tool plugin could take a very long time and potentially cause OOM errors within Xcode. By adding recursive memory to the recursivePackageDependencies(for package: Package) and dependencies(for targetDependencies: [TargetDependency], in package: Package) functions, we can ensure the built tool doesn't needlessly traverse packages that have already been seen.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Codex was used to help investigate performance issues and make a first pass at these improvements. I followed up with some code cleanup and tested against my own project. The built tool time went from ~300 seconds to 1 second.


@cla-bot cla-bot Bot added the cla-signed Automatically-added indication of a signed Contributor License Agreement label Aug 22, 2026

@marcprux marcprux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice simple fix! How extensively have you exercised this on your own projects? Have you noticed any glitches (like stale builds)?

@tylerjonesio

Copy link
Copy Markdown
Author

I've tested an earlier version of this off an on for a couple of weeks. I've tested this specific revision a little more heavily the past few days. I was a little nervous digging into this since this is such a key component, but so far I haven't noticed any stale builds or bad side effects. Just quicker builds!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed Automatically-added indication of a signed Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Applying build tool plugin is slow and causes OOM errors with large SPM dependency graph

2 participants