forked from espressif/esp-idf
Tools: Detect if the project is configured for a different Python
Closes https://github.com/espressif/esp-idf/issues/9993
This commit is contained in:
@@ -442,6 +442,7 @@ def ensure_build_directory(args: 'PropertyDict', prog_name: str, always_run_cmak
|
|||||||
'-G',
|
'-G',
|
||||||
args.generator,
|
args.generator,
|
||||||
'-DPYTHON_DEPS_CHECKED=1',
|
'-DPYTHON_DEPS_CHECKED=1',
|
||||||
|
'-DPYTHON={}'.format(sys.executable),
|
||||||
'-DESP_PLATFORM=1',
|
'-DESP_PLATFORM=1',
|
||||||
]
|
]
|
||||||
if args.cmake_warn_uninitialized:
|
if args.cmake_warn_uninitialized:
|
||||||
@@ -482,6 +483,15 @@ def ensure_build_directory(args: 'PropertyDict', prog_name: str, always_run_cmak
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass # if cmake failed part way, CMAKE_HOME_DIRECTORY may not be set yet
|
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:
|
def merge_action_lists(*action_lists: Dict) -> Dict:
|
||||||
merged_actions: Dict = {
|
merged_actions: Dict = {
|
||||||
|
Reference in New Issue
Block a user