burrowers / garble

Obfuscate Go builds
BSD 3-Clause "New" or "Revised" License
3.68k stars 235 forks source link

error on parse github.com/go-openapi #858

Open kakuilan opened 4 weeks ago

kakuilan commented 4 weeks ago

What version of Garble and Go are you using?

$ garble version
mvdan.cc/garble v0.12.1

Build settings:
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1

$ go version
go version go1.22.0 linux/amd64
    github.com/go-openapi/jsonpointer v0.21.0 // indirect
    github.com/go-openapi/jsonreference v0.21.0 // indirect
    github.com/go-openapi/spec v0.21.0 // indirect
    github.com/go-openapi/swag v0.23.0 // indirect

What environment are you running Garble on?

go env Output
$ go env
GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/vagrant/.cache/go-build'
GOENV='/home/vagrant/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/var/www/_go-linux/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/var/www/_go-linux'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,https://goproxy.io,https://proxy.golang.com.cn,direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build130710698=/tmp/go-build -gno-record-gcc-switches'

What did you do?

CGO_ENABLED=1 GOOS=linux GOARCH=amd64 garble -literals -tiny -seed=random build -v -a

What did you expect to see?

build successful

What did you see instead?

github.com/go-openapi/swag
go/version
github.com/prometheus/client_golang/prometheus/internal
github.com/prometheus/common/expfmt
internal/types/errors
github.com/go-openapi/jsonpointer
go/types
github.com/go-openapi/jsonreference
github.com/go-openapi/spec
github.com/prometheus/client_golang/prometheus
# github.com/go-openapi/spec
:3: cannot use struct{GeBWmay []string; TIAIXBK bool}{…} (value of type struct{GeBWmay []string; TIAIXBK bool}) as struct{List []string; Pad bool} value in assignment
exit status 2
jerome-laforge commented 5 days ago

I have the same kind of error:

github.com/go-openapi/spec
# github.com/go-openapi/spec
keucNQGuiSH_.go:3: cannot use struct{D31brC6 []string; JCNB1W0W3 bool}{…} (value of type struct{D31brC6 []string; JCNB1W0W3 bool}) as struct{List []string; Pad bool} value in assignment
D6hjXDPQG.go:3: cannot use struct{D31brC6 []string; JCNB1W0W3 bool}{…} (value of type struct{D31brC6 []string; JCNB1W0W3 bool}) as struct{List []string; Pad bool} value in assignment
exit status 2
go version
go version go1.22.5 linux/amd64
garble version
mvdan.cc/garble v0.12.1

Build settings:
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
jerome-laforge commented 5 days ago

It seems duplicate with #690