Launcher state folder: a durable run journal, an atomic final save, test seams out of release builds
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
Start with clean/installer/src/wg_core/record.h and install.cpp for the run journal, clean/wgshared/include/wg_state.h for settings replacement, and record.cpp plus the build targets for test seams. The issue specifies crash recovery, object identity, an editor-save interleaving test, and a release-binary check; completing and verifying all three areas requires coordinated changes across the installer, shared state code, and tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Background
PR #224 moved the settings that the launcher and the in-game menu save into the game's state folder
(wronggpu-setup\settings.ini, clean/wgshared/include/wg_state.h). It made WrongGPU's files there recognisable by their
bytes, their name and the install's id, and made a failed install, repair or update take back only what that run made (a
run journal). Three smaller points remain.
1. The run journal is in memory only
clean/installer/src/wg_core/record.h (RunJournal) and install.cpp write down each create before it happens, but only
in memory:
- A crash in the middle of an install loses the journal. A WrongGPU file the run created then has no record of being
WrongGPU's, so it is kept and listed as if it were the player's (safe, but untidy). - An entry is a path, not the created object. If another program makes or replaces that path between the create and a
rollback, the rollback deletes by path (a narrow interleaving). RollbackCreated's list of what it kept is logged, not shown to the player in the result.
Proposed:
- Write the journal to a file in the state folder, flushed before each create, and read it on the next run to finish or
undo an interrupted one. - Keep each created file's identity (volume serial and file index) or hold it open, and delete only that object.
- Return the kept list to the operation's result as a warning.
2. The settings save's last check is not atomic with the replace
wg_state.h UpdateSettings holds the file from the read to just before the move. It lets go, checks the file's
identity and last write once more (StillIdentity), then replaces it by path (MoveFileExW). An editor that saves in the
moment after the check and before the move can still lose its bytes. (A file made where none was is never replaced: that
move does not replace.)
Proposed: replace through a handle so that the check and the replace are one step. For example, rename the held file
aside through its own handle, move the new file in only where nothing is, and put the old one back if the move fails. Or
use ReplaceFileW with a backup name and compare the backup's identity afterwards. Add a test for an editor save between
the check and the move.
3. The C++ test seams are compiled into release builds
The environment-variable hooks (WRONGGPU_TEST_STOP_AT, WRONGGPU_TEST_FAIL_AT, WRONGGPU_TEST_CREATE_AT,
WRONGGPU_TEST_FAIL_AFTER_RESTORE) exist only in WRONGGPU_TESTING builds. The function-pointer seams they sit beside
are still in release builds:
wg_state.hTestFault()/Faulted();record.cppSetRestoreStepHook/RestoreStepandSetFaultHook/TestFault.
Nothing in a release build sets them, so they do nothing there, but they are code a release build does not need.
Proposed: compile them only into WRONGGPU_TESTING builds and the unit-test targets (an empty inline RestoreStep /
Faulted otherwise), with a release-build check that their names are not in the launcher.
Done when
- An interrupted install leaves a journal that the next run uses, and a rollback deletes only the objects it created
(unit tests: a crash after a create; a path replaced before the rollback). - A settings save cannot replace bytes an editor saved after WrongGPU's last check (unit test for that interleaving).
- Release builds carry none of the test seams (checked on the built launcher).
- Langage dominant
- C++
- Étoiles
- 12
- Forks
- 2
- Merge moyen
- 3 h 10 min
- PR mergées (30 j)
- 171
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de phantoslayer21/wronggpu
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
phantoslayer21/wronggpu#275 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
phantoslayer21/wronggpu#274 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
phantoslayer21/wronggpu#241 ·
Les mainteneurs répondent en général sous 1 jour
-
bug build
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
phantoslayer21/wronggpu#234 ·
Les mainteneurs répondent en général sous 1 jour
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildOuvertebug build
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
phantoslayer21/wronggpu#233 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de phantoslayer21/wronggpu
Issues similaires
-
ai_p2
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
ClickHouse/ClickHouse#132519 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
juce-framework/JUCE#1810 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
petercorke/robotics-toolbox-python#952 ·
Les mainteneurs répondent en général sous 1 jour
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusOuvertefunc:engine type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
NatronGitHub/Natron#1276 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour