Skip to content

[CI] Build clang-tidy in sycl-linux-build.yml#21219

Merged
KornevNikita merged 3 commits intosyclfrom
build-clang-tidy
Feb 5, 2026
Merged

[CI] Build clang-tidy in sycl-linux-build.yml#21219
KornevNikita merged 3 commits intosyclfrom
build-clang-tidy

Conversation

@KornevNikita
Copy link
Contributor

To have clang-tidy as part of nightly container.
Tested here: https://github.com/intel/llvm/actions/runs/21686159301

To have clang-tidy as part of nightly container
run: |
cmake --build $GITHUB_WORKSPACE/build --target install-sycl-test-utilities
- name: Install clang-tidy
if: ${{ !cancelled() && steps.build.conclusion == 'success' && contains(inputs.build_configure_extra_args, '-DSYCL_BUILD_CLANG_TIDY=ON') }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really like that we're checking the configure args to pick what target to install, I would prefer we just install everything, but I guess that wasn't introduced in this PR, the below case does it too.

Copy link
Contributor Author

@KornevNikita KornevNikita Feb 5, 2026

Choose a reason for hiding this comment

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

We could pass some input like "build_clang_tidy: true" instead. I don't want to build&install clang-tidy always as it takes some time and space. I'd like to limit it to nightly builds as we only need it there.

Copy link
Contributor

Choose a reason for hiding this comment

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

The build for it seems to be only 12 extra files and the executable is 5.8MB based on my testing (static linking). Unless you have a strong opinion I would prefer we just always install it. The containers can't be used by external people anyway

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is right, we should build whatever target is required for this in the compile command, which should include SYCL and whatever other targets are enabled.

cmake --build $GITHUB_WORKSPACE/build --target install-sycl-test-utilities
- name: Install clang-tidy
if: ${{ !cancelled() && steps.build.conclusion == 'success' && contains(inputs.build_configure_extra_args, '-DSYCL_BUILD_CLANG_TIDY=ON') }}
run: cmake --build $GITHUB_WORKSPACE/build --target install-clang-tidy
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still need the cmake change with this line? i would expect the install-clang-tidy target to require it's actually built

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I decided we can just build "sycl-toolchain clang-tidy" instead of adding a dependency. I believe it's faster to build both targets together and then install clang-tidy, than to build sycl-toolchain and install-clang-tidy sequentially.

Anyways, if you think it's not right, we can just limit this patch to calling install-clang-tidy if the build_clang_tid input is set.

@KornevNikita KornevNikita changed the title [CI] Build clang-tidy in nightly [CI] Build clang-tidy in sycl-linux-build.yml Feb 5, 2026
@KornevNikita KornevNikita requested a review from sarnex February 5, 2026 16:02
Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

:) thanks lgtm

@sarnex
Copy link
Contributor

sarnex commented Feb 5, 2026

Do we care about windows?

@KornevNikita
Copy link
Contributor Author

Do we care about windows?

I guess it's enough to run clang-tidy on linux

@KornevNikita KornevNikita merged commit 3dd3fee into sycl Feb 5, 2026
37 checks passed
@KornevNikita KornevNikita deleted the build-clang-tidy branch February 6, 2026 17:41
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