Filter meaningless wine errors (whining) (#374)

* filter meaningless wine errors (whining)

* alex
This commit is contained in:
Ethan Roseman
2022-02-18 14:27:12 -05:00
committed by GitHub
parent 173f85a5a3
commit 496dbf404e

View File

@@ -467,6 +467,14 @@ class CompilerWrapper:
flags.append(flag)
return " ".join(flags)
@staticmethod
def filter_compile_errors(input: str) -> str:
return (
input.replace("wine: could not load kernel32.dll, status c0000135\n", "")
.replace("wineserver: could not save registry branch to system.reg : Read-only file system\n", "")
.strip()
)
@staticmethod
@lru_cache(maxsize=settings.COMPILATION_CACHE_SIZE) # type: ignore
def compile_code(compiler: str, compiler_flags: str, code: str, context: str) -> CompilationResult:
@@ -532,7 +540,9 @@ class CompilerWrapper:
if not object_bytes:
raise CompilationError("Compiler created an empty object file")
return CompilationResult(object_path.read_bytes(), compile_proc.stderr)
compile_errors = CompilerWrapper.filter_compile_errors(compile_proc.stderr)
return CompilationResult(object_path.read_bytes(), compile_errors)
@staticmethod
def assemble_asm(platform: str, asm: Asm) -> Assembly: