Skip to content

Conversation

@ssam18
Copy link
Contributor

@ssam18 ssam18 commented Nov 8, 2025

Description

This PR fixes issue #27961 by adding support for reproducible builds through a new CMake option that excludes the host kernel version from build outputs.

Changes

  • Added CMake option
  • Modified to conditionally include in build platform status
  • Updated to set conditionally
  • Modified to use the new variable

Behavior

Default (Backward Compatible)

When is not set (default), the behavior is unchanged - host system version is included in both CMake status output and TBB version strings.

Reproducible Builds Mode

When is set, the host kernel version is excluded from build outputs, producing identical binaries on equivalent build systems regardless of kernel version differences.

Testing

Users can verify the fix by:

# Default build
cmake ..
# Should show: Host: Linux 6.x.x x86_64

# Reproducible build
cmake -DBUILD_INFO_SKIP_SYSTEM_VERSION=ON ..
# Should show: Host: Linux x86_64

This follows the same pattern as the existing BUILD_INFO_SKIP_TIMESTAMP option, maintaining consistency with OpenCV's build configuration approach.

Fixes #27961

…ersion optional

Add BUILD_INFO_SKIP_SYSTEM_VERSION option to exclude the host kernel version
from build outputs, enabling reproducible builds across systems with different
kernel versions.

Changes:
- Modified CMakeLists.txt to conditionally include CMAKE_HOST_SYSTEM_VERSION
  in the build platform status based on BUILD_INFO_SKIP_SYSTEM_VERSION flag
- Updated 3rdparty/tbb/CMakeLists.txt to set TBB_HOST_VERSION conditionally
- Modified 3rdparty/tbb/version_string.ver.cmakein to use the new variable

When BUILD_INFO_SKIP_SYSTEM_VERSION=ON is set, the host system version is
excluded from both the CMake status output and the TBB version strings,
producing identical binaries on equivalent build systems regardless of
kernel version differences.

Default behavior is unchanged (version included) for backward compatibility.

Fixes opencv#27961
Copy link

@itsrayeedscodespace itsrayeedscodespace left a comment

Choose a reason for hiding this comment

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

Doesn't seem to have any conflicts, no?

@SamareshSingh
Copy link

That is correct. There is no conflict.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reproducible builds: host system version in resulting binary

4 participants