chore(ci): update cross-compile scripts and build notes#7674
Conversation
Summary of ChangesHello @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
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Added some option explanation. See if that helps.
…untu 22.04 on x86
Description
update cross-compile scripts
improve on the cross-compile build notes
Motivation and Context
Make cross-compiling for users better