Skip to content

Commit

Permalink
FROMPULL: scripts: zephyr_module: Tolerate symlinks
Browse files Browse the repository at this point in the history
Currently, this script will blow up when given a symlink for a path (e.g.,
to a kconfig file).

This is annoying, as when wrapping the build system in a hermetic build
system like Bazel, Bazel likes to limit the input file set by creating
symlinks.

Resolve the path, if it is a file once resolved, then it's OK.

zephyrproject-rtos/zephyr#61352

BUG=b:274648575
TEST=CQ

Change-Id: Ic002946737bb41025e09b1b5dec33fb29dab7987
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4771184
Reviewed-by: Aaron Massey <aaronmassey@google.com>
  • Loading branch information
jackrosenthal authored and Chromeos LUCI committed Aug 10, 2023
1 parent a7cda06 commit 6380844
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/zephyr_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@
def validate_setting(setting, module_path, filename=None):
if setting is not None:
if filename is not None:
checkfile = os.path.join(module_path, setting, filename)
checkfile = Path(module_path) / setting / filename
else:
checkfile = os.path.join(module_path, setting)
if not os.path.isfile(checkfile):
checkfile = Path(module_path) / setting
if not checkfile.resolve().is_file():
return False
return True

Expand Down

0 comments on commit 6380844

Please sign in to comment.