Skip to content

make: add tools-check target for host toolchain sanity checks#22209

Open
maylikenoother wants to merge 2 commits intoRIOT-OS:masterfrom
maylikenoother:pr/tools-check
Open

make: add tools-check target for host toolchain sanity checks#22209
maylikenoother wants to merge 2 commits intoRIOT-OS:masterfrom
maylikenoother:pr/tools-check

Conversation

@maylikenoother
Copy link
Copy Markdown
Contributor

Motivation

RIOT builds and flashing workflows commonly fail due to missing host-side tools (e.g., Python, git, ARM toolchain, OpenOCD, pyserial).
These failures often happen late and can be confusing for new contributors.

Change

Add a new make tools-check target that:

  • checks for common tools via command -v
  • prints a clear [OK] / [MISSING] status line
  • provides a short hint for installing missing tools
  • exits non-zero if anything is missing

Tools checked:

  • python3
  • git
  • make
  • arm-none-eabi-gcc
  • openocd
  • pyserial-miniterm

How to test

Run:

make tools-check

Signed-off-by: maylikenoother <ogedengbemary19@gmail.com>
@github-actions github-actions Bot added Area: build system Area: Build system Area: tools Area: Supplementary tools labels Apr 22, 2026
@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Apr 22, 2026

I like the idea, but I fear that this is somewhat redundant to make print-versions:

RIOT$ make print-versions

RIOT version information
----------------------------
              RIOT branch: master
         RIOT commit hash: df174f0e90816b9f1850e9558d1eeacd962ec2f3
         RIOT commit date: 2026-04-22

Operating System Environment
----------------------------
         Operating System: "Ubuntu" "24.04.4 LTS (Noble Numbat)"
                   Kernel: Linux 6.8.0-101-generic x86_64 x86_64
             System shell: /usr/bin/dash (probably dash)
             make's shell: /usr/bin/dash (probably dash)

Installed compiler toolchains
-----------------------------
               native gcc: gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
        arm-none-eabi-gcc: missing
                  avr-gcc: missing
           msp430-elf-gcc: missing
       riscv-none-elf-gcc: missing
  riscv64-unknown-elf-gcc: missing
      riscv32-esp-elf-gcc: missing
  riscv32-unknown-elf-gcc: missing
     xtensa-esp32-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
   xtensa-esp32s2-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
   xtensa-esp32s3-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
   xtensa-esp8266-elf-gcc: missing
                    clang: Ubuntu clang version 18.1.3 (1ubuntu1)

Installed compiler libs
-----------------------
     arm-none-eabi-newlib: missing
        msp430-elf-newlib: missing
    riscv-none-elf-newlib: missing
riscv64-unknown-elf-newlib: missing
   riscv32-esp-elf-newlib: missing
riscv32-unknown-elf-newlib: missing
  xtensa-esp32-elf-newlib: "4.3.0"
xtensa-esp32s2-elf-newlib: "4.3.0"
xtensa-esp32s3-elf-newlib: "4.3.0"
xtensa-esp8266-elf-newlib: missing
                 avr-libc: missing (missing)

Installed development tools
---------------------------
                   ccache: missing
                    cmake: missing
                 cppcheck: missing
                  doxygen: missing
                      git: git version 2.43.0
                     make: GNU Make 4.3
                  openocd: missing
                   python: missing
                  python2: missing
                  python3: Python 3.12.3
                   rustup: rustup 1.28.2 (e4f3ad6f8 2025-04-28)
                    cargo: cargo 1.93.1 (083ac5135 2025-12-15)
                    rustc: rustc 1.93.1 (01f6ddf75 2026-02-11)
                   c2rust: missing
                     node: missing
                      npm: missing
                   flake8: error: /usr/bin/python3: No module named flake8
               coccinelle: missing

Perhaps it would be better to extend the script behind print-versions to give a summary of potential issues?

Copy link
Copy Markdown
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR. This is feature-wise pretty close to what make print-versions already does - although a bit more opinionated.

It would likely help if make print-versions would help with interpreting the output a bit more. E.g. a new user wouldn't be able to draw the conclusions whether or not the availability of a given tool in a given version will allow them to do what they want or not.

For the PR as it is, I'd rather not have that merged. I fear that this feature is too closely related to make print-versions to provide a lot of benefit in having both, but it will increase maintenance load to keep both up to date.

Comment thread makefiles/tools/targets.inc.mk Outdated
@maribu
Copy link
Copy Markdown
Member

maribu commented Apr 22, 2026

Ah, what @crasbe says 😅

Signed-off-by: maylikenoother <ogedengbemary19@gmail.com>
@github-actions github-actions Bot removed the Area: build system Area: Build system label Apr 22, 2026
@maylikenoother
Copy link
Copy Markdown
Contributor Author

I like the idea, but I fear that this is somewhat redundant to make print-versions:

RIOT$ make print-versions

RIOT version information
----------------------------
              RIOT branch: master
         RIOT commit hash: df174f0e90816b9f1850e9558d1eeacd962ec2f3
         RIOT commit date: 2026-04-22

Operating System Environment
----------------------------
         Operating System: "Ubuntu" "24.04.4 LTS (Noble Numbat)"
                   Kernel: Linux 6.8.0-101-generic x86_64 x86_64
             System shell: /usr/bin/dash (probably dash)
             make's shell: /usr/bin/dash (probably dash)

Installed compiler toolchains
-----------------------------
               native gcc: gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
        arm-none-eabi-gcc: missing
                  avr-gcc: missing
           msp430-elf-gcc: missing
       riscv-none-elf-gcc: missing
  riscv64-unknown-elf-gcc: missing
      riscv32-esp-elf-gcc: missing
  riscv32-unknown-elf-gcc: missing
     xtensa-esp32-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
   xtensa-esp32s2-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
   xtensa-esp32s3-elf-gcc: xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0
   xtensa-esp8266-elf-gcc: missing
                    clang: Ubuntu clang version 18.1.3 (1ubuntu1)

Installed compiler libs
-----------------------
     arm-none-eabi-newlib: missing
        msp430-elf-newlib: missing
    riscv-none-elf-newlib: missing
riscv64-unknown-elf-newlib: missing
   riscv32-esp-elf-newlib: missing
riscv32-unknown-elf-newlib: missing
  xtensa-esp32-elf-newlib: "4.3.0"
xtensa-esp32s2-elf-newlib: "4.3.0"
xtensa-esp32s3-elf-newlib: "4.3.0"
xtensa-esp8266-elf-newlib: missing
                 avr-libc: missing (missing)

Installed development tools
---------------------------
                   ccache: missing
                    cmake: missing
                 cppcheck: missing
                  doxygen: missing
                      git: git version 2.43.0
                     make: GNU Make 4.3
                  openocd: missing
                   python: missing
                  python2: missing
                  python3: Python 3.12.3
                   rustup: rustup 1.28.2 (e4f3ad6f8 2025-04-28)
                    cargo: cargo 1.93.1 (083ac5135 2025-12-15)
                    rustc: rustc 1.93.1 (01f6ddf75 2026-02-11)
                   c2rust: missing
                     node: missing
                      npm: missing
                   flake8: error: /usr/bin/python3: No module named flake8
               coccinelle: missing

Perhaps it would be better to extend the script behind print-versions to give a summary of potential issues?

I removed the separate tools-check target and instead extended make print-versions via dist/tools/ci/print_toolchain_versions.sh with a short “Potential issues” summary section highlighting missing/erroring key tools. Thanks!

@maylikenoother maylikenoother requested a review from maribu April 22, 2026 21:46
@maylikenoother
Copy link
Copy Markdown
Contributor Author

Good day,
Please, I have made some corrections to my PR and am open to review on it.

@maylikenoother
Copy link
Copy Markdown
Contributor Author

Hello @maribu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tools Area: Supplementary tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants