Skip to content

Fix/ament clang tools windows support#563

Open
tony-p wants to merge 5 commits intoament:rollingfrom
tony-p:fix/ament-clang-tools-windows-support
Open

Fix/ament clang tools windows support#563
tony-p wants to merge 5 commits intoament:rollingfrom
tony-p:fix/ament-clang-tools-windows-support

Conversation

@tony-p
Copy link
Copy Markdown

@tony-p tony-p commented Nov 20, 2025

Fixes bug that ament clang tools don't work on windows

Credit to @traversaro for pointing to the proposed fix

… and move to common implementation in ament_lint

Signed-off-by: Tony Paulussen <tony.paulussen@wefabricate.com>
…ang* execution

Signed-off-by: Tony Paulussen <tony.paulussen@wefabricate.com>
@tony-p tony-p force-pushed the fix/ament-clang-tools-windows-support branch from f7ccc78 to 5568e8f Compare November 20, 2025 13:26
Comment thread ament_clang_format/test/test_execution.py Outdated
Comment thread ament_lint/ament_lint/filesystem_helpers.py Outdated
Comment thread ament_lint/ament_lint/test_helpers.py Outdated
Signed-off-by: Tony Paulussen <tony.paulussen@wefabricate.com>
Signed-off-by: Tony Paulussen <tony.paulussen@wefabricate.com>
Signed-off-by: Tony Paulussen <tony.paulussen@wefabricate.com>
@tony-p tony-p requested a review from ahcorde November 20, 2025 21:29
@tony-p
Copy link
Copy Markdown
Author

tony-p commented Nov 20, 2025

A general question, what is the best way of dealing with linting (flake/pep257) errors. If I run the tests locally, it throws up 100s of errors (more than what jenkins shows) is that because they are the only regressions? What is the best way to go about fixing them? If I run black or isort for simple fixes it changes way more than what I have touched which also doesn't seem ideal.

TLDR; is there a simple way of processing these style errors?

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Nov 24, 2025

Pulls: #563
Gist: https://gist.githubusercontent.com/ahcorde/d4bf250d2d0f2565746a0eaa3a037793/raw/46291b259a37cb6d5fff9db63331ef97cb867186/ros2.repos
BUILD args: --packages-above-and-dependencies ament_clang_format
TEST args: --packages-above ament_clang_format
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17588

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@tony-p
Copy link
Copy Markdown
Author

tony-p commented Nov 24, 2025

