Skip to content

OCPBUGS-76319: Strip debugging symbols when releasing oc#2196

Open
tchap wants to merge 2 commits intoopenshift:mainfrom
tchap:strip-debugging-symbols
Open

OCPBUGS-76319: Strip debugging symbols when releasing oc#2196
tchap wants to merge 2 commits intoopenshift:mainfrom
tchap:strip-debugging-symbols

Conversation

@tchap
Copy link
Contributor

@tchap tchap commented Feb 6, 2026

We don't want the debug RPM package, so I am setting -w -s in oc.spec directly.

For other cases, oc is being built using the included Dockerfiles, so I updated those as well.

go build is now passed -trimpath also so that there are no absolute file paths in the executable.

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 6, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-76319, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

Makefile, Dockerfiles, and RPM spec updated to embed expanded linker -X metadata flags and to propagate GO_BUILD_EXTRAFLAGS; container and RPM build steps export GO_LD_EXTRAFLAGS (adding -s -w) and GO_BUILD_EXTRAFLAGS (adding -trimpath) before running make.

Changes

Cohort / File(s) Summary
Makefile build flags & metadata
Makefile
Changed GO_LD_EXTRAFLAGS from := to += and added many -X linker flags to embed git/version/build metadata; updated GO_BUILD_FLAGS and platform variants (GO_BUILD_FLAGS_DARWIN, GO_BUILD_FLAGS_WINDOWS, GO_BUILD_FLAGS_LINUX_CROSS) to append $(GO_BUILD_EXTRAFLAGS).
Container build steps (cli artifacts)
images/cli-artifacts/Dockerfile.rhel
Sets GO_LD_EXTRAFLAGS (adds -s -w) and GO_BUILD_EXTRAFLAGS (adds -trimpath) in RUN steps for both rhel-8 and rhel-9 builder stages, then runs make cross-build.
Container build steps (cli)
images/cli/Dockerfile.rhel
Replaced single RUN with a multi-part RUN that exports GO_BUILD_EXTRAFLAGS (-trimpath) and GO_LD_EXTRAFLAGS (-s -w), runs make build, then gzips oc-tests-ext.
RPM spec build exports
oc.spec
Adds export GO_LD_EXTRAFLAGS="${GO_LD_EXTRAFLAGS} -s -w" and export GO_BUILD_EXTRAFLAGS="${GO_BUILD_EXTRAFLAGS} -trimpath" before invoking %{make} build for the RPM build step.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@tchap
Copy link
Contributor Author

tchap commented Feb 6, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 6, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-76319, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-76319, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

I still need to verify what all needs to be done for this, starting with RPM for now.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tchap
Once this PR has been reviewed and has the lgtm label, please assign ardaguclu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@tchap
Copy link
Contributor Author

tchap commented Feb 6, 2026

/retitle OCPBUGS-76319: Strip debugging symbols when releasing oc

@openshift-ci openshift-ci bot changed the title WIP: OCPBUGS-76319: Strip debugging symbols when releasing oc OCPBUGS-76319: Strip debugging symbols when releasing oc Feb 6, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 6, 2026
@tchap tchap force-pushed the strip-debugging-symbols branch 2 times, most recently from 475c692 to a045eef Compare February 6, 2026 15:49
@tchap tchap force-pushed the strip-debugging-symbols branch from a045eef to 97ed65d Compare February 6, 2026 15:50
@tchap tchap force-pushed the strip-debugging-symbols branch from 97ed65d to 70c4537 Compare February 6, 2026 15:52
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-76319, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

We don't want the debug RPM package, so I am setting -w -s in oc.spec directly.

For other cases, oc is being built using the included Dockerfiles, so I updated those as well.

go build is now passed -trimpath also so that there are no absolute file paths in the executable.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 6, 2026

@tchap: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-upgrade 70c4537 link true /test e2e-aws-ovn-upgrade
ci/prow/e2e-agnostic-ovn-cmd 70c4537 link true /test e2e-agnostic-ovn-cmd

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

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

Labels

jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants