cosmetic: clean up build warnings (locale, setfont, GPG, oras)#9684
cosmetic: clean up build warnings (locale, setfont, GPG, oras)#9684igorpecovnik merged 2 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughChroot-invoked commands now run with neutralized locale environment variables ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
lib/functions/rootfs/distro-specific.sh (1)
269-275: Use trap-based cleanup for temporary GPG homedir.If
gpg --dearmorfails,rm -rf "${gpg_tmp}"won’t run and temp dirs accumulate. Prefer a trap to guarantee cleanup.Suggested patch
local gpg_tmp gpg_tmp=$(mktemp -d) + trap 'rm -rf "${gpg_tmp}"' RETURN gpg --homedir "${gpg_tmp}" --batch --yes --dearmor < "${SRC}"/config/armbian.key > "${basedir}${APT_SIGNING_KEY_FILE}" - rm -rf "${gpg_tmp}" + trap - RETURN + rm -rf "${gpg_tmp}"Based on learnings scripts in this framework run with
set -e, so failure paths should still guarantee cleanup.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/functions/rootfs/distro-specific.sh` around lines 269 - 275, The temporary GPG homedir created with gpg_tmp=$(mktemp -d) can leak if gpg --dearmor fails; set a trap immediately after creating gpg_tmp to always remove it (e.g., trap 'rm -rf "${gpg_tmp}"' EXIT), then run gpg --homedir "${gpg_tmp}" --batch --yes --dearmor < "${SRC}"/config/armbian.key > "${basedir}${APT_SIGNING_KEY_FILE}"; after successful use you may optionally clear the trap (trap - EXIT) or leave it to run on EXIT; reference gpg_tmp, mktemp -d, gpg --homedir ... --dearmor and rm -rf "${gpg_tmp}" to locate where to add the trap.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/functions/rootfs/distro-specific.sh`:
- Line 282: The two direct chroot invocations that currently prefix LC_ALL=C
LANG=C should also clear LANGUAGE and SUDO_USER to avoid leaking locale and sudo
user info; update both commands (the one creating the symlink to
armbian-archive-keyring.gpg and the other at the later occurrence) to prefix
with LC_ALL=C LANG=C LANGUAGE= SUDO_USER= before chroot so the environment
becomes: LC_ALL=C LANG=C LANGUAGE= SUDO_USER= chroot "${basedir}" /bin/bash -c
"…".
---
Nitpick comments:
In `@lib/functions/rootfs/distro-specific.sh`:
- Around line 269-275: The temporary GPG homedir created with gpg_tmp=$(mktemp
-d) can leak if gpg --dearmor fails; set a trap immediately after creating
gpg_tmp to always remove it (e.g., trap 'rm -rf "${gpg_tmp}"' EXIT), then run
gpg --homedir "${gpg_tmp}" --batch --yes --dearmor < "${SRC}"/config/armbian.key
> "${basedir}${APT_SIGNING_KEY_FILE}"; after successful use you may optionally
clear the trap (trap - EXIT) or leave it to run on EXIT; reference gpg_tmp,
mktemp -d, gpg --homedir ... --dearmor and rm -rf "${gpg_tmp}" to locate where
to add the trap.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6d387a8e-4a27-49ca-a40b-48fd4560d18f
📒 Files selected for processing (3)
lib/functions/logging/runners.shlib/functions/rootfs/distro-specific.shlib/functions/rootfs/rootfs-create.sh
e313e61 to
9c21142
Compare
89164b3 to
8081847
Compare
8081847 to
a109ae6
Compare
1. LC_ALL="C" LANG="C" LANGUAGE="" SUDO_USER="" in chroot_sdcard/ chroot_mount wrappers + direct chroot calls in distro-specific.sh 2. Temporary --homedir for gpg --dearmor call 3. setupcon --save --force 2>/dev/null (suppress setfont noise) 4. Pre-create /etc/apt/apt.conf.d/99-armbian-sandbox; removed in cleanup
Capture oras stderr via temp file; suppress if "not found" (expected cache miss). Any other error still shown as warning.
a109ae6 to
06bdf1b
Compare
Summary
Silences five categories of noisy but harmless warnings that clutter every image build log. Two commits, 4 files, +46 / -7 lines.
Commit 1: chroot environment cleanup
Files: `lib/functions/logging/runners.sh`, `lib/functions/rootfs/distro-specific.sh`, `lib/functions/rootfs/rootfs-create.sh`
Commit 2: oras 404 cosmetic
File: `lib/functions/general/oci-oras.sh`
Test plan
Summary by CodeRabbit
Bug Fixes
Chores