bwplotka / bingo

Like `go get` but for Go tools! CI Automating versioning of Go binaries in a nested, isolated Go modules.
Apache License 2.0
342 stars 29 forks source link

bingo get fails on Windows: bingo.tmp.mod is being used by another process #127

Open lectrician1 opened 1 year ago

lectrician1 commented 1 year ago

bingo version output: v0.7

go version output: go version go1.19.3 windows/amd64

What happened:

bingo get
Error: get command failed: get: 0: getting github.com\bwplotka\bingo@v0.5.1: rename mod file: rename C:\Users\jayan\scoop\apps\go\current\src\gitlab.wikimedia.org\repos\releng\cli\.bingo\bingo.tmp.mod C:\Users\jayan\scoop\apps\go\current\src\gitlab.wikimedia.org\repos\releng\cli\.bingo\bingo.mod: The process cannot access the file because it is being used by another process.

What you expected to happen: It installs the dependencies

How to reproduce it (as minimally and precisely as possible): Run bingo get on Windows.

Logs (use bingo get -v <thing you do> for verbose output):

bingo get -v
getting target github.com\bwplotka\bingo@v0.5.1 (module github.com/bwplotka/bingo )
exec 'go list -modfile=C:\Users\jayan\scoop\apps\go\current\src\gitlab.wikimedia.org\repos\releng\cli\.bingo\bingo.tmp.mod -mod=mod -f={{.Name}} github.com\bwplotka\bingo'
exec 'go build -modfile=C:\Users\jayan\scoop\apps\go\current\src\gitlab.wikimedia.org\repos\releng\cli\.bingo\bingo.tmp.mod -o=bingo-v0.5.1 github.com\bwplotka\bingo'
Error: get command failed
> main.main     C:/Users/jayan/go/pkg/mod/github.com/bwplotka/bingo@v0.7.0/main.go:223
> runtime.main  C:/Users/jayan/scoop/apps/go/current/src/runtime/proc.go:250
> runtime.goexit        C:/Users/jayan/scoop/apps/go/current/src/runtime/asm_amd64.s:1594
get
> main.main.func2       C:/Users/jayan/go/pkg/mod/github.com/bwplotka/bingo@v0.7.0/main.go:147
> main.main.func5       C:/Users/jayan/go/pkg/mod/github.com/bwplotka/bingo@v0.7.0/main.go:215
> github.com/oklog/run.(*Group).Run.func1       C:/Users/jayan/go/pkg/mod/github.com/oklog/run@v1.1.0/group.go:38
> runtime.goexit        C:/Users/jayan/scoop/apps/go/current/src/runtime/asm_amd64.s:1594
0: getting github.com\bwplotka\bingo@v0.5.1
> main.getAll   C:/Users/jayan/go/pkg/mod/github.com/bwplotka/bingo@v0.7.0/get.go:119
> main.get      C:/Users/jayan/go/pkg/mod/github.com/bwplotka/bingo@v0.7.0/get.go:154
> main.main.func2       C:/Users/jayan/go/pkg/mod/github.com/bwplotka/bingo@v0.7.0/main.go:146
> main.main.func5       C:/Users/jayan/go/pkg/mod/github.com/bwplotka/bingo@v0.7.0/main.go:215
> github.com/oklog/run.(*Group).Run.func1       C:/Users/jayan/go/pkg/mod/github.com/oklog/run@v1.1.0/group.go:38
> runtime.goexit        C:/Users/jayan/scoop/apps/go/current/src/runtime/asm_amd64.s:1594
rename mod file: rename C:\Users\jayan\scoop\apps\go\current\src\gitlab.wikimedia.org\repos\releng\cli\.bingo\bingo.tmp.mod C:\Users\jayan\scoop\apps\go\current\src\gitlab.wikimedia.org\repos\releng\cli\.bingo\bingo.mod: The process cannot access the file because it is being used by another process.

Anything else we need to know:

bwplotka commented 1 year ago

Thanks! Interesting. I can try fixing rename for windows. Sounds like there is some window specific, thanks for sharing!