feat: rvpm dist, package Raven apps into distributable artifacts#858
Conversation
…artifacts Adds an optional [dist] manifest section (metadata, assets, linux and windows installer settings) and an 'rvpm dist' subcommand that builds the application, stages its file tree, generates each format's packaging text, and shells out to the format's tool, with install hints when a tool is missing. Archive targets need only tar or zip; deb uses dpkg-deb, rpm uses rpmbuild, msi uses WiX 3 or the WiX 4 CLI, inno uses ISCC. The msi upgrade GUID is derived stably from the package name when not pinned. Fixes #857
Strix Security Review1 open security finding on this PR:
Review summaryThe new Updated for Reviewed by Strix |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (3)
📝 WalkthroughWalkthroughAdds a new Changesrvpm dist Feature
Estimated code review effort: 4 (Complex) | ~75 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant rvpm_cli as rvpm CLI
participant ops_dist as ops::dist
participant Manifest
participant Builder as build_in
User->>rvpm_cli: rvpm dist --target deb,tar --out-dir dist/
rvpm_cli->>ops_dist: dist(project_dir, DistOptions)
ops_dist->>Manifest: load and validate [dist]
Manifest-->>ops_dist: Dist config or defaults
ops_dist->>Builder: build_in(project_dir)
Builder-->>ops_dist: built binary path
ops_dist->>ops_dist: resolve_targets and stage_tree
ops_dist-->>rvpm_cli: DistReport(outcome_lines, artifacts)
rvpm_cli-->>User: print outcome lines
Related Issues: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/v2/specs/rvpm-dist.md (1)
10-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a language to the usage fence.
Static analysis flags the
rvpm distusage block as missing a language identifier (MD040).📝 Proposed fix
-``` +```text rvpm dist [--target <t1,t2>] [--out-dir <dir>]</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.In
@docs/v2/specs/rvpm-dist.mdaround lines 10 - 12, The rvpm dist usage fence
in the spec is missing a language identifier, which triggers MD040. Update the
markdown code fence around the usage text to include a text language tag so the
fenced block is properly recognized, using the rvpm dist usage example in the
docs/spec content as the target.</details> <!-- cr-comment:v1:6f996ed84e8b950bcff00253 --> _Source: Linters/SAST tools_ </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>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@src/ops/dist.rs:
- Around line 556-600: The
wix_sourcegenerator still emits WiX 3 authoring,
butdist_msican route towix build, which expects WiX 4/5-compatible
source. Updatewix_source(and any related authoring indist_msi) to
generate WiX 4 schema and elements, or otherwise ensure thewixCLI path is
not used with this output. Use the existingwix_sourcefunction anddist_msi
flow to keep the authoring format aligned with the tool selected on PATH.
Nitpick comments:
In@docs/v2/specs/rvpm-dist.md:
- Around line 10-12: The rvpm dist usage fence in the spec is missing a language
identifier, which triggers MD040. Update the markdown code fence around the
usage text to include a text language tag so the fenced block is properly
recognized, using the rvpm dist usage example in the docs/spec content as the
target.</details> <details> <summary>🪄 Autofix (Beta)</summary> Fix all unresolved CodeRabbit comments on this PR: - [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended) - [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: defaults **Review profile**: CHILL **Plan**: Pro Plus **Run ID**: `fee91353-2c0b-41f2-9cf7-2e107ef590c3` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 6c23ea1523b711315c223921ebf27a0e026662b5 and f7c06f42f585642bfab6bcf67f652ee3ab5ea8b9. </details> <details> <summary>📒 Files selected for processing (6)</summary> * `CHANGELOG.md` * `docs/v2/specs/rvpm-dist.md` * `src/bin/rvpm.rs` * `src/manifest/mod.rs` * `src/ops/dist.rs` * `src/ops/mod.rs` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Dist text fields and the package version are written verbatim into the generated deb control file, rpm spec, and Inno Setup script. An embedded newline could inject an extra field or, for rpm and inno, a section that runs commands during packaging. Reject control characters at the manifest boundary so no backend has to trust the metadata (CWE-94). Addresses the strix-security findings on #858.
The generated WiX source uses the v3 schema (2006 namespace, <Product>). WiX 4 removed that schema, so its 'wix build' would reject the source; the code no longer tries it when the v4 CLI happens to be on PATH. candle and light (WiX 3, what the Raven toolchain release also uses) are the msi tools, with a hint that names them. WiX 4 support would emit the v4 schema and is tracked separately. Addresses the WiX compatibility finding on #858.
Fixes #857
rvpm build already produces a single static binary; this adds the step that turns it into something installable. 'rvpm dist' builds the app, stages its file tree, and produces each requested artifact.
What is in here:
Testing:
One compatibility note: an rv.toml that adds [dist] is rejected by older rvpm versions because the manifest schema denies unknown fields. Projects should adopt [dist] once they are on a release carrying this change.
Summary by CodeRabbit
rvpm distto create distributable artifacts (tar, zip, deb, rpm, msi, inno).--targetand--out-diroptions and support for an optional[dist]section to configure assets and platform installer settings.rvpm dist, including manifest behavior and packaging rules.