Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Remove debug info from final binary #1330

Merged

Conversation

filariow
Copy link
Contributor

Changes

Use -ldflags="-s -w" and -trimpath in go build to strip debug tables and system paths from final binary.

From https://pkg.go.dev/cmd/link:

  • -s: Omit the symbol table and debug information
  • -w: Omit the DWARF symbol table.

From https://pkg.go.dev/cmd/go:

  • trimpath: remove all file system paths from the resulting executable. Instead of absolute file system paths, the recorded file names will begin either a module path@version (when using modules), or a plain import path (when using the standard library, or GOPATH).

/kind enhancement

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs
    included if any changes are user facing
  • Tests
    included if any functionality added or changed. For bugfixes please include tests that can catch regressions
  • All acceptance test scenarios included in the PR which verifies a bugfix or a requested feature reported by a non-member are tagged with @external-feedback tag.
  • Follows the commit message standard

@filariow filariow requested a review from pmacik December 21, 2022 08:41
@openshift-ci openshift-ci bot added the kind/enhancement New feature or request label Dec 21, 2022
Copy link
Contributor

@sadlerap sadlerap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Please rebase.

@baijum
Copy link
Member

baijum commented Dec 22, 2022

/lgtm

@filariow
Copy link
Contributor Author

/retest

3 similar comments
@filariow
Copy link
Contributor Author

/retest

@filariow
Copy link
Contributor Author

/retest

@filariow
Copy link
Contributor Author

/retest

Copy link
Contributor

@sadlerap sadlerap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 22, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sadlerap

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sadlerap
Copy link
Contributor

I think something might be wrong with 4.9-acceptance tests, though I'm not entirely certain what.

@filariow
Copy link
Contributor Author

/retest

@sadlerap
Copy link
Contributor

Looks like OLM is failing in its install with this message:

failed to populate resolver cache from source operatorhubio-catalog/olm:
failed to list bundles: rpc error: code = Unavailable desc = connection error:
desc = "transport: Error while dialing dial tcp 10.111.60.131:50051: connect:
connection refused"

Signed-off-by: Francesco Ilario <[email protected]>
@baijum
Copy link
Member

baijum commented Dec 24, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Dec 24, 2022
@openshift-merge-robot openshift-merge-robot merged commit 9f7f791 into redhat-developer:master Dec 24, 2022
@filariow filariow deleted the build-strip-debug branch January 3, 2023 08:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants