diff --git a/installer/steps.py b/installer/steps.py index 69dcefa0..7f6d9f4c 100644 --- a/installer/steps.py +++ b/installer/steps.py @@ -140,6 +140,17 @@ def linux_kernel(): return (int(m.group(1)), int(m.group(2))) if m else None +def link_output_locked(log): + """Whether a build failed because another program holds the exe the linker writes: ld.lld cannot write it and clang + cannot remove it (Permission denied). A game started from the temp build folder does that, and so does an + antivirus that flagged or quarantined the new totk.exe there (#1122).""" + try: + text = Path(log).read_text(encoding='utf-8', errors='replace') + except OSError: + return False + return 'failed to write output' in text and 'Permission denied' in text + + def run_tool(ctx, step, script, args, parse=None, cwd=None): """Run a tool script with the bundled Python. Its output goes to /logs/-