fix(build): the PC stays awake while a build runs #174
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!174
Loading…
Reference in a new issue
No description provided.
Delete branch "madebyjordan/LongshotLauncher:fix/build-keeps-pc-awake"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A build takes 15 to 30 minutes, hours on a first cold one, and nothing kept the PC from sleeping at its idle timeout, which stops the build half way. Now the PC stays awake while a build runs.
What changes
SetRunning.Core/KeepAwakecounts holds and takes the platform's once:ES_SYSTEM_REQUIREDand lets go on the same thread (the state is a thread's). The display may still turn off; only sleep is held off.systemd-inhibit --what=sleep:idle, holding the lock oncatreading the launcher's end of a pipe, so the lock goes with the launcher even if it crashes. Nothing is held without systemd-inhibit.Testing
Windows 11, .NET SDK 10.0.404.
python -I tests/test_launcher_core.pywith TEMP on its long path: main 1439 checks, this branch 1448.KeepAwakeCheckscovers the counting against a stand-in backend (one platform hold for two holds, let go at the last, a hold disposed twice, a failing or missing backend) and the Build page sending every running change throughSetRunning. Taking the hold out ofSetRunningfailsSetRunning does not hold the PC awake while a build runs and let it go after.This is a new behaviour rather than a regression, so there is no check commit that fails on main for a bug's reason.dotnet build: 0 errors, 0 warnings.Not tested: a real build past the idle timeout on either system, and
powercfg /requestsshowing the hold (Windows) orsystemd-inhibit --list(Linux) during one.🤖 Generated with Claude Code