Skip to content

CMakeLists.txt: Build the ArduinoCore-API implementations#149

Merged
DhruvaG2000 merged 2 commits intozephyrproject-rtos:nextfrom
soburi:build_api
Feb 5, 2026
Merged

CMakeLists.txt: Build the ArduinoCore-API implementations#149
DhruvaG2000 merged 2 commits intozephyrproject-rtos:nextfrom
soburi:build_api

Conversation

@soburi
Copy link
Copy Markdown
Member

@soburi soburi commented Feb 1, 2026

  • Build ArduinoCore-API files. These licenses were clarified with the introduction of west blobs.
  • Fix the Rust API implementation build by referencing ArduinoCore-API in Rust builds.

@soburi soburi marked this pull request as ready for review February 1, 2026 13:47
Copilot AI review requested due to automatic review settings February 1, 2026 13:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces support for building ArduinoCore-API implementation files and adds infrastructure improvements for board variant handling. The main focus is enabling the build system to compile ArduinoCore-API source files when not using the Rust implementation, while maintaining compatibility with the Rust-based implementation path.

Changes:

  • Added compilation of seven ArduinoCore-API C++ source files (CanMsg, CanMsgRingbuffer, Common, IPAddress, Print, Stream, String) for non-Rust builds
  • Improved board variant directory resolution with double underscore normalization and support for board revision-specific overlay files
  • Refined conditional compilation in cores/arduino to properly handle Rust vs C++ implementation paths

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

File Description
CMakeLists.txt Added ArduinoCore-API source files to build, improved variant directory lookup with normalization, and included ArduinoCore-API headers for both Rust and non-Rust paths
cores/arduino/CMakeLists.txt Made zephyrPrint.cpp and apiCommon.cpp conditional on Rust implementation usage
cores/arduino/Arduino.h Changed api/ArduinoAPI.h include from angle brackets to quotes and removed zephyrPrint.h include
samples/*/CMakeLists.txt (10 files) Added support for board revision-specific overlay files with fallback to base overlay files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@soburi soburi marked this pull request as ready for review February 3, 2026 12:18
@DhruvaG2000
Copy link
Copy Markdown
Member

Doesn't build with this branch on my local setup either:

 $ west blobs --auto-accept fetch arduinocore-zephyr                                                                                                             [18:40:35]
Fetching blob arduinocore-zephyr: /home/dhruva/zephyrproject/modules/lib/ArduinoCore-Zephyr/zephyr/blobs/ArduinoCore-API/api/ArduinoAPI.h
Traceback (most recent call last):
  File "/home/dhruva/zephyrproject/.venv/bin/west", line 8, in <module>
    sys.exit(main())
  File "/home/dhruva/zephyrproject/.venv/lib/python3.10/site-packages/west/app/main.py", line 1176, in main
    app.run(argv or sys.argv[1:])
  File "/home/dhruva/zephyrproject/.venv/lib/python3.10/site-packages/west/app/main.py", line 255, in run
    self.run_command(argv, early_args)
  File "/home/dhruva/zephyrproject/.venv/lib/python3.10/site-packages/west/app/main.py", line 561, in run_command
    self.run_extension(args.command, argv)
  File "/home/dhruva/zephyrproject/.venv/lib/python3.10/site-packages/west/app/main.py", line 716, in run_extension
    self.cmd.run(args, unknown, self.topdir, manifest=self.manifest,
  File "/home/dhruva/zephyrproject/.venv/lib/python3.10/site-packages/west/commands.py", line 194, in run
    self.do_run(args, unknown)
  File "/home/dhruva/zephyrproject/zephyr/scripts/west_commands/blobs.py", line 346, in do_run
    subcmd(args)
  File "/home/dhruva/zephyrproject/zephyr/scripts/west_commands/blobs.py", line 291, in fetch
    if blob['click-through'] and not args.auto_accept:
KeyError: 'click-through'

Had to hack something locally to make it fetch:

diff --git a/scripts/west_commands/blobs.py b/scripts/west_commands/blobs.py
index 14f0412cda5f..d16bf0c55d55 100644
--- a/scripts/west_commands/blobs.py
+++ b/scripts/west_commands/blobs.py
@@ -288,7 +288,7 @@ class Blobs(WestCommand):
                 continue
             self.inf(f"Fetching blob {blob['module']}: {blob['abspath']}")

-            if blob['click-through'] and not args.auto_accept:
+            if blob.get('click-through', False) and not args.auto_accept:
                 while True:
                     user_input = input(
                         "For this blob, need to read and accept "

@DhruvaG2000
Copy link
Copy Markdown
Member

ok so you're fixing that issue here: #154 ?

@soburi
Copy link
Copy Markdown
Member Author

soburi commented Feb 3, 2026

@DhruvaG2000

ok so you're fixing that issue here: #154 ?

yes. #154 solve this issue.

With the introduction of `west blobs`, the licensing situation is now clear,
so we can include the ArduinoCore-API implementations in the build.

Exclude `zephyrPrint.cpp` as it conflicts with the API implementations.
Also exclude `apiCommon.cpp`, which is only used by the Rust build.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Fix the Rust API implementation build by referencing
ArduinoCore-API in Rust builds.

For licensing reasons, we plan to provide an alternative API
implementation for the Rust build in the future.
Until then, use ArduinoCore-API.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
@DhruvaG2000 DhruvaG2000 merged commit b16b96f into zephyrproject-rtos:next Feb 5, 2026
3 checks passed
@soburi soburi deleted the build_api branch February 5, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants