-
Notifications
You must be signed in to change notification settings - Fork 1
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
Cache builds #26
Merged
Cache builds #26
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create and checkout branch softly -- don't throw an error if it exists or already on it handle no changes commit -- before commit check changes, if no chages, then throw specific error
it initialize git and create empty master with single commit
this will allow using Git as git.remote.add
Logic is simillar to GitCacher but a little bit different -- need to refactor, but idea is nice. Work only with remote repo and clone it with --depth=1 and specified branch name, which optimize the size of repo (don't download everythin, which it do, from the web). Also the organization of repo is well defined right now -- repo, where each build has unique branch. In terms of remote git repo (github etc) it will perfectly work, and will work with cis also
The best part about git is, that it can use any url to git repo -- you can work with any git repo as a remote repo. This feature allow to simplify GitCacher by a lot.
When saving you should clone master branch (because your package branch isn't created yes -- it's save), but when updating you can directly clone your package branch (without cloning anything else) and work with that. In future this should be simplified from user's point of view, but right now it is as it is.
delete cloned folder in save/update end
This method will output list of packageIDs, and in case of git repo list of remotes. Done by 'git ls-remote' which is pretty cool since there is no big downloads except just branches list
Previousle there was init(depofile: Depofile, ...), now its init(packages: Packages, ...). It's required for implement caching more easily: - got all packages from Depofile - some of them are cached and don't need to be builded - so you don't pass them to Manager It's easier to filter packages, then recreate Depofile with filtered packages. Also it looks more solid.
Intead pass them to Command.command (update | install | build)
Packages is flexible cause AllPackageManager can just do Packages = Depofile. Packages should be a collection and thats flexible, but now, for caching, build, update and install should return [Package: [URL]] which is impossible with Packages
In Install, Update and Build command there is a extension which adds default `run` implementation. It constaints for ValueType == [Package], but this weren't like that for AllPackageManager so I fixed that by wrapping Depofile into array
Got and freezing process when calling 'xcodebuild -list -json' for huge project where output of this program is near 2000 lines. Tryed the ShellOut project on github and there is no such thing when using it. Copy their solution and redesign project's Shell
remove old Has<COMMAND>Command protocols and bunch of others trying to replace them with single PackageManager
DepoCore is compiling with new types
Tublad
reviewed
Apr 1, 2021
Sources/DepoCore/PackageManagers/GitCachablePackageManager.swift
Outdated
Show resolved
Hide resolved
This url will be used to access cache if --cache-builds specified
stason314
approved these changes
Apr 6, 2021
Tublad
approved these changes
Apr 8, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
In this PR the cacher subcommand is introduced. Main features of this are simple:
Also notice that build-cache mechanism is embeded in
spm
command. To tell thatspm
build products should be cached, the--cache-builds
arg should be passed.Some minor/major fixes were introduced also such as:
Checklist