Skip to content

fix(amdsmi): [ROCM-3941] packaging correctness and coverage follow-ups - #9427

Closed
marifamd wants to merge 9 commits into
developfrom
users/marifamd/amdsmi-packaging-followup-clean
Closed

marifamd wants to merge 9 commits into
developfrom
users/marifamd/amdsmi-packaging-followup-clean

Conversation

@marifamd

Copy link
Copy Markdown
Contributor

Description

Packaging-correctness and coverage follow-ups to the AMD SMI Python packaging rework (relanded in #9340). Same content as #9033, restructured into logical commits for reviewability.

Grouped as:

  1. fix: stop the logger from restoring world-writable log permissions — the logger reset the root-owned operational log to 0666 (S_IWOTH) on every open, negating the package's 0664 mode (CWE-732).
  2. fix: harden the RPM and DEB packaging scriptlets — group-writable (not world-writable) log, restrict preun/prerm cleanup to a full erase, stop the RPM co-owning system python dirs, quote the install prefix when writing ld.so.conf.d.
  3. fix: fall through to the system library when the relocatable lib fails to load — add a <root>/lib/<SONAME> probe for relocatable ROCm trees (TheRock) with a try/except OSError fall-through so a present-but-unloadable relocatable library doesn't shadow the system SONAME; dedupe the wrapper _libraries init (wrapper regenerated from generator.py).
  4. build: harden the Python wheel build and packaging config — one wheel per platform tagged manylinux_2_28, verify the bundled .so, clean PyPI version with commit metadata, idempotent + UTF-8 fallback-flag staging, reject regenerating the wrapper against the wheel library, skip the system site-packages install for wheel builds.
  5. test: add packaging and loader test coverage — loader contract (bundled wheel .so, relocatable OSError fall-through, wheel-refuses-fallback, ambiguous-wrapper failure), SONAME conflict check, dual-copy drift guard, wired into the harness and run without a GPU.
  6. ci: wire the packaging checks into CI and tighten the wheel job — run the SONAME conflict check + wheel fallback-flag assertion, pin the manylinux build dir, scan abi_compat output in the summary.
  7. docs: document the packaging and install paths — dual-copy install layout, PYTHONPATH module precedence, manylinux wheel build directory.

Verification

JIRA ID

ROCM-3941

marifamd added 7 commits July 29, 2026 01:12
…sions

The postinst sets the operational log to 0664, but the logger reset it to 0666 (S_IWOTH) on every open, so the first root run made the root-owned log world-writable again and negated the CWE-732 fix. Match the package mode.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Make the operational log group-writable instead of world-writable, restrict preun/prerm cleanup to a full erase, stop the RPM from co-owning system python directories, and quote the install prefix when writing ld.so.conf.d.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
…lib fails to load

Add a <root>/lib/<SONAME> probe for relocatable ROCm trees (TheRock) with a try/except OSError fall-through so a present-but-unloadable relocatable library does not shadow the system SONAME. Dedupe the wrapper _libraries init. Wrapper regenerated from generator.py.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Build one wheel per platform tagged manylinux_2_28 and verify the bundled .so, use a clean PyPI version with the commit as metadata, make the fallback-flag staging idempotent and UTF-8, reject regenerating the wrapper against the wheel library, and skip the system site-packages install for wheel builds.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Cover the loader contract (bundled wheel .so, relocatable OSError fall-through, wheel-refuses-fallback, ambiguous-wrapper failure), the SONAME conflict check, and the dual-copy drift guard; wire them into the build harness and run them without a GPU.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Run the SONAME conflict check and the wheel fallback-flag assertion, pin the manylinux build dir, and scan abi_compat output in the build summary.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Note the dual-copy install layout, PYTHONPATH module precedence, and the manylinux wheel build directory.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@marifamd
marifamd requested a review from a team July 29, 2026 06:52
@marifamd
marifamd requested a review from a team as a code owner July 29, 2026 06:52
@github-actions github-actions Bot added documentation Improvements or additions to documentation project: amdsmi github actions Pull requests that update GitHub Actions code labels Jul 29, 2026
@therock-pr-bot

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Title/Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

marifamd added 2 commits July 29, 2026 02:51
The standalone PyPI wheel ships only the amdsmi Python bindings; it declares no console_scripts entry point, so it does not provide the amd-smi CLI. Mark that matrix cell unsupported.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@dmitrii-galantsev

Copy link
Copy Markdown
Contributor

dupe of #9033 we don't need it

@dmitrii-galantsev
dmitrii-galantsev deleted the users/marifamd/amdsmi-packaging-followup-clean branch July 29, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github actions Pull requests that update GitHub Actions code organization: ROCm project: amdsmi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants