fix: fix x86 build#137
Conversation
📝 WalkthroughWalkthrough
ChangesGCC 10 Cross Build Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 `@Cross.toml`:
- Around line 12-16: The Cross.toml pre-build setup only registers GCC 10 with
update-alternatives but does not force it to become the active compiler. Update
the pre-build commands so that after the existing update-alternatives --install
calls, both the gcc and cc groups are explicitly selected to GCC 10 using --set,
ensuring the x86 build uses the intended compiler; keep the change within the
pre-build array where the gcc/cc alternatives are configured.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| pre-build = [ | ||
| "apt-get update && apt-get install --assume-yes gcc-10 g++-10", | ||
| "update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10", | ||
| "update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100", | ||
| ] |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major
🧩 Analysis chain
🌐 Web query:
Does update-alternatives --installswitch the active alternative when a group is already in manual mode, or is an explicit--set required?
💡 Result:
When a link group is in manual mode, the update-alternatives --install command will add the new alternative to the group's list of options, but it will not switch the active alternative [1][2]. The system respects the administrator's previous manual selection and will not automatically update the symlinks, even if the newly installed alternative has a higher priority [1][3][2]. To switch the active alternative in this scenario, you must either: 1. Use the --config command to interactively select the desired alternative [4]. 2. Use the --set command to explicitly define the active alternative [3]. In summary, an explicit action by the administrator is required to change the active link when the group is in manual mode [1][2].
Citations:
- 1: https://linux.die.net/man/8/update-alternatives
- 2: https://documentation.suse.com/sled/15-SP7/html/SLED-all/cha-update-alternative.html
- 3: https://unix.stackexchange.com/questions/288808/difference-between-auto-mode-and-manual-mode-in-update-alternatives
- 4: https://0xdf.gitlab.io/2020/03/24/update-alternatives.html
Force-select GCC 10 after registering the alternatives.
update-alternatives --install only adds the choice; if the group is already in manual mode, gcc/cc can stay on the previous compiler. Add explicit --set for both groups so the x86 build actually uses GCC 10.
Suggested patch
pre-build = [
"apt-get update && apt-get install --assume-yes gcc-10 g++-10",
"update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10",
"update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100",
+ "update-alternatives --set gcc /usr/bin/gcc-10",
+ "update-alternatives --set cc /usr/bin/gcc-10",
]📝 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.
| pre-build = [ | |
| "apt-get update && apt-get install --assume-yes gcc-10 g++-10", | |
| "update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10", | |
| "update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100", | |
| ] | |
| pre-build = [ | |
| "apt-get update && apt-get install --assume-yes gcc-10 g++-10", | |
| "update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10", | |
| "update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100", | |
| "update-alternatives --set gcc /usr/bin/gcc-10", | |
| "update-alternatives --set cc /usr/bin/gcc-10", | |
| ] |
🤖 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 `@Cross.toml` around lines 12 - 16, The Cross.toml pre-build setup only
registers GCC 10 with update-alternatives but does not force it to become the
active compiler. Update the pre-build commands so that after the existing
update-alternatives --install calls, both the gcc and cc groups are explicitly
selected to GCC 10 using --set, ensuring the x86 build uses the intended
compiler; keep the change within the pre-build array where the gcc/cc
alternatives are configured.
Summary by CodeRabbit