Skip to content

Conversation

@ZR233
Copy link
Member

@ZR233 ZR233 commented Dec 21, 2025

Add a new --debug flag to control debug behavior independently from --no-run. This separates the debugging functionality from the no-run option, allowing users to debug while still running the application. The --no-run flag now exits early without running the application, while --debug enables debug output and passes the debug flag to the underlying cargo command.

Add a new --debug flag to control debug behavior independently from --no-run.
This separates the debugging functionality from the no-run option, allowing
users to debug while still running the application. The --no-run flag now
exits early without running the application, while --debug enables debug
output and passes the debug flag to the underlying cargo command.
Copilot AI review requested due to automatic review settings December 21, 2025 01:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR separates debug functionality from the --no-run flag by introducing a dedicated --debug flag. Previously, the --no-run flag controlled both execution stopping and debug mode; now --no-run exits early without running the application, while --debug independently controls debug behavior for building and running.

  • Added a new --debug command-line flag to cargo-osrun
  • Modified --no-run to exit immediately without executing the application
  • Updated app.debug assignment from args.no_run to args.debug

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
ostool/src/bin/cargo-osrun.rs Adds --debug flag, implements early exit for --no-run, and updates debug output formatting
ostool/src/build/cargo_builder.rs Adds is_run() helper method and logic to pass debug flag to cargo command
ostool/Cargo.toml Bumps version from 0.8.5 to 0.8.6
Cargo.lock Updates version lock for ostool package to 0.8.6

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +172 to +175
if self.is_run() && self.ctx.debug {
cmd.arg("--debug");
}

Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --debug flag is not a valid cargo command-line option. Cargo builds in debug mode by default and only accepts --release to build in release mode. The logic at lines 163-165 already handles this correctly by only adding --release when debug mode is disabled. Adding --debug here will cause cargo to fail with an "unrecognized option" error.

Suggested change
if self.is_run() && self.ctx.debug {
cmd.arg("--debug");
}

Copilot uses AI. Check for mistakes.
@ZR233 ZR233 merged commit 9a3bd9d into main Dec 21, 2025
8 checks passed
@ZR233 ZR233 deleted the dev-debug branch December 21, 2025 07:25
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.

2 participants