garble: Error when adding hardware inspection library to existing project using garble

Hi All,

Very new to garble and the docs are very sparse, so I thought I would open an issue to see if someone could help. I am currently adding hardware info collection to a tool called ToRat

For some reason, garble is scrambling the calls being made to ghw. For example, the error below should be calling cpu.Processors. How would I go about preventing garble from changing these calls?

Here is the branch I’m working from: https://github.com/JustinTimperio/ToRat/tree/feature-hw-collector The module I’m adding: https://github.com/jaypipes/ghw The error I get is:

Step 17/21 : RUN cd ./cmd/client && garble -literals -tiny -seed=random build -ldflags="-extldflags=-static" -tags "osusergo,netgo,tor" -o /dist/client/client_linux && upx /dist/client/client_linux
 ---> Running in ccc44745863e
# github.com/ghodss/yaml
parsing archive member "_go_.o": error resolving path of objfile gopkg.in/yaml%2ev2: exit status 1
# github.com/lu4p/ToRat/torat_client
:28: cpu.ZvD5G undefined (type *"github.com/jaypipes/ghw/pkg/cpu".ZGVzt has no field or method ZvD5G)
:44: cpu.ZFUUP undefined (type *"github.com/jaypipes/ghw/pkg/cpu".ZGVzt has no field or method ZFUUP)
unexpected EOF
exit status 2
exit status 2
The command '/bin/sh -c cd ./cmd/client && garble -literals -tiny -seed=random build -ldflags="-extldflags=-static" -tags "osusergo,netgo,tor" -o /dist/client/client_linux && upx /dist/client/client_linux' returned a non-zero code: 1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@lu4p The docker image is pulling from this commit. I will change this to pull from master go get mvdan.cc/garble and report back on it.