diff --git a/platformio/builder/main.py b/platformio/builder/main.py index e25d4af3..a6d71fb6 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -89,12 +89,6 @@ if not int(ARGUMENTS.get("PIOVERBOSE", 0)): env = DefaultEnvironment(**DEFAULT_ENV_OPTIONS) -if env.GetOption('clean'): - env.PioClean(env.subst("$BUILD_DIR")) - env.Exit(0) -elif not int(ARGUMENTS.get("PIOVERBOSE", 0)): - print("Verbose mode can be enabled via `-v, --verbose` option") - # Load variables from CLI for key in list(clivars.keys()): if key in env: @@ -102,6 +96,12 @@ for key in list(clivars.keys()): if isinstance(env[key], bytes): env[key] = env[key].decode() +if env.GetOption('clean'): + env.PioClean(env.subst("$BUILD_DIR")) + env.Exit(0) +elif not int(ARGUMENTS.get("PIOVERBOSE", 0)): + print("Verbose mode can be enabled via `-v, --verbose` option") + env.GetProjectConfig().validate([env['PIOENV']], silent=True) env.LoadProjectOptions() env.LoadPioPlatform() diff --git a/platformio/commands/debug/process.py b/platformio/commands/debug/process.py index 68d76d00..a9064492 100644 --- a/platformio/commands/debug/process.py +++ b/platformio/commands/debug/process.py @@ -12,13 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os - import click from twisted.internet import protocol # pylint: disable=import-error from platformio.commands.debug import helpers from platformio.compat import string_types +from platformio.proc import get_pythonexe_path from platformio.project.helpers import get_project_core_dir LOG_FILE = None @@ -31,7 +30,7 @@ class BaseProcess(protocol.ProcessProtocol, object): COMMON_PATTERNS = { "PLATFORMIO_HOME_DIR": helpers.escape_path(get_project_core_dir()), "PLATFORMIO_CORE_DIR": helpers.escape_path(get_project_core_dir()), - "PYTHONEXE": os.getenv("PYTHONEXEPATH", "") + "PYTHONEXE": get_pythonexe_path() } def apply_patterns(self, source, patterns=None):