@ahcorde I see the windows test is failing due to not being able to find clang format (https://ci.ros2.org/job/ci_windows/26030/consoleFull), are the clang tools installed on the windows runners? I see they are not in the pixi environment for windows development https://raw.githubusercontent.com/ros2/ros2/refs/heads/rolling/pixi.toml

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Dec 5, 2025

@tony-p Dependency was added here ros2/ros2#1776

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Dec 5, 2025

  • Windows Build Status

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Dec 8, 2025

@tony-p can you check in the last build that everything is as expected ?

@tony-p
Copy link
Copy Markdown
Author

tony-p commented Dec 9, 2025

@tony-p can you check in the last build that everything is as expected ?

@ahcorde The logs show that it still didn't find clang format. I double checked on my windows and that works

00:32:00 test\test_execution.py:23: in test_clang_format_execution
00:32:00 
00:32:00     assert rc == 0, 'Clang format found issues'
00:32:00 
00:32:00 E   AssertionError: Clang format found issues
00:32:00 
00:32:00 E   assert 1 == 0
00:32:00 
00:32:00 ---------------------------- Captured stderr call -----------------------------
00:32:00 
00:32:00 Could not find 'clang-format' / 'clang-format-3.8' / 'clang-format-3.7' / 'clang-format-3.6' / 'clang-format-3.5' / 'clang-format-3.4' / 'clang-format-3.3' executable

In the logs it shows a pixi list command seems to be run, but doesn't show any output, so I can't really see what packages are installed (or should I look somewhere else?)

21:33:46 Step 18/36 : RUN pixi --color never --no-progress -q list
21:33:46  ---> Using cache
21:33:46  ---> edb348f4655b

I also see the fetching of the pixi.toml seems to use a cache, could it be that it also got something out of date?

21:33:46 Step 16/36 : RUN powershell -noexit irm https://raw.githubusercontent.com/ros2/ros2/refs/heads/%ROS_DISTRO%/pixi.toml -OutFile pixi.toml
21:33:46  ---> Using cache
21:33:46  ---> c4515bc73215

@tony-p
Copy link
Copy Markdown
Author

tony-p commented Jan 23, 2026

@ahcorde Can we run the test again (hoping that the updated pixi.toml) is now used? I think there is a bug in the docker file where it doesn't actually get the latest version ros2/ci#836 (comment)

@tony-p
Copy link
Copy Markdown
Author

tony-p commented Mar 22, 2026

@ahcorde i see that CI has now implemented a fix that should ensure the latest version of the pixi.toml from rolling is used. Can you please trigger a new build?

alvgaona pushed a commit to alvgaona/ros-jazzy that referenced this pull request Mar 23, 2026
@tony-p
Copy link
Copy Markdown
Author

tony-p commented Apr 2, 2026

@ahcorde sorry to push, but it would be really great to have this in for the lyrical release. It is already being patched into robostack.

At this point I would be ok with it just being merged, the issue was the unit test i added couldn’t find the executable on windows which was added to the pixi.toml but then not picked up due to a bug in the docker script meaning it would just use a cached version unless something elae earlier in the docker file invalidated the cache, but that has now been fixed (ros2/ci@9b3821d) so I’m fairly confident it should pass.

Copy link
Copy Markdown
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

🤞

@ahcorde
Copy link
Copy Markdown
Contributor

ahcorde commented Apr 3, 2026

Pulls: #563
Gist: https://gist.githubusercontent.com/ahcorde/66919d4b31181ce96dbacbeb70f2ddfb/raw/a818b1ac70b755e2fdfb0ebcfd93736ab2e10bb0/ros2.repos
BUILD args: --packages-above-and-dependencies ament_clang_format ament_clang_tidy ament_lint
TEST args: --packages-above ament_clang_format ament_clang_tidy ament_lint
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18825

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@tony-p
Copy link
Copy Markdown
Author

tony-p commented Apr 8, 2026

@ahcorde ament_clang_format now passes. ament_clang_tidy fails due to not being able to find clang tidy, but it would require clangdev in the pixi.toml and it isn't in the pixi list. I'm not sure if it is worth adding it for windows as MSBuild doesn't export the compile commands clang-tidy requires.
As far as I can see all other issues on the windows run are not related to this PR, I haven't checked the other builds as they passed before

I am happy that it is working, and that it can be merged, let me know if there is something more you want me to do.

@tony-p
Copy link
Copy Markdown
Author

tony-p commented Apr 14, 2026

Just saw that clang tidy execution is failing on linux as well not being able to find clang-tidy. This passed on the original test run. I'm guessing the runners are being upgraded for lyrical?

2 __________________________ test_clang_tidy_execution ___________________________
00:13:42 test/test_execution.py:40: in test_clang_tidy_execution
00:13:42     assert rc == 0, 'Clang tidy found issues'
00:13:42 E   AssertionError: Clang tidy found issues
00:13:42 E   assert 1 == 0
00:13:42 ----------------------------- Captured stderr call -----------------------------
00:13:42 Could not find 'clang-tidy' / 'clang-tidy-10' / 'clang-tidy-11' / 'clang-tidy-6.0' executable
00:13:42 ----------------------------- Captured stderr call -----------------------------
00:13:42 Could not find 'clang-tidy' / 'clang-tidy-10' / 'clang-tidy-11' / 'clang-tidy-6.0' executable
00:13:42 ----------------------------- Captured stderr call -----------------------------
00:13:42 Could not find 'clang-tidy' / 'clang-tidy-10' / 'clang-tidy-11' / 'clang-tidy-6.0' executable
00:13:42 - generated xml file: /home/jenkins-agent/workspace/ci_linux/ws/build/ament_clang_tidy/pytest.xml -
00:13:42 =========================== short test summary info ============================
00:13:42 FAILED test/test_execution.py::test_clang_tidy_execution - AssertionError: Clang tidy found issues

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.

2 participants