-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
shards install --local
doesn't recognize cached shards
#628
Comments
See adefcf3 The origin changed, and Shards goes to delete the cloned repository to clone the new origin. Hence new origin => delete clone => new clone => fails because we specified |
There are no issues with the bare repositories in the standard cache path ( We probably need to specify |
Yeah, I figure we can even drop |
Yes, that seems to be it. Only if |
Has there been any progress made around vendoring shards since the last comment on this issue? |
👋 Hey again @straight-shoota! I just wanted to check in to see there has been any updates around this issue. Thanks! 🙇 |
We welcome pull requests if anybody's willing to fix an issue. |
@ysbaddaden If no one else is currently taking a shot at fixing this, I can try and allocate some time to take a look in the next several weeks when I'm free. I haven't contributed to this repo before but I'll give it a go 🤞 |
@ysbaddaden I have really been trying for a few days now and really can't grasp what the heck is going on here.
Is what I get in my logs when trying to run install shards locally with my changes from this pull request. I'm feeling pretty defeated trying to solve this problem and figure out why |
I was unable to get
This was all done is dozens of different ways via the Running native git commands on my system worked fine. Running the same commands in CI (Linux GitHub Actions runners) also worked fine. Even running similar function calls through My next course of action is to attempt to read the git |
When a git repository is cached, shards should use that and only that with
--local
(no network requests). This does not seem to work, however. The cache contains bare repositories (only the git metadata without a worktree) which causes some issues with git commands.In #611 (comment) I noticed a particular issue with
GitResolver#origin_url
which runsgit ls-remote --get-url origin
in the cache directory. But git doesn't know its a bare repository and searches for the next.git
folder up in the directory tree.If the cache path is in the work tree of another git repository, it'll result in this repository's origin, which is obviously not what we're looking for.
If it's not in the work tree of another git repository (which should typically be the case with the default
SHARDS_CACHE_PATH
), the result isorigin
. This is a bit surprising and also not what what we're looking for.So I'm wondering how (or if)
origin_url
even works in the first place?This should technically be easy to solve by adding the flag
--bare
to let git now it's working on a bare repository. However we need to understand a bit more why this issue is happening and why it's not a bigger problem. I'm confused how other git commands seem to work with a bare repository just fine, even though they should be affected in a similar way.I presume a similar issue might exist for other resolvers as well.
The text was updated successfully, but these errors were encountered: