Skip to content

Conversation

@KornevNikita
Copy link
Contributor

This patch adds "Nightly build" string to clang version output. Previously it was like:
clang version 22.0.0git (https://github.com/intel/llvm.git 2de7d379d6bde64c3b12261a080dc00b1800182c)
Now it looks like:
clang version 22.0.0git (https://github.com/intel/llvm.git 2de7d379d6bde64c3b12261a080dc00b1800182c Nightly build)

I'm preserving the repo path, but extending the revision. Anyways, we need to define both CLANG_VC_REPOSITORY and CLANG_VC_REVISION CMake variables to redefine the output, see: llvm/llvm/cmake/modules/GenerateVersionFromVCS.cmake

Moreover, we also need to define LLVM_VC_REPOSITORY & LLVM_VC_REVISION, because if it's not the same as CLANG_VC_* variables, there will be two sections of brackets after clang version, like:
clang version 22.0.0git (https://github.com/intel/llvm.git 2de7d379d6bde64c3b12261a080dc00b1800182c) (https://github.com/intel/llvm.git 2de7d379d6bde64c3b12261a080dc00b1800182c Nightly build)

This is kind of hacky, but it allows as not to change the source code.

This patch adds "Nightly build" string to clang version output.
Previously it was like:
clang version 22.0.0git (https://github.com/intel/llvm.git
2de7d37)
Now it looks like:
clang version 22.0.0git (https://github.com/intel/llvm.git 2de7d37 Nightly build)

I'm preserving the repo path, but extending the revision. Anyways, we need to define both CLANG_VC_REPOSITORY and CLANG_VC_REVISION CMake variables to redefine the output, see: llvm/llvm/cmake/modules/GenerateVersionFromVCS.cmake

Moreover, we need to define LLVM_VC_REPOSITORY & LLVM_VC_REVISION,
because if it's not the same as CLANG_VC_* variables, there will be two
sections of brackets after clang version, like:
clang version 22.0.0git (https://github.com/intel/llvm.git
2de7d37) (https://github.com/intel/llvm.git 2de7d37 Nightly build)

This is kind of hacky, but it allows as not to change the source code.
@KornevNikita KornevNikita requested a review from a team as a code owner October 30, 2025 17:41
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DLLVM_INSTALL_UTILS=ON
-DLLVM_INSTALL_UTILS=ON \
${{ inputs.build_configure_extra_args }}

Check failure

Code scanning / zizmor

code injection via template expansion Error

code injection via template expansion
Copy link
Contributor

@sarnex sarnex Oct 30, 2025

Choose a reason for hiding this comment

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

i think youre supposed to put it into an envvar using the env yaml thing and then use the envvar, for some reason that is safer

build_configure_extra_args: '--hip --cuda'
build_configure_extra_args: |
--hip --cuda \
-DLLVM_VC_REPOSITORY="${{ github.repositoryUrl }}" -DLLVM_VC_REVISION="${{ github.sha }} Nightly build" \
Copy link
Contributor

Choose a reason for hiding this comment

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

since we're only doing this for the nightly, is there some benefit we get to knowing if someone is using the nightly or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll also add the same thing for nightly release builds like x.y.z pre-release build and x.y.z release build for official releases, so this is needed to distinguish them.

@bader
Copy link
Contributor

bader commented Oct 30, 2025

This patch adds "Nightly build" string to clang version output.

Why? How is the "nightly build" different from regular non-nightly build?

@KornevNikita
Copy link
Contributor Author

This patch adds "Nightly build" string to clang version output.

Why? How is the "nightly build" different from regular non-nightly build?

What you mean by regular non-nightly build? There is a huge set of options on how to build the toolchain. Nightly builds are built in some specific way, tested properly enough and published. So there is a customer request to make the version info a bit more informative.

KornevNikita added a commit that referenced this pull request Oct 31, 2025
For more details see: #20520

This PR adds branch:hash to nightly builds on release branches.
It also allows to specify a custom version manually in case of official
release builds, e.g. "6.3.0 release build".
@bader
Copy link
Contributor

bader commented Oct 31, 2025

What you mean by regular non-nightly build?

I mean builds done by other workflows (e.g. pre-commit, post-commit, etc.).

So there is a customer request to make the version info a bit more informative.

What is missing in the current version info? How does you change make it more informative?

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.

4 participants