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

can't handle github.com/gogo/protobuf/proto #786

Closed
ezequiel-aguilera-uala opened this issue Aug 13, 2023 · 6 comments
Closed

can't handle github.com/gogo/protobuf/proto #786

ezequiel-aguilera-uala opened this issue Aug 13, 2023 · 6 comments

Comments

@ezequiel-aguilera-uala
Copy link

ezequiel-aguilera-uala commented Aug 13, 2023

This was build with error + this template + chatGPT (i validate the data)

What version of Garble and Go are you using?

$ garble version
mvdan.cc/garble v0.10.1

$ go version
go version go1.20.3 darwin/arm64

What environment are you running Garble on?

go env Output
$ go env
# Secret! Its my work laptop.

What did you do?

  1. Ran the command: garble -literals -tiny -seed=random build
  2. Encountered the following error:

-seed chosen at random: nrdlvv8MxZNzy9Tp1TXGvA

github.com/gogo/protobuf/proto
:1: cannot use new(struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) (value of type *struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) as *struct{mu sync.BEz3NBaS9; extensionMap map[int32]Extension} value in assignment
:1: cannot use new(struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) (value of type *struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) as *struct{mu sync.BEz3NBaS9; extensionMap map[int32]Extension} value in struct literal
exit status 2
exit status 1

What did you expect to see?

Expected output: The application should be successfully garbled without any errors.

What did you see instead?

Actual output: I encountered the following error message while trying to build the application using Garble:

garble -literals -tiny -seed=random build

-seed chosen at random: nrdlvv8MxZNzy9Tp1TXGvA

github.com/gogo/protobuf/proto

:1: cannot use new(struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) (value of type *struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) as *struct{mu sync.BEz3NBaS9; extensionMap map[int32]Extension} value in assignment
:1: cannot use new(struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) (value of type *struct{aBzYs1 sync.BEz3NBaS9; pe7Ndk3aUL map[int32]Extension}) as *struct{mu sync.BEz3NBaS9; extensionMap map[int32]Extension} value in struct literal
exit status 2
exit status 1

@ezequiel-aguilera-uala
Copy link
Author

ezequiel-aguilera-uala commented Aug 13, 2023

Ugly workaround I use:
With multicursor of the IDE select all the dependencies in go.mod, remove protobuf, separate its with comma and pass it to GOGARBLE

@mvdan
Copy link
Member

mvdan commented Aug 13, 2023

Duplicate of #685, and already fixed in master :)

@mvdan mvdan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 13, 2023
@ezequielaguilera1993
Copy link

ezequielaguilera1993 commented Aug 16, 2023

But i use the last release, and still gives me this error.

-seed chosen at random: wyzORNblCdnSCwddTpkr9A
# github.com/gogo/protobuf/proto
:1: cannot use new(struct{ztgbXKnHoY sync.HGos9v; r6rvy5HexfsY map[int32]Extension}) (value of type *struct{ztgbXKnHoY sync.HGos9v; r6rvy5HexfsY map[int32]Extension}) as *struct{mu sync.HGos9v; extensionMap map[int32]Extension} value in assignment
:1: cannot use new(struct{ztgbXKnHoY sync.HGos9v; r6rvy5HexfsY map[int32]Extension}) (value of type *struct{ztgbXKnHoY sync.HGos9v; r6rvy5HexfsY map[int32]Extension}) as *struct{mu sync.HGos9v; extensionMap map[int32]Extension} value in struct literal
exit status 2
exit status 1

@ezequielaguilera1993
Copy link

mvdan.cc/garble v0.10.1

Build settings:
      -buildmode exe
       -compiler gc
     CGO_ENABLED 1
          GOARCH arm64
            GOOS darwin

@ezequielaguilera1993
Copy link

Missed tag maybe? (i see a lot of differente between last release and master)
https://github.com/burrowers/garble/compare/v0.10.1..master

@lu4p
Copy link
Member

lu4p commented Aug 16, 2023

go install mvdan.cc/garble@master

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

No branches or pull requests

4 participants