Skip to content

chore(ci): update cross-compile scripts and build notes#7674

Merged
SWvheerden merged 7 commits intotari-project:developmentfrom
leet4tari:build-bins-leet-cross-compile-improvements-clean
Mar 3, 2026
Merged

chore(ci): update cross-compile scripts and build notes#7674
SWvheerden merged 7 commits intotari-project:developmentfrom
leet4tari:build-bins-leet-cross-compile-improvements-clean

Conversation

@leet4tari
Copy link
Contributor

Description
update cross-compile scripts
improve on the cross-compile build notes

Motivation and Context
Make cross-compiling for users better

@leet4tari leet4tari requested a review from a team as a code owner February 5, 2026 13:27
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @leet4tari, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the developer experience for cross-compiling the project. It modernizes the underlying configuration for package discovery during cross-compilation and provides a much-needed, comprehensive update to the build documentation. These changes aim to make the process of setting up and performing cross-builds more straightforward and robust for users across different Ubuntu versions and target architectures.

Highlights

  • Cross-Compilation Configuration Update: The Cross.toml file has been updated to streamline pkg-config environment variable handling. This includes switching from PKG_CONFIG_SYSROOT_DIR to PKG_CONFIG_PATH and explicitly defining the path for aarch64 and x86_64 targets, simplifying the setup for cross-compilation.
  • Improved Build Notes Documentation: The buildtools/build-notes.md file has undergone a significant overhaul. It now provides clearer and more comprehensive instructions for both native and cross-compilation, including detailed steps for using automated scripts, manual setup for various architectures, updated Docker examples, and a new troubleshooting section.
  • Enhanced Cross-Compilation Script: The scripts/cross_compile_ubuntu_18-pre-build.sh script has been refined to extend support for Ubuntu versions up to 22.04. It also features improved logic for configuring architecture-specific repositories and includes additional dpkg commands for better debugging and visibility during multi-architecture setup.
Changelog
  • Cross.toml
    • Updated passthrough variables to include CC_x86_64_unknown_linux_gnu and replaced PKG_CONFIG_SYSROOT_DIR with PKG_CONFIG_PATH.
    • Configured PKG_CONFIG_PATH for aarch64-unknown-linux-gnu and x86_64-unknown-linux-gnu targets.
    • Removed redundant CC_aarch64_unknown_linux_gnu setting.
  • buildtools/build-notes.md
    • Renamed the document title to 'Tari Build Notes' and expanded build option descriptions.
    • Added a new 'Automated Cross-Compilation Setup' section with detailed script usage for x86_64, arm64, and riscv64 on Ubuntu 18.04-22.04.
    • Restructured manual installation steps, including system dependencies, Rust installation, and detailed cross-compilation configuration for ARM64 and x86_64 targets.
    • Updated Docker examples to use ubuntu:22.04.
    • Added make to system dependencies.
    • Removed numerous outdated environment variable exports.
    • Expanded the 'Using Cross' section with more comprehensive build examples.
    • Introduced a 'Troubleshooting' section.
  • scripts/cross_compile_ubuntu_18-pre-build.sh
    • Updated script header to reflect support for Ubuntu 18.04 to 22.04.
    • Added commented-out HTTPS::Proxy "false"; and ForceIPv4 "true"; to APT proxy configuration.
    • Improved logic for adding architecture-specific repositories, differentiating between ports and archive repos.
    • Added dpkg --print-foreign-architectures calls for better visibility during multi-arch setup.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates cross-compile scripts and build notes to improve the cross-compiling experience for users. The changes include updating the Cross.toml file to pass through necessary environment variables, modifying the build-notes.md file to provide clearer instructions and examples for cross-compilation, and updating the cross_compile_ubuntu_18-pre-build.sh script to support Ubuntu versions 18.04 to 22.04 and handle package repository configurations for cross-compilation. The review focuses on correctness and maintainability, ensuring the instructions are accurate and the scripts function as expected.


if [ "${crossArch}" == "amd64" ]; then
# Archive Repo for x86_64
if [[ "${crossArch}" == "amd64" ]] && [ "$use_ports_repo" = false ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

critical: The condition [[ "${crossArch}" == "amd64" ]] && [ "$use_ports_repo" = false ] will never be true. $use_ports_repo is set to false only if ubuntu_major_version is greater than 22. If ubuntu_major_version is greater than 22, then the crossArch can never be amd64 because the script is intended for cross-compilation, and if the Ubuntu version is greater than 22, the script uses the standard archive repositories (not ports repositories) for all architectures. This means that the x86_64 repos will never be added when running on Ubuntu 23.04 or later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct, on Ubuntu 23.04 and later, the ports repo changes is not need for amd64 cross-compiles. ie: compiling from arm64 or amd64 target.


if [ "${crossArch}" == "amd64" ]; then
# Archive Repo for x86_64
if [[ "${crossArch}" == "amd64" ]] && [ "$use_ports_repo" = false ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

high

high: When use_ports_repo is false, the script modifies /etc/apt/sources.list but doesn't revert it. This could lead to issues if the user later tries to build natively or for a different target. Add logic to revert the changes to /etc/apt/sources.list after the cross-compilation is done, or provide a clear warning in the build notes about this behavior.

-u root \
--platform linux/arm64 \
ubuntu:18.04 bash
ubuntu:22.04 bash
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

medium: The Docker command includes volume mounts and port mappings. Briefly explain the purpose of these for users less familiar with Docker, such as the purpose of mounting temp/root and tari directories, and the port forwarding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some option explanation. See if that helps.

@SWvheerden SWvheerden merged commit cf4b751 into tari-project:development Mar 3, 2026
16 of 17 checks passed
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