Skip to content

chore: add Cross.toml for cross-compilation clang/llvm dependencies#83

Merged
panos-xyz merged 2 commits intomainfrom
chore/add-cross-toml
Apr 7, 2026
Merged

chore: add Cross.toml for cross-compilation clang/llvm dependencies#83
panos-xyz merged 2 commits intomainfrom
chore/add-cross-toml

Conversation

@panos-xyz
Copy link
Copy Markdown
Contributor

@panos-xyz panos-xyz commented Apr 7, 2026

Summary

  • Add Cross.toml with pre-build steps to install llvm-dev, libclang-dev, and clang in the cross Docker container
  • Required for reth-mdbx-sys compilation which needs stdarg.h
  • Configuration matches upstream reth and scroll-reth

Context

Release CI (release.yml) failed on v0.2.0 tag push with:

reth-mdbx-sys: fatal error: 'stdarg.h' file not found

Test plan

  • CI checks pass on this PR
  • After merge, re-tag v0.2.0 and verify release workflow completes

Summary by CodeRabbit

  • Chores
    • Added build configuration to improve cross-compilation setup, including system dependency installation and toolchain configuration for enhanced build reliability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Added a new Cross.toml configuration file that defines Cross build behavior with pre-build commands to install LLVM/Clang toolchain dependencies, configure APT settings, and establish build environment variables for cross-compilation support.

Changes

Cohort / File(s) Summary
Build Configuration
Cross.toml
New Cross build configuration with pre-build commands installing LLVM/Clang toolchain (llvm-dev, libclang-dev, clang) for rust-bindgen support, APT repository updates (HTTP to HTTPS), and environment variable passthrough for JEMALLOC_SYS_WITH_LG_PAGE.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • anylots
  • chengwenxi

Poem

🐰 A build so fine, with tools aligned,
Cross and Clang, a perfect bind,
APT secured, HTTPS true,
JEMALLOC whispers, "I'm passed through!"
Compilation hops with glee! 🔨✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a Cross.toml configuration file for cross-compilation with clang/llvm dependencies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-cross-toml

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.

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

🧹 Nitpick comments (1)
Cross.toml (1)

18-19: JEMALLOC_SYS_WITH_LG_PAGE passthrough is currently ineffective in release CI.

In .github/workflows/release.yml (Lines 102-108), cross build runs without exporting this variable first, so this entry has no effect for that workflow. Consider either setting it explicitly in the workflow or removing this passthrough to avoid dead config.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cross.toml` around lines 18 - 19, The passthrough entry under [build.env]
(passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE"]) is ineffective because the release
workflow runs cross build without exporting JEMALLOC_SYS_WITH_LG_PAGE first;
either remove that dead passthrough entry from Cross.toml or update the release
workflow to export the environment variable before invoking cross (i.e., ensure
the CI job that runs the cross build sets/exports JEMALLOC_SYS_WITH_LG_PAGE in
the environment), referencing the passthrough key, the variable name
JEMALLOC_SYS_WITH_LG_PAGE, and the invocation of cross build.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Cross.toml`:
- Around line 8-10: Add an HTTPS timeout entry to the APT retry config so the
timeout/retry hardening applies to the rewritten HTTPS sources: after the
existing echo lines that create /etc/apt/apt.conf.d/80-retries (the lines
writing Acquire::http::Timeout and Acquire::ftp::Timeout), add a similar echo
for Acquire::https::Timeout with the same value (e.g., "60") so the file
includes Acquire::https::Timeout "60";.

---

Nitpick comments:
In `@Cross.toml`:
- Around line 18-19: The passthrough entry under [build.env] (passthrough =
["JEMALLOC_SYS_WITH_LG_PAGE"]) is ineffective because the release workflow runs
cross build without exporting JEMALLOC_SYS_WITH_LG_PAGE first; either remove
that dead passthrough entry from Cross.toml or update the release workflow to
export the environment variable before invoking cross (i.e., ensure the CI job
that runs the cross build sets/exports JEMALLOC_SYS_WITH_LG_PAGE in the
environment), referencing the passthrough key, the variable name
JEMALLOC_SYS_WITH_LG_PAGE, and the invocation of cross build.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: e3db84f0-ec73-4d02-8a2b-f9fafa311ff8

📥 Commits

Reviewing files that changed from the base of the PR and between f84a2f9 and dde052f.

📒 Files selected for processing (1)
  • Cross.toml

Comment thread Cross.toml
Comment on lines +8 to +10
"echo 'Acquire::Retries \"3\";' > /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::http::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::ftp::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
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

Add HTTPS timeout since sources are switched to HTTPS.

Line 5 rewrites APT sources to https://, but Lines 9-10 only configure http/ftp timeouts. Add Acquire::https::Timeout so retry/timeout hardening applies to the protocol actually used.

🔧 Suggested patch
     "echo 'Acquire::Retries \"3\";' > /etc/apt/apt.conf.d/80-retries",
     "echo 'Acquire::http::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
+    "echo 'Acquire::https::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
     "echo 'Acquire::ftp::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
📝 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
"echo 'Acquire::Retries \"3\";' > /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::http::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::ftp::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::Retries \"3\";' > /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::http::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::https::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
"echo 'Acquire::ftp::Timeout \"60\";' >> /etc/apt/apt.conf.d/80-retries",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cross.toml` around lines 8 - 10, Add an HTTPS timeout entry to the APT retry
config so the timeout/retry hardening applies to the rewritten HTTPS sources:
after the existing echo lines that create /etc/apt/apt.conf.d/80-retries (the
lines writing Acquire::http::Timeout and Acquire::ftp::Timeout), add a similar
echo for Acquire::https::Timeout with the same value (e.g., "60") so the file
includes Acquire::https::Timeout "60";.

@panos-xyz panos-xyz requested a review from chengwenxi April 7, 2026 07:16
@panos-xyz panos-xyz merged commit cbaf860 into main Apr 7, 2026
12 checks passed
@panos-xyz panos-xyz deleted the chore/add-cross-toml branch April 7, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants