-
Notifications
You must be signed in to change notification settings - Fork 109
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
mx gate always clones full history of dependencies #146
Comments
Hello, |
That doesn't seem to work for me (trying commit 56081af of mx): $ mkdir mx
$ cd mx
$ git init
Initialized empty Git repository in /home/eregon/mx/.git/
$ git remote add origin https://github.com/graalvm/mx.git
$ git fetch origin 56081af2d974b1650181f3d8496e1dd90a6a583b
error: Server does not allow request for unadvertised object 56081af2d974b1650181f3d8496e1dd90a6a583b
zsh: exit 128 And it seems very unreliable from the comments on StackOverflow as well unfortunately.
|
@eregon oh, you're right. Well, maybe it'd be good enough to support branches and tags the way you mentioned as well as GitHub. Instead of cloning, mx could just download: Example: |
For branches it should be as easy as: diff --git a/mx.py b/mx.py
index a69e55e..d876123 100755
--- a/mx.py
+++ b/mx.py
@@ -6298,7 +6298,7 @@ class GitConfig(VC):
cmd += ['--no-checkout', '--shared', '--origin', 'cache', '-c', 'gc.auto=0', '-c', 'remote.cache.fetch=+refs/remotes/' + hashed_url + '/*:refs/remotes/cache/*', '-c', 'remote.origin.url=' + url, cache]
else:
if branch:
- cmd += ['--branch', branch]
+ cmd += ['--depth', '1', '--branch', branch]
if self.object_cache_mode:
cache = self._local_cache_repo()
log("Fetch from " + url + " into cache " + cache) do you think there are cases where using |
@fniephaus you may use
|
I don't understand how MX_GIT_CACHE would help speeding up CI builds on public infrastructure that doesn't keep state between builds. MX_GIT_CACHE uses a cache on disk and on a fresh system, that cache always needs to be downloaded first. Cloning from scratch is probably faster than that or am I missing something? |
Just in case, double check if your CI infrastructure allows for caching content e.g. https://docs.travis-ci.com/user/caching/ |
@fniephaus yes if caching is not possible on your CI setup, then |
@boris-spas I know that TravisCI supports caching...but like I said before, build performance is unlikely to improve because of it. It's only useful when caching stuff that takes some time to compute (e.g. custom built third party libraries). Not cloning the entire commit history, on the other hand, does improve the time to |
In the meantime, I came up with this workaround (cloning only the required commit before running |
@fniephaus
Thanks for sharing. |
I noticed as well that cloning I think it would be useful to integrate @fniephaus's workaround in mx, what do you think @dougxc ? |
So this just does a shallow clone? That would cause problems for mx operations on imported suites that need a full history. I don't know off the top of my head if the Travis gate includes such operations. |
This could just be an option (e.g. |
Ok, sounds reasonable. |
Unfortunately, the
So that approach doesn't seem different than The size of |
Alternatively, it'd also be possible to download a zip from GitHub, for example https://github.com/oracle/graal/archive/cdcc1dbd9d5370b86b9fcf66401110d1b69d783e.zip. |
Interesting, there are also Here is a quick try to let |
Here is another idea, based on https://stackoverflow.com/a/43926596/388803 and That seems quite fast, 7s + 9s (instead of 243s = 4min) for:
|
FWIW, I tried a
So if we could convince GitHub to do something similar it might help quite a bit too. |
In GitHub Actions
- name: Clone Graal
uses: actions/checkout@v2
with:
repository: oracle/graal
path: graal
fetch-depth: 0 # unlimited
- run: mv graal .. takes 17 seconds. |
I'm running
mx gate
on my CI infrastructure and my project depends on graal which has grown a lot recently. Consequently, it takes quite some time to clone the entire history. It'd be great to have an option to tell mx to not clone the full history. I found this related TODO in the code. Any objections to an option, like--git-depth=1
or--fast-clone
?Best,
Fabio
The text was updated successfully, but these errors were encountered: