Closed theaog closed 1 year ago
Thanks for the report. This is the cause:
Welp, I guess we can't obfuscate types inside the reflect package after all. I'll have to revert that bit. FYI @lu4p
you're welcome, any workaround comes to mind?
Revert to a slightly older garble release. We'll have a fix soon, but not right away.
same result w/ v0.8.0, how old should I go?
go install mvdan.cc/garble@v0.7.2
will panic w/o completing the build
# runtime
panic: runtime listed a std package we can't find: arena
goroutine 1 [running]:
main.listPackage({0xc0002e035d, 0x5})
/usr/local/root/go/pkg/mod/mvdan.cc/garble@v0.7.2/shared.go:389 +0x6f9
main.(*transformer).handleDirectives(0x12e13e6?, {0xc0002a5400, 0x69, 0x25fe?})
/usr/local/root/go/pkg/mod/mvdan.cc/garble@v0.7.2/main.go:952 +0x305
main.transformCompile({0xc0000b4030?, 0x1d3b?, 0xc000111e58?})
/usr/local/root/go/pkg/mod/mvdan.cc/garble@v0.7.2/main.go:839 +0x745
main.mainErr({0xc0000b4010, 0xa2, 0xa7})
/usr/local/root/go/pkg/mod/mvdan.cc/garble@v0.7.2/main.go:424 +0x7cd
main.main1()
/usr/local/root/go/pkg/mod/mvdan.cc/garble@v0.7.2/main.go:228 +0x16e
main.main()
/usr/local/root/go/pkg/mod/mvdan.cc/garble@v0.7.2/main.go:135 +0x19
exit status 1
shall I downgrade to go 1.19?
The regression is https://github.com/burrowers/garble/commit/2ee9cf7a43b50d4ed97112e9c6cd3ae2a22f6ef8 I'm pretty sure, so v0.9.1 should work with either Go 1.19 or 1.20, I think.
weird as I still get the same result w/ mvdan.cc/garble v0.9.1
even w/ v0.8.0
panic: reflect.Value has no flag field
goroutine 1 [running]:
sIsD_BqV1_w.glob..func1()
DoOA8ljZ.go:1 +0x165
sIsD_BqV1_w.init()
DoOA8ljZ.go:4 +0x1d
if I use go1.19.4 w/ garble v0.9.1, then I get a different issue
# github.com/golang/protobuf/proto
BnrvHi1G.go:2: unknown field 'YU06vztEX1' in struct literal of type DBY547b.CKFyRc9
exit status 2
exit status 2
Then perhaps we've been broken with that package for a while. I'll try to have a fix by tomorrow.
to get a workable build I had to revert to go19 w/ garble 0.7
The fix is in master, if you want to give that a try.
thank you @mvdan
works like a charm!
the issue is back :/
./program
panic: reflect.Value read-only flag has changed semantics
goroutine 1 [running]:
xdXmgWO.init.0()
mgFK8DGAHh.go:1 +0x5b5
go version go1.20.5 linux/amd64 mvdan.cc/garble v0.10.0
Build settings: -buildmode exe -compiler gc CGO_ENABLED 1 GOARCH amd64 GOOS linux GOAMD64 v1
@mvdan what do you suggest to try?
compiled using:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 garble build -trimpath
@theaog can you try to isolate which commit reintroduced the issue?
go install mvdan.cc/garble@commit_hash
Bisected to 0f2b59d79404f5be6725c24170fa2fad94e2b7fb, so it looks like it's my fault :)
going a commit before 0f2b
won't compile.
go install mvdan.cc/garble@7d1bd13778a9ceafe17bd13615beee9d769094af
mvdan.cc/garble v0.9.4-0.20230530172756-7d1bd13778a9
build...
# os
//go:linkname refers to net.newUnixFile - add `import _ "net"` for garble to find the package
# program/program
bfTscLd.(*vhcbOL).uTiJS3pqYbRb: relocation target bfTscLd.fQcsIjgz8oFM not defined
exit status 2
exit status 1
hi guys, could I get any help on this please? which go version / garble version could I use to have a working bin?
I guess reverting to the commit where it got fixed should work or some commit after that.
We will fix this, but we're doing this in our free time so it might get fixed fast or take a while. Consider sponsoring us if you need a fix urgently.
Closing in favor of #765
What version of Garble and Go are you using?
What environment are you running Garble on?
MacOS 12.2.1 (21D62)
What did you do?
GOOS=linux GOARCH=amd64 garble build
What did you expect to see?
working program
What did you see instead?