From 0646ffc93f9d7036422c28cf46fda13768e7d033 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 3 Aug 2015 12:53:21 +0300 Subject: [PATCH] Restore process $PATH for SCons --- platformio/builder/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platformio/builder/main.py b/platformio/builder/main.py index d74f6c50..ca4e8881 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -123,10 +123,13 @@ for opt in ("LIB_IGNORE", "LIB_USE"): continue env[opt] = [l.strip() for l in env[opt].split(",") if l.strip()] -env.PrependENVPath( - "PATH", - env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN", "bin")) -) +# restore process $PATH +env['ENV']['PATH'] = getenv("PATH") +if env.subst("$PIOPACKAGE_TOOLCHAIN"): + env.PrependENVPath( + "PATH", + env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN", "bin")) + ) SConscriptChdir(0) SConscript(env.subst("$BUILD_SCRIPT"))