From 3feaea6b29197cd224fbce0ac65fd43d08c3beac Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 1 Oct 2021 18:16:53 +0300 Subject: [PATCH] Improve linker detection failure error message. --- mesonbuild/linkers/detect.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mesonbuild/linkers/detect.py b/mesonbuild/linkers/detect.py index 702bf3dcb..b85acc67f 100644 --- a/mesonbuild/linkers/detect.py +++ b/mesonbuild/linkers/detect.py @@ -115,10 +115,12 @@ def guess_win_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty prefix=comp_class.LINKER_PREFIX if use_linker_prefix else [], version=search_version(out), direct=invoked_directly) elif 'GNU coreutils' in o: + import shutil + fullpath = shutil.which(compiler[0]) raise EnvironmentException( - "Found GNU link.exe instead of MSVC link.exe. This link.exe " - "is not a linker. You may need to reorder entries to your " - "%PATH% variable to resolve this.") + f"Found GNU link.exe instead of MSVC link.exe in {fullpath}\.n" + "This link.exe is not a linker.\n" + "You may need to reorder entries to your %PATH% variable to resolve this.") __failed_to_detect_linker(compiler, check_args, o, e) def guess_nix_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Type['Compiler'],