Skip to content

fix(script): parse profile hooks when packages are inherited - #274

Open
alexsmolya wants to merge 2 commits into
CachyOS:masterfrom
alexsmolya:fix/handheld-profile-hooks
Open

fix(script): parse profile hooks when packages are inherited#274
alexsmolya wants to merge 2 commits into
CachyOS:masterfrom
alexsmolya:fix/handheld-profile-hooks

Conversation

@alexsmolya

Copy link
Copy Markdown

Fixes #273

Summary & Root Cause

In scripts/chwd, parse_profiles previously coupled hook capture to if not profiles[profile].packages. For child profiles that inherit packages from their parent profile without defining their own packages entry (such as [handheld.rog-ally] and [handheld.msi-claw]), profiles[profile].packages remained nil, causing the parser to stay in the package-matching branch on every line and skip all hook extraction (post_install, post_remove, conditional_packages, etc.).

As a result, profile installation succeeded in installing package dependencies, but post_install never executed and the required PipeWire/WirePlumber directory and symlink setup was not performed.

Changes

  • Decouple hook capture from packages presence in scripts/chwd so all declared hooks on child profiles are parsed regardless of whether packages is defined locally or inherited.
  • Added unit test in src/profile.rs (handheld_profile_parse_test).
  • Added regression tests in tests/chwd_spec.lua asserting child profiles properly inherit packages and retain their own hooks.

Validation

  • Lua regression tests PASS (verified handheld.rog-ally, handheld.msi-claw, and child hook overrides).
  • cargo test: 24 passed, 0 failed.
  • cargo clippy --all-targets -- -D warnings: clean.
  • cargo fmt --check: clean.
  • git diff --check: clean.
  • Note: Physical ROG Ally hardware runtime validation was unavailable, but the affected profile parsing code path and hook resolution have been fully verified via regression tests.

Comment thread scripts/chwd Outdated

@ventureoo ventureoo left a comment

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.

Lua's part of changes are LGTM.

@ventureoo
ventureoo requested a review from vnepogodin August 30, 2026 11:30
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.

post_install hook doesn't run for handheld.rog-ally profile (PipeWire/WirePlumber symlinks never created)

2 participants