Skip to content

OCPBUGS-87198: Fix windows builds of oc rpm#2281

Open
joepvd wants to merge 1 commit into
openshift:mainfrom
joepvd:fix-windows-builds
Open

OCPBUGS-87198: Fix windows builds of oc rpm#2281
joepvd wants to merge 1 commit into
openshift:mainfrom
joepvd:fix-windows-builds

Conversation

@joepvd
Copy link
Copy Markdown

@joepvd joepvd commented Jun 5, 2026

Hitting this error since bumping the build root from go1.25 to go1.26:

$WORK/b001/_pkg_.a(oc.syso): 2496931: unknown relocation type 7

while compiling windows binaries in brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=70980110

golang/go#77783 suggests to pass the -64 option to the invocation.

Summary by CodeRabbit

  • Chores
    • Updated Windows version information generation for 64-bit builds to ensure proper version metadata is embedded in compiled binaries.

Hitting this error:
```
$WORK/b001/_pkg_.a(oc.syso): 2496931: unknown relocation type 7
```
while compiling windows binaries in brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=70980110

golang/go#77783 suggests to pass the `-64`
option to the invocation.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 5, 2026

Walkthrough

The PR updates the Windows build script to add the -64 flag to the goversioninfo command, ensuring 64-bit version-info metadata is properly generated for the Windows .syso file used in the oc command binary.

Changes

Windows Build Version Info

