Skip to content

GitHub is Updating Dependency Graphs for Swift Projects Again

Did you notice they were broken? We did!

by Brian Capps
A series of packages leading down a pipeline with green checkmarks to show they are working, with a single package named "Package.resolved" labeled with a red X to show it is not working and failing to cause the rest of the pipeline to function normally. The graphic is white on a dark reddish-brown to black background, with the image dissolving into fuzzy distorted glitchiness from left to right.

Until last week, GitHub dependency graph generation was broken for pretty much all Swift repositories. Some noticed and wrote custom automations to keep it updated, while others broke some time in 2024 and never updated again. But the end result was the same: a nice GitHub feature simply didn‘t work if you used Swift Package Manager in your project.

In the age of AI, keeping dependencies updated is becoming a more critical security concern, and GitHub‘s automatic dependency graph creation allows exporting a full Bill of Materials including for transitive dependencies, which is important for security teams trying to stay on top of sensitive dependency updates. I encountered this issue recently when a client reported that our dependency graph wasn’t populating on any of several Swift repos, even though GitHub documents support for Package.resolved files from Swift Package Manager (SPM).

I went looking for other open source Swift repos to see what they were doing, and why ours wasn’t updating, when I realized that none of their dependency graphs were updating or populating, either.

It took a lot of investigation, but I eventually found the reason: any Swift repo with a Package.resolved in the v3 format wasn’t having its dependency graph updated, but the few repos with v2 still were.

Since March of 2024, Xcode and the Swift Package Manager have used v3 of Package.resolved, which is a superset of v2 with only one difference: an optional top-level property called origin​Hash that tracks manifest changes. For some reason, GitHub was looking for v2 and only v2.

After opening a ticket, I wrote a tiny automation in GitHub workflows where every time someone on the team committed the v3 version of Package.resolved in a Swift repo it flipped it back to v2, and voilà: the GitHub dependency graphs started updating. A simple workaround for the time being.

Most major open source iOS projects did not have their dependency graphs updating, and I was surprised to learn the diagnosis of v2/v3 being the culprit hadn’t been publicly reported anywhere as far as I could find. Depending on how long this had been an issue on GitHub’s end, dependency graphs may not have been updating for over 2 and a half years.

But funnily enough, shortly after implementing my workaround and updating my GitHub ticket with information about my findings, specifying it was a “high-impact and very low effort” bug to fix, GitHub fixed the issue. They’d made an internal ticket about it some time ago with no ETA, but ended up crediting our ticket with them prioritizing the fix.

And there you have it: our long, international nightmare is over, and dependency graphs now populate automatically for almost all Swift projects on GitHub!

Brian Capps

Brian Capps

Brian is a partner at Lickability. When not working magic with SwiftUI, he‘s probably eating pasta.

You might also like…

<- Back to blog