Skip to content

bsp-cli: version the package on the family's own packages/bsp files - #10327

Open
lukaszsobala wants to merge 2 commits into
armbian:mainfrom
lukaszsobala:bsp-cli-hash-family-bsp-files
Open

bsp-cli: version the package on the family's own packages/bsp files#10327
lukaszsobala wants to merge 2 commits into
armbian:mainfrom
lukaszsobala:bsp-cli-hash-family-bsp-files

Conversation

@lukaszsobala

@lukaszsobala lukaszsobala commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Companion to #10326. But the board will still work without it.

Affected boards: every family with a packages/bsp/<family>/ directory, plus every board with a packages/bsp/<board>/. These rebuild once, everything else keeps its exact current version.

Description

Better hashing of BSP artifacts

artifact_armbian-bsp-cli_prepare_version() hashes packages/bsp/common and the config/optional/.../_packages/bsp-cli trees, and nothing else under packages/. Family files do not arrive that way - they are installed by post_family_tweaks_bsp hooks, out of packages/bsp/<family>/ - and the hooks are hashed only as source text. An install ${SRC}/packages/bsp/foo/bar line reads the same whether bar changed or not.

So editing a family's bsp file moves no component of the version string. The artifact then collides with an older build, artifacts-obtain.sh finds it in the local or remote cache, unpacks that deb-tar, and the image ships the previous copy of the file. Nothing warns; the build log says cache hit, which is what a cache hit always says.

It stays hidden because the hash is board-independent in practice: with no config/optional entries for most boards, packages/bsp/common is the whole input and every board on the tree carries the same PC component. A family file is simply never part of it.

Hash packages/bsp/${LINUXFAMILY} alongside the rest. calculate_hash_for_all_files_in_dirs() skips directories that do not exist, so families without one keep their exact current version and nothing is rebuilt for them.

The family-named directory does not cover everything: a family or extension can install from any path under packages/, and packages/bsp/aic8800 is shared by several unrelated boards. Those cannot be derived from LINUXFAMILY, so add BSP_CLI_EXTRA_HASH_DIRS for them - append a directory from the family config or an extension's extension_prepare_config and it versions the package like every other input. Left empty here; the boards that need it are a separate change.

How Has This Been Tested?

The hashes change when files change, previously they did not.

Checklist:

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • Bug Fixes
    • BSP CLI package versions now update reliably when family-specific files or additional hook outputs change.
    • Added validation to prevent preparing a package version without the required platform family configuration.

artifact_armbian-bsp-cli_prepare_version() hashes packages/bsp/common and the
config/optional/.../_packages/bsp-cli trees, and nothing else under packages/.
Family files do not arrive that way - they are installed by
post_family_tweaks_bsp hooks, out of packages/bsp/<family>/ - and the hooks are
hashed only as source text. An `install ${SRC}/packages/bsp/foo/bar` line reads
the same whether bar changed or not.

So editing a family's bsp file moves no component of the version string. The
artifact then collides with an older build, artifacts-obtain.sh finds it in the
local or remote cache, unpacks that deb-tar, and the image ships the previous
copy of the file. Nothing warns; the build log says cache hit, which is what a
cache hit always says.

It stays hidden because the hash is board-independent in practice: with no
config/optional entries for most boards, packages/bsp/common is the whole input
and every board on the tree carries the same PC component. A family file is
simply never part of it.

Hash packages/bsp/${LINUXFAMILY} alongside the rest. calculate_hash_for_all_files_in_dirs()
skips directories that do not exist, so families without one keep their exact
current version and nothing is rebuilt for them.

The family-named directory does not cover everything: a family or extension can
install from any path under packages/, and packages/bsp/aic8800 is shared by
several unrelated boards. Those cannot be derived from LINUXFAMILY, so add
BSP_CLI_EXTRA_HASH_DIRS for them - append a directory from the family config or
an extension's extension_prepare_config and it versions the package like every
other input. Left empty here; the boards that need it are a separate change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The BSP CLI package hash now validates LINUXFAMILY and includes the family-specific BSP directory and directories configured through BSP_CLI_EXTRA_HASH_DIRS.

Changes

BSP CLI package hashing

Layer / File(s) Summary
Extend BSP hash directory inputs
lib/functions/artifacts/artifact-armbian-bsp-cli.sh
The package versioning process requires LINUXFAMILY. The hash includes ${SRC}/packages/bsp/${LINUXFAMILY} and configured BSP_CLI_EXTRA_HASH_DIRS entries.

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

Suggested reviewers: rpardini

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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 describes the main change: versioning BSP CLI packages when family-specific packages/bsp files change.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 size/small PR with less then 50 lines 08 Milestone: Third quarter release Needs review Seeking for review Framework Framework components labels Aug 3, 2026
@EvilOlaf
EvilOlaf requested a review from rpardini August 4, 2026 03:46
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