cue-unity / unity

unity - run experiments/regression tests on CUE modules
Apache License 2.0
41 stars 5 forks source link

cmd/unity: Invalid /tmp path: No such file or directory #60

Open verdverm opened 3 years ago

verdverm commented 3 years ago

I ran unity in the example, worked the first time, changed example to 6 (so it would fail), used the --staged flag, saw failures, unable to get past this error now, even after reverting to a clean directory. The /tmp/... dir does not exist.

tony at penguin in ~/cue/unity-example on main
$ unity test --verbose
testing github.com/cue-sh/unity-example against version go.mod (v0.3.0-beta.5.0.20210217105737-430c3ddf5331)
testing github.com/cue-sh/unity-example against version v0.3.0-beta.5
failed to create copy of current HEAD from /home/tony/cue/unity-example: git worktree add --detach /tmp/unity-module-tester176689020/workdir516550158/script-eval/repo: exit status 128
fatal: Invalid path '/tmp/unity-module-tester299708912': No such file or directory
Preparing worktree (detached HEAD 941a56a)

failed to create copy of current HEAD from /home/tony/cue/unity-example: git worktree add --detach /tmp/unity-module-tester176689020/workdir270941808/script-eval/repo: exit status 128
fatal: Invalid path '/tmp/unity-module-tester299708912': No such file or directory
Preparing worktree (detached HEAD 941a56a)

FAIL  github.com/cue-sh/unity-example  go.mod (v0.3.0-beta.5.0.20210217105737-430c3ddf5331)  0.000s                                                               
FAIL  github.com/cue-sh/unity-example  v0.3.0-beta.5                                         0.000s  +NaN%  go.mod (v0.3.0-beta.5.0.20210217105737-430c3ddf5331) 
myitcv commented 3 years ago

Hard to say what's going on here without a few more details, because the code would seem to suggest the target of the git worktree add is created on the line before:

https://github.com/cue-sh/unity/blob/eb25346d70261e1cf94f9500496c9a809b3b8945/cmd/unity/cmd/project.go#L511

Please can you provide:

verdverm commented 3 years ago

Recloning the example has made this go away. Not sure how I got into this state... unable.to reproduce at current

myitcv commented 3 years ago

Will close for now then.

verdverm commented 3 years ago

For reference:

$ go version
go version go1.16 linux/amd64

$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tony/.cache/go-build"
GOENV="/home/tony/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/tony/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/tony/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/tony/cue/unity-example/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3512732473=/tmp/go-build -gno-record-gcc-switches"
verdverm commented 3 years ago

got back into this state again, let me see if I can find a consistent method for doing so

verdverm commented 3 years ago

Basic process

myitcv commented 3 years ago

Please do reopen this if you can repro consistently with steps that I can use locally. Thanks

verdverm commented 3 years ago

As a new issue? I am unable to reopen this one

myitcv commented 3 years ago

Just re-opened this one.

verdverm commented 3 years ago

The above bullet list is approximate. It seems flakey in how (when) it gets there. I was able to do it 3 times in a row.

myitcv commented 3 years ago

Please can you provide the steps as a copy-paste? Should be relatively straightforward to copy-paste from your command history.

verdverm commented 3 years ago

You have to edit the test file to get this to work I think, adding an exec line

myitcv commented 3 years ago

Which you can simulate with:

cat <<EOD > path/to/file.txt
new contents
EOD