When I run the ‘codecrafters test’ command, the following error is output:
make a repo temp copy: copy files: open codecrafters-redis-csharp/.vs/codecrafters-redis-csharp/FileContentIndex/3ad90655-af23-48fd-94b8-ff1dbb66b770.vsidx: permission denied
I’ve tried reinstalling the codecrafters CLI and checking user permissions but the issue persists.
However, if I push to the repo, it tests and executes without issue. It just doesn’t work locally with the codecrafters CLI.
@Aqiil could you try removing .vs once (rm -rf .vs/), and see if this issue persists? I’ve seen this happen before but it was because I messed up the permissions in my repository at some point.
Received a similar report of this from another user too. Moved to Bug Reports.
We’re looking into what possible solutions there are here.
A temporary workaround is to remove .vs/ (rm -rf ./vs) and then run codecrafters test. This fix is temporary, the .vs/ folder will be back soon enough once you edit files in VS Code and save again.
One potential fix here is to only copy files that wouldn’t be ignored by .gitignore. I’m not sure if all of our .gitignores have .vs added though, or whether this is mostly caught by global gitignores.
im having this same issue, but even though .vs is deleted it still wont commit since file size is too large even though the file isn’t there. looks like im screwed
Is anyone working on fixing it?
This issue happens every time if you have Visual Studio opened.
Scenario is like this:
Open Visual Studio
Open cmd and start wsl
Run codecrafters test - “permission denied” appears on files from .vs directory
Close Visual Studio
Run codecrafters test - it works
Open Visual studio
Run codecrafters test - it fails again
A need to constantly close and reopen Visual Studio before running tests makes it very annoying.
Ignoring files/directories that are included in .gitignore would be a good fix - as .vs directory is included there by default.
We can’t just ignore .vs, since that’s going to cause spurious diffs in cases where a user doesn’t have .vs in their gitignore. We should try to honor gitignore (i.e. mimic what Git does)
GitHub - denormal/go-gitignore: Go package for parsing and matching paths against .gitignore files. doesn’t handle global gitignores, let’s research how Git handles global gitignore files and replicate that logic on our end. The core.excludesfile Git config value seems to be what controls a global gitignore file. There’s also some kind of repository-specific file located at ./git/info/exclude, let’s make sure we handle this too.