Add option to verify build determinism
Passing "--option build-repeat <N>" will cause every build to be repeated N times. If the build output differs between any round, the build is rejected, and the output paths are not registered as valid. This is primarily useful to verify build determinism. (We already had a --check option to repeat a previously succeeded build. However, with --check, non-deterministic builds are registered in the DB. Preventing that is useful for Hydra to ensure that non-deterministic builds don't end up getting published at all.)
This commit is contained in:
		
							parent
							
								
									96c2ebf004
								
							
						
					
					
						commit
						8fdd156a65
					
				
					 3 changed files with 76 additions and 12 deletions
				
			
		|  | @ -87,10 +87,17 @@ struct ValidPathInfo | |||
|     Path deriver; | ||||
|     Hash hash; | ||||
|     PathSet references; | ||||
|     time_t registrationTime; | ||||
|     unsigned long long narSize; // 0 = unknown
 | ||||
|     time_t registrationTime = 0; | ||||
|     unsigned long long narSize = 0; // 0 = unknown
 | ||||
|     unsigned long long id; // internal use only
 | ||||
|     ValidPathInfo() : registrationTime(0), narSize(0) { } | ||||
| 
 | ||||
|     bool operator == (const ValidPathInfo & i) const | ||||
|     { | ||||
|         return | ||||
|             path == i.path | ||||
|             && hash == i.hash | ||||
|             && references == i.references; | ||||
|     } | ||||
| }; | ||||
| 
 | ||||
| typedef list<ValidPathInfo> ValidPathInfos; | ||||
|  | @ -114,6 +121,7 @@ struct BuildResult | |||
|         MiscFailure, | ||||
|         DependencyFailed, | ||||
|         LogLimitExceeded, | ||||
|         NotDeterministic, | ||||
|     } status = MiscFailure; | ||||
|     std::string errorMsg; | ||||
|     //time_t startTime = 0, stopTime = 0;
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue