@@ -26,9 +26,13 @@ fn hash_files_and_features<P: AsRef<Path>>(paths: &[P], features: Vec<String>) -
2626fn main ( ) {
2727 let programs = [
2828 "build.rs" ,
29+ "aggregation_programs/Cargo.toml" ,
30+ "aggregation_programs/Cargo.lock" ,
31+ "aggregation_programs/sp1/Cargo.toml" ,
32+ "aggregation_programs/sp1/src/lib.rs" ,
2933 "aggregation_programs/sp1/src/user_proofs_aggregator_main.rs" ,
3034 "aggregation_programs/sp1/src/chunk_aggregator_main.rs" ,
31- "aggregation_programs/sp1/src/lib.rs " ,
35+ "aggregation_programs/risc0/Cargo.toml " ,
3236 "aggregation_programs/risc0/src/user_proofs_aggregator_main.rs" ,
3337 "aggregation_programs/risc0/src/chunk_aggregator_main.rs" ,
3438 "aggregation_programs/risc0/src/lib.rs" ,
@@ -38,14 +42,16 @@ fn main() {
3842 println ! ( "cargo:rerun-if-changed={}" , file) ;
3943 }
4044
41- // Collect and sort features for stable hashing
42- let mut features: Vec < String > = env:: vars ( )
43- . filter ( |( k, _) | k. starts_with ( "CARGO_FEATURE_" ) )
45+ // Get all the env vars from rust (RUSTC, CARGO_FEATURES, etc)
46+ // But filter those that don't affect the build of the program
47+ let mut flags: Vec < String > = env:: vars ( )
48+ . filter ( |( k, _) | k != "AGGREGATOR" || k != "RISC0_DEV_MODE" || k != "SP1_PROVER" )
4449 . map ( |( k, v) | format ! ( "{k}={v}" ) )
4550 . collect ( ) ;
46- features. sort ( ) ; // Ensure deterministic hash regardless of env var order
51+ // Sort them to make it deterministic in spite of the order.
52+ flags. sort ( ) ;
4753
48- let hash = hash_files_and_features ( & programs, features ) ;
54+ let hash = hash_files_and_features ( & programs, flags ) ;
4955 let hash_file = Path :: new ( "target/programs_hash.txt" ) ;
5056
5157 let needs_build = if let Ok ( prev) = fs:: read_to_string ( hash_file) {
0 commit comments