Skip to content

Commit

Permalink
Merge branch 'fix/detect_diff_cmake_python' into 'master'
Browse files Browse the repository at this point in the history
Tools: Detect if the project is configured for a different Python

Closes IDFGH-8540

See merge request espressif/esp-idf!20672
  • Loading branch information
dobairoland committed Oct 19, 2022
2 parents a7c36fb + 2083e4d commit 818a186
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/idf_py_actions/tools.py
Expand Up @@ -442,6 +442,7 @@ def ensure_build_directory(args: 'PropertyDict', prog_name: str, always_run_cmak
'-G',
args.generator,
'-DPYTHON_DEPS_CHECKED=1',
'-DPYTHON={}'.format(sys.executable),
'-DESP_PLATFORM=1',
]
if args.cmake_warn_uninitialized:
Expand Down Expand Up @@ -482,6 +483,15 @@ def ensure_build_directory(args: 'PropertyDict', prog_name: str, always_run_cmak
except KeyError:
pass # if cmake failed part way, CMAKE_HOME_DIRECTORY may not be set yet

try:
python = cache['PYTHON']
if python != sys.executable:
raise FatalError(
"'{}' is currently active in the environment while the project was configured with '{}'. "
"Run '{} fullclean' to start again.".format(sys.executable, python, prog_name))
except KeyError:
pass


def merge_action_lists(*action_lists: Dict) -> Dict:
merged_actions: Dict = {
Expand Down

0 comments on commit 818a186

Please sign in to comment.