bazel: Relativize preprocess_dts to output_dir
kconfig_gen_values.main() runs preprocess_dts() with output_dir set to a
temporary directory in /tmp before generate_edt_pickle() parses the
preprocessed zephyr.dts with cwd set to the generated repository's
output_dir.
Previously, preprocess_dts() relativized #line directives against its
own output_dir (tmp_dir), causing paths in sibling external repositories
to climb out of /tmp instead of being relative to the generated
repository root. Add a rel_base_dir parameter (passed as output_dir from
main()) and normalize edt._dt._base_dir and _included_binding_paths in
_normalize_edt_pickle() so generated DTS and pickle paths are relative
to the repository root.
Bug: 575637070
Change-Id: I63c9d65566d349bbbdaf3734d076e36dc4162977
Signed-off-by: Austin Foxley <afoxley@google.com>
Reviewed-on: https://pigweed-review.googlesource.com/c/third_party/github/zephyrproject-rtos/zephyr/+/508328
2 files changed