Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #36
This PR adds a git source with optimized fetching and commit sha based caching. It uses one shared repository per remote, updates it when needed and checks out the commit current build needs.
One of the issues found when implementing this was that some projects expect
.git
directory for detecting the current version. I currently solved it with akeepgitdir
option but it is not very clean.Another slight problem is that the current git identifier syntax doesn't support setting a branch/tag and a commit sha on the same time(unlike image reference for example). This means that when commit sha is used we need to pull all commits of all remote references, and if branch/tag is used we need to resolve it every time to check that it has not changed for the cache hit. I wonder if it would be safe to assume that tags are immutable for the cache.
I also added support for
llb.Scratch()
as I needed it for modified example. I also added back the older versions ofbuildkit
example to show how they have changed.@AkihiroSuda