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

Fetch Git LFS files after clone #8235

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

plemarquand
Copy link
Contributor

Motivation:

Currently SPM clones repositories with --mirror, creating a bare repository. If the cloned repository uses git lfs, the files in lfs are never pulled and so the package resolution ultimately fails.

Modifications:

This is a naive implementation of LFS support that simply does a lfs fetch on the mirrored repository, without regard for whether there are LFS files to clone or even if the user has git lfs installed. It does, however, allow packages using LFS to resolve correctly.

Issue: #8233

Currently SPM clones repositories with `--mirror`, creating a bare
repository. If the cloned repository uses git lfs, the files in lfs are
never pulled and so the package resolution ultimately fails.

This is a naive implementation of LFS support that simply does a `lfs
fetch` on the mirrored repository, without regard for whether there are
LFS files to clone or even if the user has git lfs installed. It does,
however, allow packages using LFS to resolve correctly.

Issue: swiftlang#8233
@dschaefer2
Copy link
Member

The main question I have is that we do two clones. One into the cache and then another into the scratch dir (.build). Can we git-lfs through them both?

@plemarquand
Copy link
Contributor Author

Once the files have been fetched in to the bare repo (the cached folder) they're treated as regular files in the subsequent clone in to the .build folder, so we should only need to work with git lfs the one time.

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.

2 participants