Skip to content

Conversation

blenderfreaky
Copy link
Contributor

@blenderfreaky blenderfreaky commented Aug 21, 2025

This PR changes the way CMake sets __SYCL_COMPILER_VERSION from using the date of compilation to:

  • using -DSYCL_COMPILER_VERSION=... if set
  • otherwise, running git to get the timestamp of the latest commit, and using that
  • falling back to the old behavior if the first two fail

See #19692 for the rationale behind this. TL;DR: Make __SYCL_COMPILER_VERSION reproducible. Closes #19692.

Copy link
Contributor

@AlexeySachkov AlexeySachkov left a comment

Choose a reason for hiding this comment

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

Whilst this is definitely better than what we have today, I would deprecate __SYCL_COMPILER_VERSION all together, simply because latest commit timestamp is not a compiler version at all.

My attempt at this is in #16137, but I'd never figured out those pre-commit failures (perhaps using WORKING_DIRECTORY instead of -- $dir is a better approach, the format is also slightly different from what I used: %cd vs %ad) and then it never left my backlog.

@blenderfreaky
Copy link
Contributor Author

Working directory seems to be what's used in e.g. llvm/cmake/modules/VersionFromVCS.cmake as well.

I think %cd/committer date should be more reliable. %ad/authors date could be too old if for example a PR gets rebase onto master

Wrt. the Pre Commit issues, on your PR the logs are expired. On this one they seem(?) unrelated to the actual changes

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.

[SYCL] Make __SYCL_COMPILER_VERSION reproducible
2 participants