From 0ae911d893485c4b4c5f90f9d6b5f820dc1f7672 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 26 Nov 2019 12:31:46 -0800 Subject: environment: Add a special error case for getting GNU link.exe Since I spent three days banging my head against this it seems reasonable that other people might also run into this problem. It can happen if you're trying to use microsoft's link.exe, but also have the dmd bin directory at the tail of your %PATH%, among other reasons. --- mesonbuild/environment.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mesonbuild') diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 83c6935..4c07e58 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -781,6 +781,11 @@ class Environment: for_machine, [], machine=target, exelist=compiler, prefix=comp_class.LINKER_PREFIX if use_linker_prefix else [], version=search_version(out)) + elif 'GNU coreutils' in o: + 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.") raise EnvironmentException('Unable to determine dynamic linker') def _guess_nix_linker(self, compiler: typing.List[str], comp_class: typing.Type[Compiler], -- cgit v1.1