Adding xmake support for ps1-packer.#2053
Conversation
📝 WalkthroughWalkthroughThe changes add Xmake definitions for support libraries and the ChangesSupport build and packaging
History cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Xmake
participant ps1_packer
participant PackedOutput
Xmake->>ps1_packer: Link executable
Xmake->>ps1_packer: Pass configured output path
ps1_packer->>PackedOutput: Generate packed artifact
Xmake->>PackedOutput: Remove artifact during clean
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tools/ps1-packer/xmake.lua (1)
39-43: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winVerify
ps1-packerdefault load address is sufficient for all targets using this rule.The
after_linkfunction only passes-otops1-packer. The shell Makefile (src/mips/shell/Makefile:6) uses-tload 0x80030000to set a specific load address. While-rawis specific to raw binary output (not PSEXE), the-tloadflag may be needed for targets with non-default load addresses. Ifps1-packerdoesn't read the load address from the ELF headers, the packed PSEXE output could have an incorrect entry point. Consider making additional flags configurable via a target value, similar to howpsx.extensionis already handled inon_load.♻️ Suggested approach for configurable flags
target:add("values", "ps1-packer.psexe.postlink.outfile", outfile) + target:add("values", "ps1-packer.psexe.postlink.extra_args", "") target:add("values", "psexe", false) end) after_link(function(target) local ps1packer = target:dep("ps1-packer") local outfile = target:values("ps1-packer.psexe.postlink.outfile") - os.run("%s %s -o %s", ps1packer:targetfile(), target:targetfile(), outfile) + local extra_args = target:values("ps1-packer.psexe.postlink.extra_args") or "" + os.run("%s %s %s -o %s", ps1packer:targetfile(), extra_args, target:targetfile(), outfile) end)Targets needing a custom load address would then set
target:values("ps1-packer.psexe.postlink.extra_args", "-tload 0x80030000")in their ownon_load.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/ps1-packer/xmake.lua` around lines 39 - 43, Make the arguments used by the ps1-packer invocation in the after_link hook configurable through a target value such as ps1-packer.psexe.postlink.extra_args, defaulting to no additional arguments, and append them alongside the existing -o output option. Preserve current behavior for targets without extra arguments while allowing targets with non-default load addresses to supply -tload explicitly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/filter-support/filter.sh:
- Around line 23-24: Update the second filter-branch tree-filter command to
enumerate third_party submodules from the Git index using git ls-files -s,
selecting mode 160000 entries while preserving the existing exclusions. Remove
each matching gitlink path with git rm -f, rather than relying on find to
discover directories in the worktree; keep the existing tag filtering and
prune-empty options unchanged.
---
Nitpick comments:
In `@tools/ps1-packer/xmake.lua`:
- Around line 39-43: Make the arguments used by the ps1-packer invocation in the
after_link hook configurable through a target value such as
ps1-packer.psexe.postlink.extra_args, defaulting to no additional arguments, and
append them alongside the existing -o output option. Preserve current behavior
for targets without extra arguments while allowing targets with non-default load
addresses to supply -tload explicitly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 97c9f4f0-8e0a-4f42-8995-213ce5d77e34
📒 Files selected for processing (4)
.github/filter-support/filter.shsrc/support/xmake.luasrc/supportpsx/xmake.luatools/ps1-packer/xmake.lua
| git filter-branch -f --tree-filter 'find third_party -maxdepth 1 -type d -and -not -name third_party -and -not -path third_party/cueparser* -and -not -path third_party/ELFIO\* -and -not -path third_party/expected\* -and -not -path third_party/fmt\* -and -not -path third_party/googletest\* -and -not -path third_party/iec-60908b\* -and -not -path third_party/magic_enum\* -and -not -path third_party/PEGTL\* -and -not -path third_party/ucl\* -exec rm -rf {} \; || true' --tag-name-filter cat --prune-empty | ||
| git filter-branch -f --tree-filter 'find third_party -maxdepth 1 -type d -and -not -name third_party -and -not -path third_party/cueparser* -and -not -path third_party/ELFIO\* -and -not -path third_party/expected\* -and -not -path third_party/fmt\* -and -not -path third_party/googletest\* -and -not -path third_party/iec-60908b\* -and -not -path third_party/magic_enum\* -and -not -path third_party/PEGTL\* -and -not -path third_party/ucl\* -exec git rm -f {} \; || true' --tag-name-filter cat --prune-empty |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Discover submodules from the index, not the working tree.
Submodules are gitlink entries, and this workflow does not initialize submodules during checkout. Their directories can therefore be absent from the tree-filter worktree, causing find to skip them and leaving unwanted third_party gitlinks in the exported history. Enumerate mode 160000 entries with git ls-files -s (while applying the same exclusions), then remove those paths with git rm -f.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/filter-support/filter.sh around lines 23 - 24, Update the second
filter-branch tree-filter command to enumerate third_party submodules from the
Git index using git ls-files -s, selecting mode 160000 entries while preserving
the existing exclusions. Remove each matching gitlink path with git rm -f,
rather than relying on find to discover directories in the worktree; keep the
existing tag filtering and prune-empty options unchanged.
No description provided.