-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Makefile: add a DBG variable #108371
Makefile: add a DBG variable #108371
Conversation
@thockin: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
Something went sideways with the build flags used to stamp in version info:
|
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
/retest |
the error looks like a legitimate issue with the build flags |
33c6020
to
50bd113
Compare
/retest |
Flags errors seem to be fixed. I had mis-understood the go docs before. Better now. |
50bd113
to
230ebf9
Compare
rebased |
Now `make DBG=1` will produce binaries with no optimizaions and no inlining, but with symbols and DWARF information.
This has somewhat subtle implications. For a concrete example, this changes the `-trimpath` behavior from only affecting the named pkg to affecting all pkgs, which broke ginkgo, which seems to try to strip its own `pwd` prefix. But since that runs in run-in-gopath, and not in KUBE_ROOT, it fails to strip anything. e.g. before this, strings in the binary would be like /home/user/kube/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/... Ginkgo would find its own root as /home/user/kube/_output/local/go/src/k8s.io/kubernetes/ so it would produce vendor/github.com/onsi/ginkgo/... in logs. after this, strings in the binary strip the KUBE_ROOT and be like: _output/local/go/src/k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/... Ginkgo would find its own root as /home/user/kube/_output/local/go/src/k8s.io/kubernetes/ so it would not strip anything, and produce _output/local/go/src/k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/... in logs.
230ebf9
to
bf27cad
Compare
I broke the "all=" change to a distinct commit |
/retest |
/lgtm |
With the merging of kubernetes#108371, the old way to build the debug binaries won't work anymore. Signed-off-by: Dave Chen <dave.chen@arm.com>
Now
make DBG=1
will produce binaries with no optimizaions and no inlining, but with symbols and DWARF information.This also sets the various compile flags to use "all=" syntax. Otherwise things like trimpath only apply to the CLI-listed packages and nothing else (which seems egregiously wrong).
Worth noting: this builds tools (like codegens) with debugging too. We could make it more sophisticated if that seems a problem (e.g. a different flag or value)
To discuss: "DBG" vs "KUBE_DBG" vs
make debug
vs .../kind cleanup