Skip to content
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 file does not exist. #76

Open
dworthen opened this issue Aug 30, 2023 · 4 comments
Open

Cache file does not exist. #76

dworthen opened this issue Aug 30, 2023 · 4 comments
Assignees

Comments

@dworthen
Copy link
Member

dworthen commented Aug 30, 2023

Describe the bug
I updated to the newest cli, version 1.1.4, and added the follow values to ~/.gov4git/config.json

  "cache_dir": "/Users/derek/.gov4git/cache",
  "cache_ttl_seconds": 120,

I am working with an existing community and identity repos so I skipped the init commands. The first command I ran after updating was gov4git ballot show --name issues/1 which resulted in the following error

 g4g ballot show --name issues/1

url="\\Users\\derek\\.gov4git\\cache\\ufxiq2z37alq4jvk52ra5xmw5d74t4ql5ine72rzz43gsn4vg44a\\repo" refspecs=["refs/heads/main:refs/heads/main"] err=exec: "C:\\Program Files\\Git\\mingw64\\libexec\\git-core\\git-upload-pack": file does not exist

I tried running gov4git cache update, which results in no response in the CLI, then rerun the above command and I get the same error. I also get the error from other commands such as gov4git ballot list.

The command appears to create the cache directory filled with guid directories but seems to fail to locate the git-upload-pack. Why is it searching for git binaries? I thought a pure go implementation of git was being used. Any suggestions?

I am running this on Windows.

@dworthen
Copy link
Member Author

I updated my git from version 2.40 to 2.42 and that resolved the issue. Is git a requirement for users to use gov4git?

@petar
Copy link
Member

petar commented Sep 11, 2023

There are a couple of things here.

Overall the new release could not work with your old cache because the format of the cache directory changed.

But thanks to this problem, we are discovering that go-git uses a local git binary in some cases.

I dug into the go-git code ade and discovered https://github.com/go-git/go-git/blob/master/plumbing/transport/file/client.go#L19 that for local URLs which use the "file protocol", go git relies on the local binary.

This is annoying and I've inquired if this can be fixed. But for now I'd assume it cannot be fixed in the short term.

Other users go-git/go-git#614 on the go-git issues board have also experienced hangs during erroneous conditions during local repo access.

I wonder if we can pursue some lightweight solution for M1. For instance:

  • require a newer version of git installed, or
  • package git in the binary app (probably too messy?)

@petar
Copy link
Member

petar commented Sep 12, 2023

FYI I am investigating remedies here go-git/go-git#838

@petar
Copy link
Member

petar commented Sep 15, 2023

I prepared an RC that configured go-git not to use an external git binary https://github.com/gov4git/gov4git/releases/tag/v1.1.8-rc-nogitbinary

This requires comprehensive testing on Windows and through the desktop app before we have confidence to adopt it.

The go-git native approach is not 100% compatible with the alternative of using git binary 2.42, however the incompatibilities do not seem to fall within the use cases of gov4git.

@petar petar self-assigned this Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants