fix(builder): the earlier settings are carried into a profile whose settings.ini holds only the language #3018

Closed
PedroRossi wants to merge 2 commits from PedroRossi/Longshot:fix/carry-settings into main
Contributor

Summary

A player moving to launcher profiles keeps their saves but silently gets the default settings. At a profile's first
play, carry_saves (build-driver/src/play.rs) copies the earlier saves and settings in, but the settings only when the
profile has no settings.ini, and one holding only game_language= is often there already: the launcher's Game
language row writes it, and so does a build that names a language (carry_saves runs at the start of the first
play). The copy doesn't happen. The game's own rule (host/options_path.c has_settings) treats such a file as "no settings yet";
carry_saves now takes the same rule (language_only): a file with no line but game_language= and
compile_shaders= gets the earlier settings, its language line kept after them. A file that can't be read is left
alone.

How to see it on main: take a game folder from before profiles whose longshot_options.ini holds changed settings, with
a save, and play it with a new profile from the launcher: the profile's settings.ini stays game_language= alone, and
the game runs at the defaults.

As before, the copy runs only while the profile's saves/ is empty and an earlier folder has a save: a player with
settings and no save still gets none carried (not changed here).

Not changed here, and worth fixes of their own: settings with no save are never carried, and on Linux a game folder from before profiles keeps its settings beside the game (longshot_options.ini), not with the saves in ~/.local/share/longshot that carry_saves copies from, so they aren't carried either.

Read first: language_only and its use in carry_saves.

Testing

