Skip to content

sophgo-sg200x-aic8800: don't git-fetch the driver during config-dump - #10381

Merged
igorpecovnik merged 1 commit into
mainfrom
fix/sg200x-aic8800-skip-fetch-on-configdump
Aug 9, 2026
Merged

sophgo-sg200x-aic8800: don't git-fetch the driver during config-dump#10381
igorpecovnik merged 1 commit into
mainfrom
fix/sg200x-aic8800-skip-fetch-on-configdump

Conversation

@igorpecovnik

@igorpecovnik igorpecovnik commented Aug 9, 2026

Copy link
Copy Markdown
Member

Why the "Generate build engine inventory" job fails

The inventory job (compile.sh inventory-boardsconfig-dump-json per board×branch) dies on the milkv-duos boards:

Error calling Armbian command: compile.sh config-dump-json ... BOARD=milkv-duos-arm ...
code: 128 - stacktrace for failed command exit code 128:
  git --no-pager config --global --add safe.directory \
    /armbian/cache/sources/aic8800-milkv-duos/ccf8fd059f70384fae4878c1048603510c2df700
...
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
KeyError: 'in.inventory.BOARD'   # ← whole inventory job exits 1

Why milkv-duos and not the other aic8800 boards

Every other aic8800 board installs a prebuilt DKMS deb (radxa-aic8800, brostrend-aic8800-dkms) — no git fetch at config time. sophgo-sg200x-aic8800 is the only one that pulls a vendor driver from git, and it did so unconditionally in post_family_config:

function post_family_config__sophgo_sg200x_aic8800_fetch() {
	fetch_from_repo "${AIC8800_REPO}" "aic8800-milkv-duos" "${AIC8800_REF}" "yes"
	...
}

post_family_config also runs under config-dump-json (CONFIG_DEFS_ONLY=yes), which the inventory runs in parallel for all four milkv-duos board×branch combos. So the inventory triggers a real git fetch that (a) has no kernel tree to feed and (b) races on the global git config (git config --global --add safe.directoryexit 128). That empties the config JSON, and inventory-boards-csv.py then KeyErrors and takes the whole job down.

The extension already guards its kernel hook against config-dump ([[ ! -f .config ]] && return 0) — it just missed the fetch hook.

Fix

Skip the fetch when CONFIG_DEFS_ONLY=yes — the framework's own idiom (used by main-config.sh, cli-docker.sh). AIC8800_SRC_DIR is still declared (deterministic path off the pinned ref) so version/hash calculation is unchanged. In a real build, post_family_config runs with CONFIG_DEFS_ONLY unset, so the fetch happens as before, ahead of custom_kernel_config copying from it (that copy is itself .config-guarded, i.e. real-build only).

Validation

  • bash -n clean.
  • Verified AIC8800_SRC_DIR's only real use (the cp -a at line 96) is behind the [[ ! -f .config ]] guard, so the config-dump path never needs the fetched files.

This unblocks the inventory job at the source. (A defensive follow-up could also make inventory-boards-csv.py skip a board whose config gather failed instead of KeyError-ing, so no single board can ever crash the whole inventory — happy to do that separately.)

Summary by CodeRabbit

  • Bug Fixes
    • Configuration-only and version-calculation runs no longer fetch the AIC8800 source repository unnecessarily.
    • AIC8800 sources continue to be fetched during actual kernel builds.

post_family_config also runs under `config-dump-json` (CONFIG_DEFS_ONLY=yes),
which the build-engine inventory runs in parallel for every board x branch.
This extension is the only aic8800 one that fetches a vendor driver from git
(the others install prebuilt DKMS debs), and it did so unconditionally in
post_family_config - so the inventory triggered a real fetch that has no
kernel tree to feed and raced on the global git config:

  git --no-pager config --global --add safe.directory \
    /armbian/cache/sources/aic8800-milkv-duos/<ref>   -> exit 128

That failed config-dump-json for both milkv-duos boards and took down the
whole "Generate build engine inventory" job.

Guard the fetch with CONFIG_DEFS_ONLY (the framework's own idiom, already used
by main-config.sh / cli-docker.sh, and mirrored by this extension's kernel
hook via `[[ ! -f .config ]]`). AIC8800_SRC_DIR is still declared for the real
build, where post_family_config runs without CONFIG_DEFS_ONLY and the fetch
happens before custom_kernel_config copies from it.

Signed-off-by: Igor Pecovnik <igor@armbian.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The AIC8800 extension now initializes its source directory before fetching. Configuration-only runs skip repository access, while kernel builds continue to fetch the pinned repository.

Changes

AIC8800 fetch control

Layer / File(s) Summary
Guard AIC8800 repository fetching
extensions/sophgo-sg200x-aic8800.sh
The fetch function initializes AIC8800_SRC_DIR, skips fetching when CONFIG_DEFS_ONLY=yes, and preserves the pinned repository fetch for kernel builds.

Estimated code review effort: 2 (Simple) | ~5 minutes

Suggested reviewers: lukaszsobala

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: skipping the driver fetch during configuration-dump runs.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sg200x-aic8800-skip-fetch-on-configdump

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.

@github-actions github-actions Bot added 08 Milestone: Third quarter release size/small PR with less then 50 lines Needs review Seeking for review Framework Framework components labels Aug 9, 2026
@igorpecovnik
igorpecovnik merged commit 0c1174e into main Aug 9, 2026
13 checks passed
@igorpecovnik
igorpecovnik deleted the fix/sg200x-aic8800-skip-fetch-on-configdump branch August 9, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Framework Framework components Needs review Seeking for review size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant