This is an automated email from the ASF dual-hosted git repository.

linguini1 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new ec9a849e158 tools: add build path support on host_info tool
ec9a849e158 is described below

commit ec9a849e158aa50f99c7a750ff1a65bec0246d88
Author: Filipe Cavalcanti <[email protected]>
AuthorDate: Wed May 20 13:21:23 2026 +0200

    tools: add build path support on host_info tool
    
    Adds a build_path argument for when CMake builds are used.
    This solves a problem when building the nxdiag tool with CMake.
    
    Signed-off-by: Filipe Cavalcanti <[email protected]>
---
 tools/host_info_dump.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/tools/host_info_dump.py b/tools/host_info_dump.py
index f3101846649..8eed3178910 100755
--- a/tools/host_info_dump.py
+++ b/tools/host_info_dump.py
@@ -475,7 +475,9 @@ def generate_header(args):
             arch_chip_key
         )[-1]
         if "esp" in arch_chip:
-            vendor_specific_module_path = os.path.abspath("./tools/espressif")
+            vendor_specific_module_path = os.path.abspath(
+                args.nuttx_path + "/tools/espressif"
+            )
             sys.path.append(os.path.abspath(vendor_specific_module_path))
             vendor_specific_module = importlib.import_module("chip_info")
             get_vendor_info = getattr(vendor_specific_module, 
"get_vendor_info")
@@ -525,6 +527,16 @@ if __name__ == "__main__":
 
     parser = argparse.ArgumentParser(add_help=False)
     parser.add_argument("nuttx_path", help="NuttX source directory path.")
+    parser.add_argument(
+        "-b",
+        "--build_path",
+        help=(
+            "Build path. Required if using CMake build system.\n"
+            "If not provided, the current working directory will be used."
+        ),
+        action="store",
+        default=None,
+    )
     parser.add_argument(
         "-h",
         "--help",
@@ -584,6 +596,10 @@ if __name__ == "__main__":
         sys.exit(1)
 
     args = parser.parse_args()
-    os.chdir(args.nuttx_path)
+
+    if args.build_path is None:
+        args.build_path = args.nuttx_path
+
+    os.chdir(args.build_path)
     header = generate_header(args)
     print(header)

Reply via email to