From be2774dd81da77661511280fda868a02e4be87eb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Nov 2018 15:25:59 +0200 Subject: Only search for external tools (compilers, linkers, etc) in PATH Specifically, omit the current executable's directory on Windows since there is no reason for them to be found there automagically and this can lead to surprising behavior (for example, our MinGW GCC being used instead of the user's even though the user's is in PATH before ours). --- build2/cc/guess.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'build2/cc/guess.cxx') diff --git a/build2/cc/guess.cxx b/build2/cc/guess.cxx index 6ce46a2..919aeab 100644 --- a/build2/cc/guess.cxx +++ b/build2/cc/guess.cxx @@ -360,7 +360,13 @@ namespace build2 dr << info << "use config." << xm << " to override"; }); - xp = run_search (xc, false /* init */); // Note: cached. + // Only search in PATH (specifically, omitting the current + // executable's directory on Windows). + // + xp = run_search (xc, + false /* init */, // Note: result is cached. + dir_path () /* fallback */, + true /* path_only */); } using type = compiler_type; -- cgit v1.1