Skip to content

Commit

Permalink
linkers: better reporting of command failures
Browse files Browse the repository at this point in the history
Use join_args to ensure that commands are rendered correctly and with
less code.
  • Loading branch information
eli-schwartz authored and nirbheek committed Aug 8, 2022
1 parent a18009e commit fa22cee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mesonbuild/linkers/detect.py
Expand Up @@ -16,7 +16,7 @@

from ..mesonlib import (
EnvironmentException, OptionKey,
Popen_safe, search_version
Popen_safe, join_args, search_version
)
from .linkers import (
AppleDynamicLinker,
Expand Down Expand Up @@ -51,8 +51,8 @@
defaults['clang_static_linker'] = ['llvm-ar']

def __failed_to_detect_linker(compiler: T.List[str], args: T.List[str], stdout: str, stderr: str) -> 'T.NoReturn':
msg = 'Unable to detect linker for compiler "{} {}"\nstdout: {}\nstderr: {}'.format(
' '.join(compiler), ' '.join(args), stdout, stderr)
msg = 'Unable to detect linker for compiler `{}`\nstdout: {}\nstderr: {}'.format(
join_args(compiler + args), stdout, stderr)
raise EnvironmentException(msg)


Expand Down

0 comments on commit fa22cee

Please sign in to comment.