burrowers / garble

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

x/sys/unix no longer builds with garble v0.12.0 #830

Closed iwanlebron closed 7 months ago

iwanlebron commented 7 months ago

What version of Garble and Go are you using?

$ garble version

mvdan.cc/garble v0.12.0

Build settings:
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH arm64
            GOOS darwin

$ go version

go version go1.22.0 darwin/arm64

What environment are you running Garble on?

go env Output
$ go env

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/zhangguoqing/Library/Caches/go-build'
GOENV='/Users/zhangguoqing/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/zhangguoqing/go/pkg/mod'
GONOPROXY='*'
GONOSUMDB='*'
GOOS='darwin'
GOPATH='/Users/zhangguoqing/go'
GOPRIVATE='*'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/zhangguoqing/.go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/zhangguoqing/.go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/zhangguoqing/jycode/v1.3/jy-aiot/go.mod'
GOWORK='/Users/zhangguoqing/jycode/v1.3/jy-aiot/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/ps/v8z4kyh16cq6tnf3sy8f16100000gn/T/go-build298853328=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

garble build -o jy-aiot main.go

What did you expect to see?

success

What did you see instead?

image
loc-tran-asml commented 7 months ago

Experiencing the same issue after updating to v0.12.0. (Running go 1.21.0) image

huzpsb commented 7 months ago

+1 So did I

D:\desktop\xxxx-x.xx.x.x>garble -tiny build -o build/gaged -v xxxx.go
golang.org/x/sys/unix
# golang.org/x/sys/unix
:1: cannot convert es6CVFLPfaR (variable of type *GAZWrN4_onan) to type *"syscall".Rlimit
:1: cannot convert rGeoNgaw5 (variable of type *GAZWrN4_onan) to type *"syscall".Rlimit
:1: cannot convert luumoXAWL (variable of type *GAZWrN4_onan) to type *"syscall".Rlimit
exit status 2
exit status 1
mvdan commented 7 months ago

Thanks all, this is probably related to https://github.com/burrowers/garble/commit/55921a06d44a92aced8d0c77f1dde24c7f66580d no longer obfuscating the syscall package to fix MacOS.

Please leave a thumbs up reaction to the original post if you also run into the same error. There's no need to leave more comments unless they add new information.

lu4p commented 7 months ago

I suspect this is related to #799

FuckingToasters commented 7 months ago

tried downgrading to v.0.11.0, sadly same issue

mvdan commented 7 months ago

https://github.com/burrowers/garble/pull/834 should be the fix. Once merged, I'll backport and do a v0.12.1 release.

FuckingToasters commented 7 months ago

Just downloaded it with @master tag, sadly the issue keep being the same for me....

mvdan commented 7 months ago

Are you positive?

$ go list .
golang.org/x/sys/unix
$ git rev-parse HEAD
360f961f8978a4c9a7c2e849bb482780cd6bb553
$ go version
go version go1.22.0 linux/amd64
$ go install mvdan.cc/garble@66b61406c12990b7a02c906388027b8ea6c26b4a
go: downloading mvdan.cc/garble v0.12.1-0.20240218112843-66b61406c129
$ garble version
mvdan.cc/garble v0.12.1-0.20240218112843-66b61406c129

Build settings:
      -buildmode exe
       -compiler gc
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
$ garble build
$ echo $?
0

Note that @master is cached by proxy.golang.org by up to half an hour, and I literally just pushed the fix, which is why I'm installing a specific commit there.

FuckingToasters commented 7 months ago

Are you positive?

$ go list .
golang.org/x/sys/unix
$ git rev-parse HEAD
360f961f8978a4c9a7c2e849bb482780cd6bb553
$ go version
go version go1.22.0 linux/amd64
$ go install mvdan.cc/garble@66b61406c12990b7a02c906388027b8ea6c26b4a
go: downloading mvdan.cc/garble v0.12.1-0.20240218112843-66b61406c129
$ garble version
mvdan.cc/garble v0.12.1-0.20240218112843-66b61406c129

Build settings:
      -buildmode exe
       -compiler gc
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
$ garble build
$ echo $?
0

Note that @master is cached by proxy.golang.org by up to half an hour, and I literally just pushed the fix, which is why I'm installing a specific commit there.

I'm new to golang xd, i did not knew that my bad. Thank you for the information though.

installing via go install mvdan.cc/garble@66b61406c12990b7a02c906388027b8ea6c26b4a worked as expected.

mvdan commented 7 months ago

No worries, the proxy can be confusing at times :)

iwanlebron commented 7 months ago

how should this be resolved

github.com/influxdata/influxdb-client-go/v2/domain

WAOK8jpS3Iv.go:3: cannot use huMsQvM (variable of type struct{Stacks []Stack "json:\"stacks,omitempty\""}) as struct{Zxk46VJ []Stack "json:\"stacks,omitempty\""} value in return statement exit status 2 exit status 1