Skip to content

tools: fix brpm script to use correct builddir in temp directory#6809

Merged
blackboxsw merged 3 commits intocanonical:mainfrom
blackboxsw:fix-rpm-builds
Mar 31, 2026
Merged

tools: fix brpm script to use correct builddir in temp directory#6809
blackboxsw merged 3 commits intocanonical:mainfrom
blackboxsw:fix-rpm-builds

Conversation

@blackboxsw
Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw commented Mar 28, 2026

Additionally, the tool ./tools/run-container --source-package --unittest --artifacts=./srpm/ rockylinux/9 fails due to packages/brpm script not have appropriate import temp_utils and misuses a string "builddir" instead of the local variable builddir.

Proposed Commit Message

tools: fix brpm script to use correct builddir in temp directory

Additional Context

Test Steps

Expect an SRPM generated in ./srpm/* after this run
./tools/run-container --source-package --unittest --artifacts=./srpm rockylinux/9

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@blackboxsw blackboxsw force-pushed the fix-rpm-builds branch 2 times, most recently from d6eef19 to d2131bb Compare March 28, 2026 03:10
Comment thread packages/brpm Outdated
# Use the util functions from cloudinit
sys.path.insert(0, find_root())
from cloudinit import subp, templater, util
from cloudinit import temp_utils
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not in the list on the next line up?

Why didn't static analysis catch this issue?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ruff didn't see python scripts which do not carry the suffix .py. I've added a supplemental commit to also include brpm, bddeb and read-dependencies.

Comment thread tests/unittests/helpers.py
RockyLinux 9 has Jinja 2.11. Template-based unit tests break due to
unsupported closure: +%}.

Revert portion of 473fa33 to retain skip decorator avoiding unit test
when Jinja is < 3.0.0 to support rockylinux developer rpm builds.
Copy link
Copy Markdown
Member

@holmanb holmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.

@blackboxsw blackboxsw merged commit 65bacbe into canonical:main Mar 31, 2026
17 checks passed
blackboxsw added a commit to blackboxsw/cloud-init that referenced this pull request Apr 13, 2026
…onical#6809)

RockyLinux 9 has Jinja 2.11. Template-based unit tests break due to
unsupported closure: +%}.

Revert portion of 473fa33 to retain skip decorator avoiding unit test
when Jinja is < 3.0.0 to support rockylinux developer rpm builds.

Update ruff extra-includes to validate read-dependencies, bddeb and brpm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants