feat(installer): add Windows MSI and Linux deb packaging infrastructure#58
feat(installer): add Windows MSI and Linux deb packaging infrastructure#58EffortlessSteven wants to merge 3 commits into
Conversation
- Linux: add prerm script to stop service before package removal - Linux: update build.sh to include prerm in deb package - Tests: add shell scripts for install path, service, and uninstall verification - Tests: add PowerShell equivalents for Windows verification - xtask: add package-windows and package-linux commands - xtask: graceful dry-run when WiX/dpkg-deb not available Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (11)
✨ 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 |
Review Summary by QodoAdd Windows MSI and Linux deb packaging infrastructure with xtask commands
WalkthroughsDescription• Add cargo xtask package-windows and package-linux commands for MSI/deb builds • Implement graceful dry-run mode when WiX or dpkg-deb tooling unavailable • Add comprehensive shell and PowerShell test scripts for install verification • Include Linux prerm script to stop service before package removal • Update Debian build.sh to include prerm in deb package metadata Diagramflowchart LR
xtask["xtask/src/main.rs<br/>Commands enum"]
package["xtask/src/package.rs<br/>Windows & Linux packaging"]
windows["WiX build.ps1<br/>MSI generation"]
linux["Debian build.sh<br/>deb generation"]
tests["Test scripts<br/>Shell & PowerShell"]
prerm["prerm script<br/>Service cleanup"]
xtask -- "PackageWindows<br/>PackageLinux" --> package
package -- "Invokes" --> windows
package -- "Invokes" --> linux
package -- "Dry-run fallback" --> tests
linux -- "Includes" --> prerm
tests -- "Verify" --> windows
tests -- "Verify" --> linux
File Changes1. xtask/src/main.rs
|
Code Review by Qodo
1.
|
| case "$1" in | ||
| remove|upgrade|deconfigure) | ||
| # Stop the user service if running under the invoking user. | ||
| # Note: systemd user services run per-user, so we attempt to stop | ||
| # via SUDO_USER if available. This is best-effort — the user may | ||
| # have already stopped the service, or it may be running under a | ||
| # different user session. | ||
| if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then | ||
| if command -v systemctl >/dev/null 2>&1; then | ||
| su - "$SUDO_USER" -c "systemctl --user stop flightd.service 2>/dev/null" || true | ||
| su - "$SUDO_USER" -c "systemctl --user disable flightd.service 2>/dev/null" || true | ||
| fi | ||
| fi |
There was a problem hiding this comment.
1. Service disabled on upgrade 🐞 Bug ⛯ Reliability
The new Debian prerm disables the systemd *user* unit not only on removal but also on upgrade. Since postinst does not re-enable the unit, an upgrade can unexpectedly leave an already-enabled Flight Hub service disabled afterward.
Agent Prompt
### Issue description
The Debian `prerm` currently disables `flightd.service` for the `upgrade` action, which can leave the service disabled after upgrading because `postinst` does not re-enable it.
### Issue Context
`prerm` is invoked during package upgrades. Disabling a systemd user unit changes persistent per-user state; upgrades should typically preserve whether the user had enabled the unit.
### Fix Focus Areas
- installer/linux/debian/prerm[8-20]
- installer/debian/postinst[11-48]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The prerm script was disabling flightd.service even during upgrades, and postinst did not re-enable it. Now the disable call only runs on remove/purge; upgrades just stop the service. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI Feedback 🧐(Feedback updated until commit 7e93ec8)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Summary
Adds missing installer/packaging infrastructure for Windows and Linux, building on the existing WiX and Debian packaging foundation.
Changes
Not included