This closes a long-time bug that allowed builds to hang Nix indefinitely (regardless of timeouts) simply by doing exec > /dev/null 2>&1; while true; do true; done Now, on EOF, we just send SIGKILL to the child to make sure it's really gone.
		
			
				
	
	
		
			28 lines
		
	
	
	
		
			455 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
	
		
			455 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| with import ./config.nix;
 | ||
| 
 | ||
| {
 | ||
| 
 | ||
|   infiniteLoop = mkDerivation {
 | ||
|     name = "timeout";
 | ||
|     buildCommand = ''
 | ||
|       echo "‘timeout’ builder entering an infinite loop"
 | ||
|       while true ; do echo -n .; done
 | ||
|     '';
 | ||
|   };
 | ||
| 
 | ||
|   silent = mkDerivation {
 | ||
|     name = "silent";
 | ||
|     buildCommand = ''
 | ||
|       sleep 60
 | ||
|     '';
 | ||
|   };
 | ||
| 
 | ||
|   closeLog = mkDerivation {
 | ||
|     name = "silent";
 | ||
|     buildCommand = ''
 | ||
|       exec > /dev/null 2>&1
 | ||
|       sleep 1000000000
 | ||
|     '';
 | ||
|   };
 | ||
| 
 | ||
| }
 |