harbor run -t LiteCoder/verify-reproducible-buildsharbor download LiteCoder/verify-reproducible-buildsCreate a command-line tool that verifies reproducible builds by comparing compilation outputs between different environments and generates a detailed comparison report.
Technical Requirements:
/app/config.json/app/report.jsonInput Specification:
The configuration file /app/config.json contains:
{
"source_dir": "/app/source",
"build_configs": [
{
"name": "env1",
"compiler": "gcc",
"version": "9.4.0",
"flags": "-O2 -Wall"
},
{
"name": "env2",
"compiler": "gcc",
"version": "11.2.0",
"flags": "-O2 -Wall"
}
],
"output_binary": "libsample.so"
}
Output Specification:
Generate /app/report.json with the following structure:
{
"reproducible": true,
"builds": [
{
"name": "env1",
"binary_path": "/app/builds/env1/libsample.so",
"sha256": "abc123...",
"size_bytes": 12345,
"build_success": true
},
{
"name": "env2",
"binary_path": "/app/builds/env2/libsample.so",
"sha256": "abc123...",
"size_bytes": 12345,
"build_success": true
}
],
"comparison": {
"all_hashes_match": true,
"all_sizes_match": true,
"differences": []
}
}
Requirements:
/app/config.json/app/source using the specified compiler and flags/app/builds/{config_name}//app/report.json with build results and comparison datareproducible to true only if all builds succeeded and all binary hashes matchdifferences array with mismatched build namesError Handling:
build_success to false for that build and set overall reproducible to false/app/config.json is missing or invalid, exit with error code 1