-
Notifications
You must be signed in to change notification settings - Fork 124
introduce zig cc cross-compilation setup for GitHub Actions and local development
#2535
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
base: main
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis PR introduces Zig cross-compilation toolchain support to the build system. It adds architecture normalization and Zig installation targets to the Makefile, creates a new zigcc compiler wrapper in Go, updates the sandbox script to configure cross-compilation targeting s390x-linux-gnu.2.34, adjusts Docker runtime configurations, and expands the Python 3.12 image build matrix. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
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. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
Makefile(1 hunks)runtimes/minimal/ubi9-python-3.12/Dockerfile.cpu(2 hunks)scripts/sandbox.py(2 hunks)scripts/zigcc/Makefile(1 hunks)scripts/zigcc/go.mod(1 hunks)scripts/zigcc/zigcc.go(1 hunks)scripts/zigcc/zigcc_test.go(1 hunks)wrapper.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
wrapper.py (1)
scripts/sandbox.py (1)
main(27-80)
🪛 checkmake (0.2.2)
scripts/zigcc/Makefile
[warning] 1-1: Missing required phony target "all"
(minphony)
🪛 Ruff (0.14.4)
scripts/sandbox.py
51-51: Local variable target is assigned to but never used
Remove assignment to unused variable target
(F841)
62-62: f-string without any placeholders
Remove extraneous f prefix
(F541)
64-64: f-string without any placeholders
Remove extraneous f prefix
(F541)
65-65: f-string without any placeholders
Remove extraneous f prefix
(F541)
84-84: String contains ambiguous × (MULTIPLICATION SIGN). Did you mean x (LATIN SMALL LETTER X)?
(RUF001)
146-146: subprocess call: check for execution of untrusted input
(S603)
148-148: subprocess call: check for execution of untrusted input
(S603)
150-150: subprocess call: check for execution of untrusted input
(S603)
wrapper.py
1-1: Shebang is present but file is not executable
(EXE001)
16-16: Consider iterable unpacking instead of concatenation
Replace with iterable unpacking
(RUF005)
18-18: Consider iterable unpacking instead of concatenation
Replace with iterable unpacking
(RUF005)
20-20: Avoid specifying long messages outside the exception class
(TRY003)
22-22: Starting a process without a shell
(S606)
| if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then \ | ||
| PACKAGES="$PACKAGES gcc g++ make openssl-devel autoconf automake libtool cmake"; \ | ||
| PACKAGES="$PACKAGES gcc g++ ninja-build openssl-devel autoconf automake libtool cmake"; \ | ||
| fi && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore make for non-ninja builds on s390x/ppc64le
Dropping make here leaves those arches without the classic build tool that many Python/C extensions still expect, so pip install of projects that call make will now fail. Please keep make while adding ninja-build.
- PACKAGES="$PACKAGES gcc g++ ninja-build openssl-devel autoconf automake libtool cmake"; \
+ PACKAGES="$PACKAGES gcc g++ make ninja-build openssl-devel autoconf automake libtool cmake"; \🤖 Prompt for AI Agents
In runtimes/minimal/ubi9-python-3.12/Dockerfile.cpu around lines 35 to 37, the
s390x/ppc64le PACKAGES list removed make which breaks builds that invoke make;
update the PACKAGES assignment to include make alongside ninja-build (e.g., add
"make" to the quoted package list) so both classic make and ninja are available
for those architectures.
| module zigcc | ||
|
|
||
| go 1.24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Target a released Go toolchain
go 1.24 is not available yet, so current builders (Go ≤1.22/1.23) will abort with “requires go >=1.24”. Drop to the latest released version you actually need (e.g. 1.22).
-go 1.24
+go 1.22📝 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.
| module zigcc | |
| go 1.24 | |
| module zigcc | |
| go 1.22 |
🤖 Prompt for AI Agents
In scripts/zigcc/go.mod around lines 1 to 3, the module specifies "go 1.24"
which is not yet released and will abort builds on current Go toolchains; change
the go directive to an actual released version your project needs (for example
"go 1.22" or the minimum released version that supports the features you use),
update any CI/docker builders to match that version if necessary, and run go mod
tidy/build locally to verify compatibility.
|
@coderabbitai provide commentary and improvement suggestions for the |
…ting, and ensure `zigcc` wrappers are built
|
|
|
…ance cross-compilation tool wrapping, and document usage in README.
|
|
this seems a flaky fail?!? |
… architecture string to `powerpc64le`.
…rget` logic, add glibc version handling, and integrate debugging tools. Document usage and background in README. Add tests and Dockerfile for validation.
Description
How Has This Been Tested?
Self checklist (all need to be checked):
make test(gmakeon macOS) before asking for reviewDockerfile.konfluxfiles should be done inodh/notebooksand automatically synced torhds/notebooks. For Konflux-specific changes, modifyDockerfile.konfluxfiles directly inrhds/notebooksas these require special attention in the downstream repository and flow to the upcoming RHOAI release.Merge criteria:
Summary by CodeRabbit
New Features
Chores