`cmd/vet`, `cmd/compile`: 失败,不是Go对象文件

bqucvtff  于 9个月前  发布在  Go
关注(0)|答案(5)|浏览(144)
  1. #!watchflakes
  2. post <- log ~ `could not import .* \(not a [Gg]o object file`

自动创建的问题以收集这些故障。
示例( log ):

  1. ../../../../pkg/mod/github.com/go-pdf/fpdf@v0.6.0/svgbasic.go:20:2: could not import encoding/xml (not a go object file: )<arch>
  2. )

watchflakes

nwsw7zdq

nwsw7zdq1#

找到新的 Jmeter 板测试碎片:

  1. #!watchflakes
  2. default <- pkg == "github.com/go-pdf/fpdf" && test == ""

2023-10-06 13:45 linux-ppc64le-buildlet perf@cd219cff go@e73e25b6 github.com/go-pdf/fpdf [构建] ( log )

  1. ../../../../pkg/mod/github.com/go-pdf/fpdf@v0.6.0/svgbasic.go:20:2: could not import encoding/xml (not a go object file: )<arch>
  2. )

watchflakes

jqjz2hbq

jqjz2hbq2#

在三段论中,我们认为这看起来有点像文件损坏?我们认为构建者可能没有空间了,或者一个不完整的文件被写入或者其他东西。

sxissh06

sxissh063#

找到了新的 Jmeter 板测试碎片:

  1. #!watchflakes
  2. post <- log ~ `could not import .* \(not a [Gg]o object file`

2023-11-16 22:18 linux-ppc64-sid-buildlet pkgsite@ee1eba0d go@82fc03f9 x/pkgsite/internal/log/stackdriverlogger [build] ( log )

  1. internal/log/stackdriverlogger/log.go:20:2: could not import golang.org/x/pkgsite/internal/experiment (not a go object file: )<arch>
  2. )
  • 2023-11-16 22:18 linux-ppc64-sid-buildlet pkgsite@ee1eba0d go@82fc03f9 x/pkgsite/internal/frontend/page [build] ( log )
  1. internal/frontend/page/page.go:11:2: could not import golang.org/x/pkgsite/internal/experiment (not a go object file: )<arch>
  2. )
  • 2023-11-16 22:18 linux-ppc64-sid-buildlet pkgsite@ee1eba0d go@82fc03f9 x/pkgsite/internal/queue [build] ( log )
  1. internal/queue/queue.go:15:2: could not import golang.org/x/pkgsite/internal/experiment (not a go object file: )<arch>
  2. )

watchflakes

展开查看全部
cbeh67ev

cbeh67ev4#

我正在我的fedora 39机器上看到这个问题,当我尝试安装gopls时:

  1. dcaro@urcuchillay$ go env
  2. GO111MODULE=""
  3. GOARCH="amd64"
  4. GOBIN=""
  5. GOCACHE="/home/dcaro/.cache/go-build"
  6. GOENV="/home/dcaro/.config/go/env"
  7. GOEXE=""
  8. GOEXPERIMENT=""
  9. GOFLAGS=""
  10. GOHOSTARCH="amd64"
  11. GOHOSTOS="linux"
  12. GOINSECURE=""
  13. GOMODCACHE="/home/dcaro/Work/gows/pkg/mod"
  14. GONOPROXY=""
  15. GONOSUMDB=""
  16. GOOS="linux"
  17. GOPATH="/home/dcaro/Work/gows"
  18. GOPRIVATE=""
  19. GOPROXY="direct"
  20. GOROOT="/usr/lib/golang"
  21. GOSUMDB="off"
  22. GOTMPDIR=""
  23. GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
  24. GOVCS=""
  25. GOVERSION="go1.20.11"
  26. GCCGO="gccgo"
  27. GOAMD64="v1"
  28. AR="ar"
  29. CC="gcc"
  30. CXX="g++"
  31. CGO_ENABLED="1"
  32. GOMOD="/dev/null"
  33. GOWORK=""
  34. CGO_CFLAGS="-O2 -g"
  35. CGO_CPPFLAGS=""
  36. CGO_CXXFLAGS="-O2 -g"
  37. CGO_FFLAGS="-O2 -g"
  38. CGO_LDFLAGS="-O2 -g"
  39. PKG_CONFIG="pkg-config"
  40. GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2071659687=/tmp/go-build -gno-record-gcc-switches"
  1. dcaro@urcuchillay$ go install golang.org/x/tools/gopls@latest 2> out
  2. # the file is quite big, attached
  3. dcaro@urcuchillay$ head -c 1000 out
  4. # internal/reflectlite
  5. /usr/lib/golang/src/internal/reflectlite/value.go:10:2: could not import runtime (not a go object file:

out.zip

展开查看全部
roqulrg3

roqulrg35#

手动清除缓存($GOPATH/pkg/mod/cache/vcs/*$GOPATH/pkg/mod/cache/download/*)并重试对我有效。

相关问题