Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default build reproducible #22113

Closed
filimonov opened this issue Mar 25, 2021 · 15 comments · Fixed by #31899
Closed

Make default build reproducible #22113

filimonov opened this issue Mar 25, 2021 · 15 comments · Fixed by #31899
Assignees
Labels

Comments

@filimonov
Copy link
Contributor

filimonov commented Mar 25, 2021

Currently builds from the same commit can slightly differ.

A reproducible build scenario (documented) is needed and should be used by default (same source = same binary).

Some reading: https://reproducible-builds.org/_lfs/presentations/2015-08-13-CCCamp15.pdf

Most of the needed pieces of that are already there.

@alexey-milovidov alexey-milovidov added the st-need-info We need extra data to continue (waiting for response) label Mar 25, 2021
@alexey-milovidov
Copy link
Member

Why do they differ?

@filimonov
Copy link
Contributor Author

Just run 2 build - on my pc and on aws instance. Got 2 different binaries (also differ from the yandex build).

Here are the commands i used (same as in CI):

curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker ubuntu
apt-get install git

# relogin

git clone --branch "v21.3.3.14-lts" --depth 1 --single-branch https://github.com/ClickHouse/ClickHouse.git
cd ClickHouse
git log -n1
git submodule sync --recursive
git submodule update --init --recursive --jobs 32 --depth 1
docker pull yandex/clickhouse-deb-builder:latest

docker run \
    --network=host \
    --rm \
    --volume=$(realpath ./PACKAGES):/output \
    --volume=$(realpath .):/build \
    --volume=$(realpath ~/.ccache):/ccache \
    -e DEB_CC=clang-11 \
    -e DEB_CXX=clang++-11 \
    -e CCACHE_DIR=/ccache \
    -e CCACHE_BASEDIR=/build \
    -e CCACHE_NOHASHDIR=true \
    -e CCACHE_COMPILERCHECK=content \
    -e CCACHE_MAXSIZE=15G \
    -e ALIEN_PKGS='--rpm --tgz' \
    -e VERSION_STRING='21.3.3.14' \
    -e AUTHOR='clickhouse' \
    -e CMAKE_FLAGS="$CMAKE_FLAGS -DADD_GDB_INDEX_FOR_GOLD=1 -DLINKER_NAME=lld -DYANDEX_OFFICIAL_BUILD=1" \
    yandex/clickhouse-deb-builder:latest | tee build_log.txt

I've tried diffoscope, and it seems the number of differences is bigger than i expected. I'll try to generate HTML report from that.

Why do they differ?

I can only guess - order of files, system.build_options and similar stuff.
The task is about finding and eliminating the differences.

@alexey-milovidov alexey-milovidov added the minor Priority: minor label Mar 26, 2021
@filimonov
Copy link
Contributor Author

diffoscope.tar.gz

@filimonov filimonov removed the st-need-info We need extra data to continue (waiting for response) label Mar 26, 2021
@filimonov
Copy link
Contributor Author

File created with

docker run --rm -t -w $(pwd) -v $(pwd):$(pwd)  registry.salsa.debian.org/reproducible-builds/diffoscope --html-dir html clickhouse clickhouse2
tar cvzf diffoscope.tar.gz html/ 

@filimonov
Copy link
Contributor Author

BTW it's a nice task for an intern. Very independent and requires diving into one particular subject - how binary files are organized / how compilers work etc.

@alexey-milovidov
Copy link
Member

The only offender was RocksDB.

@alexey-milovidov alexey-milovidov self-assigned this Apr 24, 2021
@filimonov
Copy link
Contributor Author

filimonov commented Apr 24, 2021

diffoscope.tar.gz

@alexey-milovidov check that file. Please. :)

Some reading: https://reproducible-builds.org/_lfs/presentations/2015-08-13-CCCamp15.pdf

Also check tgat, it point all typical pitfalls and possible solutions. Also https://reproducible-builds.org/

@filimonov
Copy link
Contributor Author

Retried with

commit fed35445d964c505373d76a9df36c2f3fd1d8c2e (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Alexander Kuzmenkov <[email protected]>
Date:   Mon Apr 26 12:34:46 2021 +0300

    Merge pull request #23546 from ClickHouse/aku/window-distributed
    
    fix window functions for Distributed tables

Results differ.

@filimonov
Copy link
Contributor Author

Here is diffoscope report: diffoscope.tar.gz

Here are build options (they arethe same on both binaries):

VERSION_FULL	ClickHouse 21.6.1.1
VERSION_DESCRIBE	v21.6.1.1-prestable
VERSION_INTEGER	21006001
SYSTEM	Linux
VERSION_GITHASH	96fced4c3cf432fb0b401d2ab01f0c56e5f74a96
VERSION_REVISION	54451
VERSION_DATE	
BUILD_TYPE	RelWithDebInfo
SYSTEM_PROCESSOR	x86_64
LIBRARY_ARCHITECTURE	x86_64-linux-gnu
CMAKE_VERSION	3.16.3
C_COMPILER	/usr/bin/clang-11
C_COMPILER_VERSION	11.1.0
CXX_COMPILER	/usr/bin/clang++-11
CXX_COMPILER_VERSION	11.1.0
C_FLAGS	-g -O2 -fdebug-prefix-map=/build=. -specs=/usr/share/dpkg/no-pie-compile.specs -Wdate-time -fdiagnostics-color=always  -gdwarf-aranges -pipe -msse4.1 -msse4.2 -mpopcnt -fasynchronous-unwind-tables -falign-functions=32  -Wall -Wno-unused-command-line-argument  -fdiagnostics-absolute-paths -fexperimental-new-pass-manager -Werror -O2 -g -DNDEBUG -O3  -flto=thin -fno-pie
CXX_FLAGS	-g -O2 -fdebug-prefix-map=/build=. -specs=/usr/share/dpkg/no-pie-compile.specs -Wdate-time -fdiagnostics-color=always -fsized-deallocation  -gdwarf-aranges -pipe -msse4.1 -msse4.2 -mpopcnt -fasynchronous-unwind-tables -falign-functions=32   -Wall -Wno-unused-command-line-argument  -fdiagnostics-absolute-paths -fexperimental-new-pass-manager -Werror -O2 -g -DNDEBUG -O3  -flto=thin -fno-pie
LINK_FLAGS	-Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -fuse-ld=lld -rdynamic -Wl,--gdb-index -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-no-pie
BUILD_COMPILE_DEFINITIONS	
BUILD_INCLUDE_DIRECTORIES	/build/contrib/sentry-native/include;/build/obj-x86_64-linux-gnu/includes/configs
STATIC	ON
SPLIT_BINARY	
UNBUNDLED	OFF
USE_EMBEDDED_COMPILER	1
USE_GLIBC_COMPATIBILITY	ON
USE_JEMALLOC	ON
USE_UNWIND	ON
USE_ICU	1
USE_H3	1
USE_MYSQL	1
USE_RE2_ST	1
USE_LIBGSASL	1
USE_RDKAFKA	1
USE_CAPNP	1
USE_BASE64	1
USE_XXHASH	ON
USE_HDFS	1
USE_SNAPPY	ON
USE_PARQUET	1
USE_PROTOBUF	1
USE_BROTLI	1
USE_SSL	1
USE_HYPERSCAN	ON
USE_SIMDJSON	ON
USE_GRPC	1
USE_LDAP	1
TZDATA_VERSION	2020e
USE_KRB5	1

The commit sha in build options is wrong and comes from autogenerated_versions.txt

@pkit
Copy link
Contributor

pkit commented Nov 25, 2021

Here is diffoscope report: diffoscope.tar.gz

The shit starts hitting the fan in .rodata (different size) but diffoscope report cannot parse it.

4194304 | [·Too·much·input·for·diff·(SHA256:·6155f0843d1d9d5a890a683d4776fc253252d59868627a02002b6c338ccfe5c6)·] | 4194304 | [·Too·much·input·for·diff·(SHA256:·52323f923c6191787b9feb741c3077053a34fb8400fbd532dd4454bb1a69b498)·]

Useless...

@alexey-milovidov
Copy link
Member

#31838

@alexey-milovidov
Copy link
Member

I successfully managed to get byte-identical .o files.
But for some reason, they are listed in different order for ar:

/usr/bin/llvm-ar-13 qc src/Storages/System/libclickhouse_storages_system.a src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemAggregateFunctionCombinators.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemAsynchronousInserts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemAsynchronousMetrics.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemBuildOptions.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemClusters.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemCollations.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemColumns.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemContributors.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemContributors.generated.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemCurrentRoles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDDLWorkerQueue.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDataSkippingIndices.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDataTypeFamilies.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDatabases.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDetachedParts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDictionaries.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDisks.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDistributionQueue.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemEnabledRoles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemErrors.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemEvents.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemFormats.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemFunctions.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemGrants.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemGraphite.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemLicenses.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMacros.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMergeTreeSettings.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMerges.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMetrics.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemModels.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMutations.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemNumbers.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemOne.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPartMovesBetweenShards.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemParts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPartsBase.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPartsColumns.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPrivileges.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemProcesses.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemProjectionParts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemProjectionPartsColumns.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotaLimits.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotaUsage.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotas.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotasUsage.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemReplicas.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemReplicatedFetches.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemReplicationQueue.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemRoleGrants.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemRoles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemRowPolicies.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemSettings.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemSettingsProfileElements.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemSettingsProfiles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemStackTrace.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemStoragePolicies.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTableEngines.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTableFunctions.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTables.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTimeZones.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTimeZones.generated.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemUserDirectories.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemUsers.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemWarnings.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemZeros.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemZooKeeper.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/attachInformationSchemaTables.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/attachSystemTables.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemBuildOptions.generated.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemLicenses.generated.cpp.o && /usr/bin/ccache /usr/bin/llvm-ranlib-13 src/Storages/System/libclickhouse_storages_system.a

and

/usr/bin/llvm-ar-13 qc src/Storages/System/libclickhouse_storages_system.a src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemAggregateFunctionCombinators.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemAsynchronousInserts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemAsynchronousMetrics.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemBuildOptions.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemClusters.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemCollations.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemColumns.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemContributors.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemContributors.generated.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemCurrentRoles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDDLWorkerQueue.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDataSkippingIndices.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDataTypeFamilies.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDatabases.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDetachedParts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDictionaries.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDisks.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemDistributionQueue.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemEnabledRoles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemErrors.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemEvents.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemFormats.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemFunctions.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemGrants.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemGraphite.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemLicenses.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMacros.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMergeTreeSettings.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMerges.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMetrics.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemModels.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemMutations.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemNumbers.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemOne.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPartMovesBetweenShards.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemParts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPartsBase.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPartsColumns.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemPrivileges.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemProcesses.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemProjectionParts.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemProjectionPartsColumns.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotaLimits.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotaUsage.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotas.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemQuotasUsage.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemReplicas.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemReplicatedFetches.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemReplicationQueue.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemRoleGrants.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemRoles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemRowPolicies.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemSettings.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemSettingsProfileElements.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemSettingsProfiles.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemStackTrace.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemStoragePolicies.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTableEngines.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTableFunctions.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTables.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTimeZones.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemUserDirectories.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemUsers.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemWarnings.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemZeros.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemZooKeeper.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/attachInformationSchemaTables.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/attachSystemTables.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemBuildOptions.generated.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemLicenses.generated.cpp.o src/Storages/System/CMakeFiles/clickhouse_storages_system.dir/StorageSystemTimeZones.generated.cpp.o && /usr/bin/llvm-ranlib-13 src/Storages/System/libclickhouse_storages_system.a

@pkit
Copy link
Contributor

pkit commented Nov 27, 2021

Probably cmake is using fs listdir order to get a file list.
Which is non-deterministic...

@alexey-milovidov
Copy link
Member

Fixed.

@alexey-milovidov
Copy link
Member

alexey-milovidov commented Nov 27, 2021

I've managed to get byte-identical clickhouse binary if I do simple build from command line.
Checked on my workstation and in AWS machine.

Note that it also requires identical versions of LLVM compiler infrastructure: clang, clang++, lld, llvm-as, llvm-ar, llvm-ranlib, llvm-objcopy.

You can either download the LLVM binaries of specific version.
Or compile LLVM from sources with any compiler and then recompile LLVM with itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants