HLE: honor the requested executable on relaunch #455

Manually merged
github merged 2 commits from gh-pr/455/head into gh-pr/455/base 2026-11-26 04:04:41 +00:00
Owner

@⁠Quat3rnion on GitHub · 2026-11-24 03:37 UTC · original
Quat3rnion:victory-relaunch-args → main · +82 −8 · 1 files · 2 commits · merged 2026-11-25 00:10 UTC

What

runtime::set_image_path makes the title image path absolute, but
relaunch_args searched the raw command line for that exact string. After
victory run game.exe --execute, an XLaunchNewGame request for a different
executable found no match and silently reran game.exe. This normalises the
launch argument the same way runtime does before replacing it, so relative
startup paths work and the requested executable is used.

The same helper split the title's arguments with split_whitespace, which
broke quoted paths from the title's configuration. A small splitter keeps
quoted strings together, including empty arguments. The child process gets
those as separate argv entries; lifecycle::relaunch already passes them
through with Command::args and does not re-split.

An AI tool wrote part of this change.

Tested

  • Linux: cargo test --workspace: 165 passed, 0 failed, 3 ignored. The existing argv test still passes; a new regression uses a relative startup path, a different target, and a quoted path plus an empty argument.
  • Windows cross-build: cargo check --target x86_64-pc-windows-gnu --workspace --tests passes. No Windows host here, so the spawned child was not run.
  • cargo xtask policy passes (150 files ok). No game files or data from them were added.
  • Not tested: a real title's XLaunchNewGame call; the regression is at the argument-building layer.

Checklist

  • Workspace tests and Windows cross-check pass.
  • cargo xtask policy passes. No game files or data from them were added.
  • AI authorship is disclosed above.
**@⁠Quat3rnion** on GitHub · 2026-11-24 03:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/455) `Quat3rnion:victory-relaunch-args` → `main` · +82 −8 · 1 files · 2 commits · merged 2026-11-25 00:10 UTC ## What `runtime::set_image_path` makes the title image path absolute, but `relaunch_args` searched the raw command line for that exact string. After `victory run game.exe --execute`, an `XLaunchNewGame` request for a different executable found no match and silently reran `game.exe`. This normalises the launch argument the same way `runtime` does before replacing it, so relative startup paths work and the requested executable is used. The same helper split the title's arguments with `split_whitespace`, which broke quoted paths from the title's configuration. A small splitter keeps quoted strings together, including empty arguments. The child process gets those as separate argv entries; `lifecycle::relaunch` already passes them through with `Command::args` and does not re-split. An AI tool wrote part of this change. ## Tested - Linux: `cargo test --workspace`: 165 passed, 0 failed, 3 ignored. The existing argv test still passes; a new regression uses a relative startup path, a different target, and a quoted path plus an empty argument. - Windows cross-build: `cargo check --target x86_64-pc-windows-gnu --workspace --tests` passes. No Windows host here, so the spawned child was not run. - `cargo xtask policy` passes (150 files ok). No game files or data from them were added. - Not tested: a real title's `XLaunchNewGame` call; the regression is at the argument-building layer. ## Checklist - [x] Workspace tests and Windows cross-check pass. - [x] `cargo xtask policy` passes. No game files or data from them were added. - [x] AI authorship is disclosed above.
runtime stores an absolute image path while relaunch_args searched raw CLI arguments for exact text, so a relative launch argument made XLaunchNewGame silently rerun the old title. Normalize the argument the same way runtime does before replacing it. Also split the title's quoted config args into proper arguments instead of split_whitespace. Add a regression covering a relative startup path, a different target and quoted/empty args.
Windows command lines quote only with double quotes. split_args treated an apostrophe as a quote too, so -name=O'Brien swallowed the following argument. Only toggle on ", and add the apostrophe case to the relaunch test (review note on #455).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:04:39 +00:00
github manually merged commit eb8067f2ea into gh-pr/455/base 2026-11-26 04:04:41 +00:00
Author
Owner

@⁠Quat3rnion on GitHub · 2026-11-24 07:30 UTC · original

Rebased on current main. Fixed split_args to quote only on double quotes; apostrophes are ordinary text. Added -name=O'Brien to the regression. New head a9bc94e.

**@⁠Quat3rnion** on GitHub · 2026-11-24 07:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/455#issuecomment-7125059426) Rebased on current main. Fixed split_args to quote only on double quotes; apostrophes are ordinary text. Added -name=O'Brien to the regression. New head a9bc94e.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!455
No description provided.