Tested: game-free: the new test (a_profile_with_only_a_language_line_still_gets_the_earlier_settings) fails on main
and passes here; build-driver's tests, clippy -D warnings, rustfmt. As pr create asks for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with #3018, #3020 and #3021 merged, through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The profile code this changes runs in the launcher's play and build, not in the game. mise run test (--strict) on main @ 1938a302, and on main with this change merged (together with #3017, #3019, #3020, #3021, #3022, from the same audit): 775 passed, 145 failed, 10 skipped both ways, so none fails only with it. The 145 are named at the end.

Still to test:

  • Linux or Windows, by hand: a game folder from before profiles (v3.0.0-rc.7) with changed settings and a save, played
    with a new profile from the launcher, expecting the profile's settings.ini to hold those settings and the language

Measurements

Nothing to measure: one small file copied at a profile's first play.

Risks

Only a profile whose saves are still empty at its first play gets the copy, as before; a profile already played keeps
what it has. A revert undoes it.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
The 145 checks of mise run test that fail on main @ 1938a302 on this PC too, with or without this change

97 need a tool this PC doesn't have on PATH (--strict fails them):

  • clang (63): test_audio_output_devices.py, test_box_light_reuse.py, test_camera_centering.py, test_camera_speed.py, test_drive_target.py, test_dynres_sites.py, test_exclusive_marks.py, test_fixed_scale_sites.py, test_floor_carry_step.py, test_frame_rate_cap_step.py, test_frame_whole.py, test_free_view_anchor.py, test_fullscreen_monitor_platform.py, test_high_fps_fixes.py, test_horse_jump_step.py, test_hos_ab.py, test_hud_layout.py, test_jump_takeoff_step.py, test_linux_audio_output.py, test_loop_step.py, test_menu_hooks.py, test_microphone_test_gain.py, test_monitor_friendly_names.py, test_mouse_native.py, test_movement_speed.py, test_movie_frame_count.py, test_nvn_null_pool.py, test_nvn_tex_builder_guard.py, test_ocarina_wait.py, test_ocb_hold.py, test_oot_barrier.py, test_oot_camera_clearance.py, test_oot_cloth.py, test_oot_cloth_60.py, test_oot_cloth_time.py, test_oot_damage.py, test_oot_fov.py, test_oot_heap_retry.py, test_oot_jitter.py, test_oot_shadow.py, test_oot_shadow_fit.py, test_oot_transition_autosave.py, test_oot_voice_option.py, test_oot_wide_bubble.py, test_oot_wide_save_picture.py, test_player_update_sites.py, test_sampler_stack_walk.py, test_saved_turn_rate.py, test_scarecrow_timing.py, test_scene_format.py, test_sdl_monitor_names.py, test_shadow_slot.py, test_song_note_cue.py, test_sound_held_frames.py, test_sprint.py, test_svc_core_mask.py, test_tex_compact.py, test_text_speed.py, test_title_card_sites.py, test_water_substeps.py, test_web_floor_steps.py, test_wide_sites.py, test_wide_ui.py
  • spirv-val (20): f2i_immediate, global_load_16, native_suatom, test_coop_spirv.py, test_default_point_size.py, test_depth_sample_types.py, test_draw_parameters.py, test_fsr4_tune.py, test_guest_page_fast32.py, test_image_arrays.py, test_mesh_fallback_layout.py, test_mesh_unreachable_outputs.py, test_mma_software.py, test_native_float_atomic_add.py, test_nonuniform_image_arrays.py, test_spirv_struct_identity.py, test_texture_phi_dominance.py, test_unsigned_image_types.py, test_vendor_translation.py, test_wmma16_spirv_val.py
  • clang++ (7): test_dead_targets_sweep.py, test_lower_depbar.py, test_lower_lds_after_sts.py, test_lower_register_markers.py, test_native_suatom.py, test_program_answer_domains.py, test_target_pool_cap.py
  • glslang (5): test_framegen_hdr.py, test_fsr3fi_hud_layer.py, test_fsr3fi_hudless_colour.py, test_host_shaders.py, test_temporal_present_bandwidth.py
  • glslang, spirv-val (1): test_fsr3_shaders.py
  • llvm-mc (1): test_lifter.py

48 fail on main itself: test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_framegen_resources.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_input_background.py, test_keyboard_option.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_oot_occ_raster.py, test_option_ids.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recording_admission.py, test_screensaver.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_upscaler_round_trip.py, test_vram_compact.py, test_windows_display_startup.py, test_windows_on_linux.py


Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them.

Co-Authored-By: Claude Opus 5.5 [email protected]

🤖 Generated with Claude Code

## Summary A player moving to launcher profiles keeps their saves but silently gets the default settings. At a profile's first play, `carry_saves` (`build-driver/src/play.rs`) copies the earlier saves and settings in, but the settings only when the profile has no `settings.ini`, and one holding only `game_language=` is often there already: the launcher's Game language row writes it, and so does a build that names a language (`carry_saves` runs at the start of the first play). The copy doesn't happen. The game's own rule (`host/options_path.c` `has_settings`) treats such a file as "no settings yet"; `carry_saves` now takes the same rule (`language_only`): a file with no line but `game_language=` and `compile_shaders=` gets the earlier settings, its language line kept after them. A file that can't be read is left alone. How to see it on main: take a game folder from before profiles whose `longshot_options.ini` holds changed settings, with a save, and play it with a new profile from the launcher: the profile's `settings.ini` stays `game_language=` alone, and the game runs at the defaults. As before, the copy runs only while the profile's `saves/` is empty and an earlier folder has a save: a player with settings and no save still gets none carried (not changed here). Not changed here, and worth fixes of their own: settings with no save are never carried, and on Linux a game folder from before profiles keeps its settings beside the game (`longshot_options.ini`), not with the saves in `~/.local/share/longshot` that `carry_saves` copies from, so they aren't carried either. Read first: `language_only` and its use in `carry_saves`. ## Testing **Tested:** game-free: the new test (`a_profile_with_only_a_language_line_still_gets_the_earlier_settings`) fails on main and passes here; build-driver's tests, clippy -D warnings, rustfmt. As `pr create` asks for a builder change: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with #3018, #3020 and #3021 merged, through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The profile code this changes runs in the launcher's play and build, not in the game. `mise run test` (`--strict`) on main @ 1938a302, and on main with this change merged (together with #3017, #3019, #3020, #3021, #3022, from the same audit): 775 passed, 145 failed, 10 skipped both ways, so none fails only with it. The 145 are named at the end. **Still to test:** - Linux or Windows, by hand: a game folder from before profiles (v3.0.0-rc.7) with changed settings and a save, played with a new profile from the launcher, expecting the profile's settings.ini to hold those settings and the language ## Measurements Nothing to measure: one small file copied at a profile's first play. ## Risks Only a profile whose saves are still empty at its first play gets the copy, as before; a profile already played keeps what it has. A revert undoes it. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. <details><summary>The 145 checks of <code>mise run test</code> that fail on main @ 1938a302 on this PC too, with or without this change</summary> 97 need a tool this PC doesn't have on PATH (`--strict` fails them): - clang (63): test_audio_output_devices.py, test_box_light_reuse.py, test_camera_centering.py, test_camera_speed.py, test_drive_target.py, test_dynres_sites.py, test_exclusive_marks.py, test_fixed_scale_sites.py, test_floor_carry_step.py, test_frame_rate_cap_step.py, test_frame_whole.py, test_free_view_anchor.py, test_fullscreen_monitor_platform.py, test_high_fps_fixes.py, test_horse_jump_step.py, test_hos_ab.py, test_hud_layout.py, test_jump_takeoff_step.py, test_linux_audio_output.py, test_loop_step.py, test_menu_hooks.py, test_microphone_test_gain.py, test_monitor_friendly_names.py, test_mouse_native.py, test_movement_speed.py, test_movie_frame_count.py, test_nvn_null_pool.py, test_nvn_tex_builder_guard.py, test_ocarina_wait.py, test_ocb_hold.py, test_oot_barrier.py, test_oot_camera_clearance.py, test_oot_cloth.py, test_oot_cloth_60.py, test_oot_cloth_time.py, test_oot_damage.py, test_oot_fov.py, test_oot_heap_retry.py, test_oot_jitter.py, test_oot_shadow.py, test_oot_shadow_fit.py, test_oot_transition_autosave.py, test_oot_voice_option.py, test_oot_wide_bubble.py, test_oot_wide_save_picture.py, test_player_update_sites.py, test_sampler_stack_walk.py, test_saved_turn_rate.py, test_scarecrow_timing.py, test_scene_format.py, test_sdl_monitor_names.py, test_shadow_slot.py, test_song_note_cue.py, test_sound_held_frames.py, test_sprint.py, test_svc_core_mask.py, test_tex_compact.py, test_text_speed.py, test_title_card_sites.py, test_water_substeps.py, test_web_floor_steps.py, test_wide_sites.py, test_wide_ui.py - spirv-val (20): f2i_immediate, global_load_16, native_suatom, test_coop_spirv.py, test_default_point_size.py, test_depth_sample_types.py, test_draw_parameters.py, test_fsr4_tune.py, test_guest_page_fast32.py, test_image_arrays.py, test_mesh_fallback_layout.py, test_mesh_unreachable_outputs.py, test_mma_software.py, test_native_float_atomic_add.py, test_nonuniform_image_arrays.py, test_spirv_struct_identity.py, test_texture_phi_dominance.py, test_unsigned_image_types.py, test_vendor_translation.py, test_wmma16_spirv_val.py - clang++ (7): test_dead_targets_sweep.py, test_lower_depbar.py, test_lower_lds_after_sts.py, test_lower_register_markers.py, test_native_suatom.py, test_program_answer_domains.py, test_target_pool_cap.py - glslang (5): test_framegen_hdr.py, test_fsr3fi_hud_layer.py, test_fsr3fi_hudless_colour.py, test_host_shaders.py, test_temporal_present_bandwidth.py - glslang, spirv-val (1): test_fsr3_shaders.py - llvm-mc (1): test_lifter.py 48 fail on main itself: test_blocks_at_start.py, test_bug_report.py, test_cloth_kernels.py, test_cloth_loops.py, test_cloth_sphere.py, test_cloth_step12.py, test_cloth_step8.py, test_cloth_step9.py, test_control_picture.py, test_crash_record.py, test_crt_options.py, test_dev_update.py, test_dlssg_pace.py, test_draw_stream_visibility.py, test_framegen_resources.py, test_fsr_uniform_ownership.py, test_game_boundary.py, test_guest_holes.py, test_image_reaper_threads.py, test_image_view_retry.py, test_input_background.py, test_keyboard_option.py, test_linux_pressure.py, test_loaded_modules_drop.py, test_log_levels.py, test_menu_keys.py, test_menu_save_atomic.py, test_mesh_first_types.py, test_oot_occ_raster.py, test_option_ids.py, test_perf_send.py, test_pipeline_tour.py, test_present_acquire_ahead.py, test_present_image_free.py, test_present_source_crop.py, test_program_cache_cleanup.py, test_program_cache_one_variant.py, test_readback_timeout_reuse.py, test_recording_admission.py, test_screensaver.py, test_switch_table.py, test_target_retention.py, test_tex_desc_memo.py, test_thinlto_tls.py, test_upscaler_round_trip.py, test_vram_compact.py, test_windows_display_startup.py, test_windows_on_linux.py </details> --- Found in an AI-assisted audit of the repository. The test, the fix, the runs and this description were made with Claude Code; I reviewed them. Co-Authored-By: Claude Opus 5.5 <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
carry_saves copies the earlier settings into a profile only when it has no settings.ini, but every build writes one
holding only game_language= before the game first starts: a player moving to profiles gets their saves and the
default settings, every time. Fails on main for that reason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): the earlier settings are carried into a profile whose settings.ini holds only the language
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
68561584b8
carry_saves takes the game's own rule (host/options_path.c has_settings): a settings file with no line but
game_language= and compile_shaders= holds none of the player's settings (language_only). The earlier file is copied
over it, the language chosen before the first start kept after it; a file that can't be read is left alone. The docs
(build.md, saves.md) say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with this change merged (and my two other builder pull requests from the same audit), through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The profile code this changes runs in the launcher's play and build, not in the game.

Tested in game: Debian 13, GeForce GTX 1660 SUPER, NVIDIA 550.163.01: the game built by a builder from main @ 1938a302 with this change merged (and my two other builder pull requests from the same audit), through the PC's job queue, played from the Market entrance repository save, then the control bridge's quit; exit 0. The profile code this changes runs in the launcher's play and build, not in the game.
PedroRossi changed title from WIP: fix(builder): the earlier settings are carried into a profile whose settings.ini holds only the language to fix(builder): the earlier settings are carried into a profile whose settings.ini holds only the language 2026-12-02 17:54:11 +00:00
Owner

Settings file has been completely rebuild on mod-api branch (merging soon), please test this there and re-open if still present!

Settings file has been completely rebuild on `mod-api` branch (merging soon), please test this there and re-open if still present!
HumanBean closed this pull request 2026-12-02 21:37:03 +00:00
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!3018
No description provided.