elm-github-install
elm-github-install copied to clipboard
elm-install frequently fails when >1 build is run in parallel
I get this error a lot on my build server:
error: git '--git-dir=/var/lib/jenkins/.elm-install/github.com/elm-lang/html/.git' '--work-tree=/var/lib/jenkins/.elm-install/github.com/elm-lang/html' checkout '1.0.0' 2>&1:fatal: Unable to create '/var/lib/jenkins/.elm-install/github.com/elm-lang/html/.git/index.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.. Use --trace to view backtrace
The problem is easy enough to work around by either:
- Making parallel builds run sequentially
- Containerizing every build to ensure they do not interfere with each other.
So perhpas it is unfair to rase this as an issue against elm-github-install?
But it would be nice if it were possible to have a centralized cache under ~/.elm-install and for parallel builds to be able to run.
I think understand the problem.
So perhpas it is unfair to rase this as an issue against elm-github-install?
I don't know :smile: maybe it's possible to wait for a process to exit using the git gem but I need to look into that.
If the builds are running in a different directory you can use the --cache-directory flag to avoid this.
I will try the --cache-directory flag to set up each build with its own cache. I made the build serial but it takes too long now, at least that will get it back to parallel. Thanks.