Skip to content

Move back to CMake for libgit2 compilation#2786

Merged
lucasderraugh merged 1 commit into
masterfrom
lucasderraugh-use-cmake
Jun 10, 2026
Merged

Move back to CMake for libgit2 compilation#2786
lucasderraugh merged 1 commit into
masterfrom
lucasderraugh-use-cmake

Conversation

@lucasderraugh

@lucasderraugh lucasderraugh commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

At some point we tried to re-engineer the build process of libgit2 but this comes with lots of sharp edges with the only benefit being automatic building of dependencies through SPM.

Ultimately, I don't think this is worth it given the complexity of managing the various parameters for compilation. This PR reaches a middle ground where we will pre-compile the libgit2 project using cmake into xcframework.

Also fixes #2773 by using a flag we used previously -DUSE_SSH=libssh2. Ultimately this will use libssh2 rather than the external ssh option (ssh_exec). Looking into it, there was a bug in the libgit2 implementation that would never wait on the process on close. I think there is a patch that could be made but I believe this change will return to the behavior of 1.4.3.

At some point we tried to re-engineer the build process of libgit2 but this comes with lots of sharp edges with the only benefit being automatic building of dependencies through SPM.

Ultimately, I don't think this is worth it given the complexity of managing the various parameters for compilation. This PR reaches a middle ground where we will pre-compile the libgit2 project using cmake into xcframework.

Also fixes #2773 by using a flag we used previously -DUSE_SSH=libssh2. Ultimately this will use libssh2 rather than the external ssh option (ssh_exec). Looking into it, there was a bug in the libgit2 implementation that would never wait on the process on close. I think there is a patch that could be made but I believe this is inline with the behavior of 1.4.3.
@lucasderraugh lucasderraugh force-pushed the lucasderraugh-use-cmake branch from 70f87aa to 3af84cb Compare June 10, 2026 03:05
@lucasderraugh lucasderraugh merged commit 16905ef into master Jun 10, 2026
2 checks passed
@Cykelero

Copy link
Copy Markdown
Contributor

Reverting to libssh2 comes at a heavy cost! We’ll lose all support for custom .ssh/config files, which includes easy third-party agent integration (e.g. 1Password). This was a big reason for updating our libgit2 fork last year.

I assume some GitUp users will miss that support, and for me personally, it also means I’ll need to manage different libgit2 build settings in Retcon, since dropping SSH config support is not an option anymore.

Do you think there might be another way of fixing the zombie issue? I don’t think the tradeoff of switching back to libssh2 is worth it.

@lucasderraugh

Copy link
Copy Markdown
Collaborator Author

Ah, thank you. I was trying to recall why we would have moved away. I had a patch in that I think worked so let me retry using that.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Zombie processes on 1.5.0 beta

2 participants