-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
avoid worktree checkouts #1207
avoid worktree checkouts #1207
Conversation
This will be way faster on windows
@NobodyXu This should do the trick! I was definitely surprised when I saw that it will do a temporary clone of the crates index just to get a single file, but at least it's better now that it doesn't have to checkout 120k files to get there. I also now realize how prohibitive it would be to try to install a binary on windows that way. Somehow I expected it to keep a copy of the index around and maintain that instead, as otherwise there seems to be no value to use git at all here, just overhead. Instead, I thought one would fetch the file from GitHub directly. In any case, please feel free to push changes directly into this PR so it can be merged quickly. I consider this more like a basis that you can build upon if there is more to add. Thanks and cheers. |
@Byron Thank you very much for this PR!
Yeah, it's much better than checking out 120k files.
This is even more true if you have the virus scanner turned on...
It's cloned only once in It uses
Hmm, I'm not sure if I have the permission to push to your repository, and I usually don't like pushing to others' PR. This PR is actually quite well done and you would just need to take a few changes annd modify load_manifest_from_workspace and resolve.rs. |
Thanks for the notes! I hoped you could apply the changes yourself and push directly into my branch. With |
This comment was marked as outdated.
This comment was marked as outdated.
Thanks, I didn't know I could do that!
True, thanks for the advice, I would make that change real quick. |
Typo: I think you mean |
@Byron I need some help: is there anyway to find out if a path is a dir or a regular file or symlink? |
When looking up an entry in a tree, one can also ask for the entry's mode. The mode indicates if it's a blob, symlink, or executable. Indeed, symlinks would need another lookup then. |
Thanks, is there anyway to list dir and tell if a path corresponds to a directory? Edit: Oh I see it's But still I don't know how to get the destination of the symlink and children of the dir. |
So for directory, if my guess is right, the mode will be For symlink, according to my knowledge, git simply encodes the destination as the content of the file, so I just need to obtain the But converting it to @Byron Is my guess about this correct? |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
and also refactor implementation of `git::Repository::{shallow_clone, shallow_clone_bare}`. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Yes, that should work.
It could be a file or directory, but since it's the However, I think that Is this really something that is needed? The entire index doesn't seem to have a single symlink.
|
Thanks for confimration!
Well
I was actually thinking about how to avoid checking out files for Not sure how this interfaces with submodule though, and I'm not sure if people will use |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
I see that you would like to cover every possible case, any kind of custom crates.io repo that the user throws at you. To my mind it's always preferable to gracefully fail with assertions or errors and wait until people create issues for that. After all, nobody might ever run into these cases. For |
Thanks!
Well it's actually not for registry, but custom
It is the same as |
This PR also speeds up running |
Can confirm that cloning crates.io git registry now takes about 13s on CI. |
Hmmm I gave it up because
from #1208 (comment) |
@Byron Thank you for your work! |
Motivation
Clones of the crates-index are very slow on windows., and
cargo
is also not doing them but uses bare clones instead.Tasks
Guidance
Source