Layer / File(s) Summary
Windows 64-bit version-info generation
hack/generate-versioninfo.sh
goversioninfo invocation updated to include -64 flag when generating Windows .syso file for oc command.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning Multiple new Ginkgo e2e tests pull from external registries without proper disconnection checks: Test 49859 imports from registry.redhat.io; test 49116 uses quay.io image without skipIfDisconnected. Add skipIfDisconnected(oc) calls to tests 49859 and 49116, or add [Skipped:Disconnected] tag. Other external registry tests (336, 408-410, 462, 471, 493, 734, 808, 825, 1085) should also be audited.
✅ Passed checks (14 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies only hack/generate-versioninfo.sh (a shell script), containing no Ginkgo tests. Custom check for test naming is not applicable.
Test Structure And Quality ✅ Passed PR contains no Ginkgo tests; only standard Go unit tests and a shell script. Custom check for Ginkgo test quality is not applicable to this PR.
Microshift Test Compatibility ✅ Passed PR modifies hack/generate-versioninfo.sh (build script), not Ginkgo e2e tests. Custom check for MicroShift test compatibility is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies hack/generate-versioninfo.sh (a Windows build script), not e2e tests. No Ginkgo tests added, so SNO compatibility check does not apply.
Topology-Aware Scheduling Compatibility ✅ Passed PR only modifies hack/generate-versioninfo.sh (Windows build script). No deployment manifests, operator code, controllers, or scheduling constraints involved. Check not applicable.
Ote Binary Stdout Contract ✅ Passed PR modifies build script for Windows metadata, not the OTE binary's stdout contract. Check is inapplicable to this change.
No-Weak-Crypto ✅ Passed PR modifies hack/generate-versioninfo.sh to add -64 flag for Windows builds. No weak crypto (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB) or insecure implementations were introduced.
Container-Privileges ✅ Passed PR modifies only hack/generate-versioninfo.sh (a shell build script), not container/Kubernetes manifests; no privileged settings, host access, or capability escalations are present.
No-Sensitive-Data-In-Logs ✅ Passed No logging statements or sensitive data exposure in the PR. The change only adds a compiler flag (-64) to goversioninfo; file contains no echo, printf, or log statements.
Title check ✅ Passed The title references fixing Windows builds of the oc rpm, which directly aligns with the changeset that adds the -64 flag to the goversioninfo invocation to fix Windows build failures.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@joepvd joepvd changed the title Fix windows builds of oc rpm NO-JIRA: Fix windows builds of oc rpm Jun 5, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 5, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@joepvd: This pull request explicitly references no jira issue.

Details

In response to this:

Hitting this error:

$WORK/b001/_pkg_.a(oc.syso): 2496931: unknown relocation type 7

while compiling windows binaries in brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=70980110

golang/go#77783 suggests to pass the -64 option to the invocation.

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 requested review from ardaguclu and tchap June 5, 2026 10:51
@ardaguclu
Copy link
Copy Markdown
Member

@joepvd This issue exists from the beginning or a regression due to a change?

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@hack/generate-versioninfo.sh`:
- Line 58: The goversioninfo invocation leaves ${OS_ROOT} and
${windows_versioninfo_file} unquoted which can break builds when paths contain
spaces or glob chars; update the call to quote both arguments passed to
goversioninfo (the output path and the input versioninfo file) so that the
command uses "${OS_ROOT}/cmd/oc/oc.syso" and "${windows_versioninfo_file}" when
invoking goversioninfo to prevent shell word-splitting and globbing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: d680d2c7-c6c0-4a72-9229-0296a4b9531c

📥 Commits

Reviewing files that changed from the base of the PR and between 9557cf3 and ab95216.

📒 Files selected for processing (1)
  • hack/generate-versioninfo.sh

}
EOF
goversioninfo -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
goversioninfo -64 -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Quote goversioninfo arguments to avoid shell word-splitting.

Line 58 leaves ${OS_ROOT} and ${windows_versioninfo_file} unquoted; this can break the build if either contains spaces or glob characters.

Suggested patch
-  goversioninfo -64 -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
+  goversioninfo -64 -o "${OS_ROOT}/cmd/oc/oc.syso" "${windows_versioninfo_file}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
goversioninfo -64 -o ${OS_ROOT}/cmd/oc/oc.syso ${windows_versioninfo_file}
goversioninfo -64 -o "${OS_ROOT}/cmd/oc/oc.syso" "${windows_versioninfo_file}"
🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 58-58: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 58-58: Double quote to prevent globbing and word splitting.

(SC2086)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/generate-versioninfo.sh` at line 58, The goversioninfo invocation leaves
${OS_ROOT} and ${windows_versioninfo_file} unquoted which can break builds when
paths contain spaces or glob chars; update the call to quote both arguments
passed to goversioninfo (the output path and the input versioninfo file) so that
the command uses "${OS_ROOT}/cmd/oc/oc.syso" and "${windows_versioninfo_file}"
when invoking goversioninfo to prevent shell word-splitting and globbing.

@joepvd joepvd changed the title NO-JIRA: Fix windows builds of oc rpm OCPBUGS-87198: Fix windows builds of oc rpm Jun 5, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jun 5, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@joepvd: This pull request references Jira Issue OCPBUGS-87198, 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 (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, 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:

Hitting this error:

$WORK/b001/_pkg_.a(oc.syso): 2496931: unknown relocation type 7

while compiling windows binaries in brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=70980110

golang/go#77783 suggests to pass the -64 option to the invocation.

Summary by CodeRabbit

  • Chores
  • Updated Windows version information generation for 64-bit builds to ensure proper version metadata is embedded in compiled binaries.

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.

@joepvd
Copy link
Copy Markdown
Author

joepvd commented Jun 5, 2026

@ardaguclu, we hit this when updating the build root to go1.26, and according to the linked golang issue, it was introduced then.

@openshift-ci-robot
Copy link
Copy Markdown

@joepvd: This pull request references Jira Issue OCPBUGS-87198, which is valid.

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

In response to this:

Hitting this error since bumping the build root from go1.25 to go1.26:

$WORK/b001/_pkg_.a(oc.syso): 2496931: unknown relocation type 7

while compiling windows binaries in brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=70980110

golang/go#77783 suggests to pass the -64 option to the invocation.

Summary by CodeRabbit

  • Chores
  • Updated Windows version information generation for 64-bit builds to ensure proper version metadata is embedded in compiled binaries.

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.

@joepvd
Copy link
Copy Markdown
Author

joepvd commented Jun 5, 2026

Fix verified by successful test build: https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=4031814

@ardaguclu
Copy link
Copy Markdown
Member

Thank you
/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, joepvd

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 5, 2026

@joepvd: The following test 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 ab95216 link true /test e2e-aws-ovn

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants