-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Description
We run swift-package-manager on CI and lately we've noticed that Git's index.lock is left after a build is cancelled. That is a problem, because the lock file prevents post-build repository cleanup from working, i.e. git calls return an error.
Git is called in somewhere here
swift-package-manager/Sources/PackageLoading/ManifestLoader.swift
Lines 859 to 862 in c5d77e5
gitInformation = ContextModel.GitInformation( | |
currentTag: repo.getCurrentTag(), | |
currentCommit: try repo.getCurrentRevision().identifier, | |
hasUncommittedChanges: repo.hasUncommittedChanges() |
Is it possible to disable calling Git in swift-package-manager? For example, via an environment variable.
Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
Swift Package Manager version/commit hash
No response
Swift & OS version (output of swift --version && uname -a
)
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
plemarquand commentedon Jun 24, 2025
Git is used quire a few places throughout SwiftPM, most prominently during package resolution. Disabling Git would break package resolution, so isn't really an option.
Cancelling a build gracefully (SIGINT or SIGTERM) should also shut down child git processes gracefully, cleaning the lock file. If a build is cancelled with SIGKILL then this may not happen, so isn't recommended.