Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: search sdkconfig path (v1.x) #109

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions idf_build_apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,22 @@ def _process_sdkconfig_files(self):
"""
res = []

# put the expanded variable files in a temporary directory
# will remove if the content is the same as the original one
expanded_dir = os.path.join(self.work_dir, 'expanded_sdkconfig_files', os.path.basename(self.build_dir))
if not os.path.isdir(expanded_dir):
os.makedirs(expanded_dir)

for f in self._sdkconfig_defaults + ([self.sdkconfig_path] if self.sdkconfig_path else []):
if not os.path.isabs(f):
f = os.path.join(self.work_dir, f)

# use filepath if abs/rel already point to itself
if not os.path.isfile(f):
LOGGER.debug('=> sdkconfig file %s not exists, skipping...', f)
continue
# find it in the app_dir
LOGGER.debug('sdkconfig file %s not found, checking under app_dir...', f)
f = os.path.join(self.app_dir, f)

if not os.path.isfile(f):
LOGGER.debug('=> sdkconfig file %s not exists, skipping...', f)
continue

expanded_fp = os.path.join(expanded_dir, os.path.basename(f))
with open(f) as fr:
Expand Down
6 changes: 3 additions & 3 deletions idf_build_apps/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
if _BUILDING_DOCS:
_idf_env = tempfile.gettempdir()
else:
_idf_env = os.getenv('IDF_PATH', '')
if not os.path.isdir(_idf_env):
raise ValueError('Invalid value for IDF_PATH: {}'.format(_idf_env))
_idf_env = os.getenv('IDF_PATH') or ''
if not _idf_env:
raise SystemExit('environment variable IDF_PATH must be set')


IDF_PATH = Path(_idf_env).resolve()
Expand Down
Loading