Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
iwanlebron opened this issue Feb 10, 2024 · 11 comments · Fixed by #834
Closed

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

iwanlebron opened this issue Feb 10, 2024 · 11 comments · Fixed by #834
Assignees

Comments

@iwanlebron
Copy link

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
Copy link

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

@huzpsb
Copy link

huzpsb commented Feb 12, 2024

+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
Copy link
Member

mvdan commented Feb 12, 2024

Thanks all, this is probably related to 55921a0 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.

@mvdan mvdan changed the title garble build failed x/sys/unix no longer builds with garble v0.12.0 Feb 12, 2024
@mvdan mvdan self-assigned this Feb 12, 2024
@lu4p
Copy link
Member

lu4p commented Feb 13, 2024

I suspect this is related to #799

@FuckingToasters
Copy link

tried downgrading to v.0.11.0, sadly same issue

mvdan added a commit to mvdan/garble-fork that referenced this issue Feb 18, 2024
When updating Garble to support Go 1.22.0, CI on MacOS spotted
that the syscall package was failing to build given that it uses
assembly code which is only allowed in some std packages.

That allowlist is based on import paths, and we were obfuscating
the syscall package's import path, so that was breaking GOOS=darwin.
As a fix, I added syscall to runtimeAndDeps to not obfuscate it.

That wasn't a great fix; it's not part of runtime and its dependencies,
and there's no reason we should avoid obfuscating the package contents.
Not obfuscating the contents in fact broke x/sys/unix,
as it contains a copy of syscall.Rlimit which it type converted with.

Undo that fix and reinstate the gogarble.txtar syscall test.
Implement the fix where we only leave syscall's import path alone.
Add a regression test, and add a note about adding x/net and x/sys
to check-third-party.sh so that we can catch these bugs earlier.

Fixes burrowers#830.
@mvdan
Copy link
Member

mvdan commented Feb 18, 2024

#834 should be the fix. Once merged, I'll backport and do a v0.12.1 release.

mvdan added a commit to mvdan/garble-fork that referenced this issue Feb 18, 2024
When updating Garble to support Go 1.22.0, CI on MacOS spotted
that the syscall package was failing to build given that it uses
assembly code which is only allowed in some std packages.

That allowlist is based on import paths, and we were obfuscating
the syscall package's import path, so that was breaking GOOS=darwin.
As a fix, I added syscall to runtimeAndDeps to not obfuscate it.

That wasn't a great fix; it's not part of runtime and its dependencies,
and there's no reason we should avoid obfuscating the package contents.
Not obfuscating the contents in fact broke x/sys/unix,
as it contains a copy of syscall.Rlimit which it type converted with.

Undo that fix and reinstate the gogarble.txtar syscall test.
Implement the fix where we only leave syscall's import path alone.
Add a regression test, and add a note about adding x/net and x/sys
to check-third-party.sh so that we can catch these bugs earlier.

Fixes burrowers#830.
pagran pushed a commit that referenced this issue Feb 18, 2024
When updating Garble to support Go 1.22.0, CI on MacOS spotted
that the syscall package was failing to build given that it uses
assembly code which is only allowed in some std packages.

That allowlist is based on import paths, and we were obfuscating
the syscall package's import path, so that was breaking GOOS=darwin.
As a fix, I added syscall to runtimeAndDeps to not obfuscate it.

That wasn't a great fix; it's not part of runtime and its dependencies,
and there's no reason we should avoid obfuscating the package contents.
Not obfuscating the contents in fact broke x/sys/unix,
as it contains a copy of syscall.Rlimit which it type converted with.

Undo that fix and reinstate the gogarble.txtar syscall test.
Implement the fix where we only leave syscall's import path alone.
Add a regression test, and add a note about adding x/net and x/sys
to check-third-party.sh so that we can catch these bugs earlier.

Fixes #830.
mvdan added a commit that referenced this issue Feb 18, 2024
When updating Garble to support Go 1.22.0, CI on MacOS spotted
that the syscall package was failing to build given that it uses
assembly code which is only allowed in some std packages.

That allowlist is based on import paths, and we were obfuscating
the syscall package's import path, so that was breaking GOOS=darwin.
As a fix, I added syscall to runtimeAndDeps to not obfuscate it.

That wasn't a great fix; it's not part of runtime and its dependencies,
and there's no reason we should avoid obfuscating the package contents.
Not obfuscating the contents in fact broke x/sys/unix,
as it contains a copy of syscall.Rlimit which it type converted with.

Undo that fix and reinstate the gogarble.txtar syscall test.
Implement the fix where we only leave syscall's import path alone.
Add a regression test, and add a note about adding x/net and x/sys
to check-third-party.sh so that we can catch these bugs earlier.

Fixes #830.
@FuckingToasters
Copy link

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

@mvdan
Copy link
Member

mvdan commented Feb 18, 2024

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
Copy link

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
Copy link
Member

mvdan commented Feb 18, 2024

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

@iwanlebron
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants