launcher: remove commented-out base flags from run environment #34

Merged
ahmetbagci8 merged 1 commit from upstream-pr/34 into dev 2026-11-29 13:20:48 +00:00
ahmetbagci8 commented 2026-11-29 12:34:23 +00:00 (Migrated from github.com)

Imported from edsuuu/VI-BR-PORT. Originally posted by ahmetbagci8 on 2026-11-29T12:34:23Z.


Problem

In pps/vi-launcher, the Settings flags box displays the build's ase switches via lags::with_base. When a user comments out a base switch (e.g. # VICTORY_NO_WATCHDOG=1), lags::from_text parses it with enabled: false and lags::without_base keeps it in config.flags as enabled: false so it stays commented out in the UI.

However, options::run (pps/vi-launcher/src/options.rs:214) filters yped.iter().filter(|f| f.enabled && ...) and ignores enabled: false flags completely. As a result, ase.base.clone() leaves the commented-out base switch active in Run.env.

Fix

In options::run, map disabled (enabled: false) flags with a valid name to an empty value so env.insert(k, String::new()) + env.retain(|_, v| !v.is_empty()) removes them from Run.env (matching deleted base switches). Added unit test commented_out_base_flag_is_removed_from_run_env.

Verification

  • cargo test -p vi-launcher options (9 passed, 0 failed)
  • cargo clippy -p vi-launcher --tests (0 warnings)
<!-- greyfinch-sync:edsuuu/VI-BR-PORT:issue:5550750376 --> Imported from [edsuuu/VI-BR-PORT](https://github.com/edsuuu/VI-BR-PORT/pull/34). Originally posted by [ahmetbagci8](https://github.com/ahmetbagci8) on 2026-11-29T12:34:23Z. --- ## Problem In pps/vi-launcher, the Settings flags box displays the build's ase switches via lags::with_base. When a user comments out a base switch (e.g. # VICTORY_NO_WATCHDOG=1), lags::from_text parses it with enabled: false and lags::without_base keeps it in config.flags as enabled: false so it stays commented out in the UI. However, options::run (pps/vi-launcher/src/options.rs:214) filters yped.iter().filter(|f| f.enabled && ...) and ignores enabled: false flags completely. As a result, ase.base.clone() leaves the commented-out base switch active in Run.env. ## Fix In options::run, map disabled (enabled: false) flags with a valid name to an empty value so env.insert(k, String::new()) + env.retain(|_, v| !v.is_empty()) removes them from Run.env (matching deleted base switches). Added unit test commented_out_base_flag_is_removed_from_run_env. ## Verification - cargo test -p vi-launcher options (9 passed, 0 failed) - cargo clippy -p vi-launcher --tests (0 warnings)
edsuuu commented 2026-11-29 13:20:46 +00:00 (Migrated from github.com)

Imported from edsuuu/VI-BR-PORT. Originally posted by edsuuu on 2026-11-29T13:20:46Z.

Review: APPROVED


Thanks, clean and well tested. It passed our full local CI together with the other fixes of this batch. Merged into dev, where everything is tested in the game first; it reaches main with the next release.

<!-- greyfinch-sync:edsuuu/VI-BR-PORT:review:6103050419 --> Imported from [edsuuu/VI-BR-PORT](https://github.com/edsuuu/VI-BR-PORT/pull/34#pullrequestreview-6103050419). Originally posted by [edsuuu](https://github.com/edsuuu) on 2026-11-29T13:20:46Z. **Review:** APPROVED --- Thanks, clean and well tested. It passed our full local CI together with the other fixes of this batch. Merged into `dev`, where everything is tested in the game first; it reaches `main` with the next release.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
edsuuu/VI-BR-PORT!34
No description provided.