docs: Re-run the 'set-target' target each time, use a unique sdkconfig file for each lang/target combo

Fixes some problems with CMake errors in stale builds, and of sdkconfig file being shared between
parallel jobs.
pull/2405/merge
Angus Gratton 2020-02-07 15:36:14 +11:00 zatwierdzone przez Angus Gratton
rodzic 54e7cb4d8b
commit 2c03d2cc4e
1 zmienionych plików z 12 dodań i 7 usunięć

Wyświetl plik

@ -7,6 +7,7 @@
# Then emits the new 'idf-info' event which has information read from IDF
# build system, that other extensions can use to generate relevant data.
import os.path
import shutil
import sys
import subprocess
import json
@ -61,15 +62,19 @@ def generate_idf_info(app, config):
"-B",
cmake_build_dir,
"-C",
project_path]
if not os.path.exists(os.path.join(cmake_build_dir, "CMakeCache.txt")):
# if build directory not created yet, run a reconfigure pass over it
print("Starting new dummy IDF project... w")
subprocess.check_call(idf_py + ["set-target", app.config.idf_target])
else:
print("Re-running CMake on the existing IDF project in {}".format(cmake_build_dir))
project_path,
"-D",
"SDKCONFIG={}".format(os.path.join(build_dir, "dummy_project_sdkconfig"))
]
# force a clean idf.py build w/ new sdkconfig each time
# (not much slower than 'reconfigure', avoids any potential config & build versioning problems
shutil.rmtree(cmake_build_dir, ignore_errors=True)
print("Starting new dummy IDF project... ")
subprocess.check_call(idf_py + ["set-target", app.config.idf_target])
print("Running CMake on dummy project...")
subprocess.check_call(idf_py + ["reconfigure"])
with open(os.path.join(cmake_build_dir, "project_description.json")) as f:
project_description = json.load(f)
if project_description["target"] != app.config.idf_target: