-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Comments
Why do they differ? |
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):
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.
I can only guess - order of files, system.build_options and similar stuff. |
File created with
|
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. |
The only offender was RocksDB. |
@alexey-milovidov check that file. Please. :)
Also check tgat, it point all typical pitfalls and possible solutions. Also https://reproducible-builds.org/ |
Retried with
Results differ. |
Here is diffoscope report: diffoscope.tar.gz Here are build options (they arethe same on both binaries):
The commit sha in build options is wrong and comes from autogenerated_versions.txt |
The shit starts hitting the fan in
Useless... |
I successfully managed to get byte-identical .o files. /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 |
Probably |
Fixed. |
I've managed to get byte-identical 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. |
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.
The text was updated successfully, but these errors were encountered: