Skip to content

Commit

Permalink
Omit BUILD_HOST_NAME for reproducible builds
Browse files Browse the repository at this point in the history
Distributions that want reproducible builds, set the SOURCE_DATE_EPOCH
environment variable. In this case, we should not record the build
host name to allow for bit-identical rebuilds elsewhere.

This patch was done while working on reproducible builds for openSUSE.
  • Loading branch information
bmwiedemann committed Nov 19, 2023
1 parent e7f6602 commit 227197c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Expand Up @@ -47,7 +47,11 @@ execute_process(
)
message("GIT_BRANCH: ${GIT_BRANCH}")

cmake_host_system_information(RESULT BUILD_HOST_NAME QUERY HOSTNAME)
if($ENV{SOURCE_DATE_EPOCH})
set(BUILD_HOST_NAME "reproduciblebuild")
else ()
cmake_host_system_information(RESULT BUILD_HOST_NAME QUERY HOSTNAME)
endif()
if(${CMAKE_VERSION} VERSION_GREATER "3.22.0")
cmake_host_system_information(RESULT BUILD_HOST_DISTRI QUERY DISTRIB_PRETTY_NAME)
else ()
Expand Down

0 comments on commit 227197c

Please sign in to comment.