refactor(tvix): Prefer absl::StrFormat/StrAppend
This fmt call was particularly egregious Change-Id: I2a3b1006c285170ab3374d1c8d81fc53e82a7b05 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2174 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
This commit is contained in:
		
							parent
							
								
									bbfc47e96d
								
							
						
					
					
						commit
						5c3d58bb60
					
				
					 1 changed files with 13 additions and 6 deletions
				
			
		
							
								
								
									
										19
									
								
								third_party/nix/src/libstore/build.cc
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								third_party/nix/src/libstore/build.cc
									
										
									
									
										vendored
									
									
								
							|  | @ -1463,15 +1463,22 @@ void DerivationGoal::tryToBuild() { | |||
|   bool buildLocally = buildMode != bmNormal || parsedDrv->willBuildLocally(); | ||||
| 
 | ||||
|   auto started = [&]() { | ||||
|     auto msg = fmt(buildMode == bmRepair  ? "repairing outputs of '%s'" | ||||
|                    : buildMode == bmCheck ? "checking outputs of '%s'" | ||||
|                    : nrRounds > 1         ? "building '%s' (round %d/%d)" | ||||
|                                           : "building '%s'", | ||||
|                    drvPath, curRound, nrRounds); | ||||
|     std::string msg; | ||||
|     if (buildMode == bmRepair) { | ||||
|       msg = absl::StrFormat("repairing outputs of '%s'", drvPath); | ||||
|     } else if (buildMode == bmCheck) { | ||||
|       msg = absl::StrFormat("checking outputs of '%s'", drvPath); | ||||
|     } else if (nrRounds > 1) { | ||||
|       msg = absl::StrFormat("building '%s' (round %d/%d)", drvPath, curRound, | ||||
|                             nrRounds); | ||||
|     } else { | ||||
|       msg = absl::StrFormat("building '%s'", drvPath); | ||||
|     } | ||||
| 
 | ||||
|     if (hook) { | ||||
|       msg += fmt(" on '%s'", machineName); | ||||
|       absl::StrAppend(&msg, absl::StrFormat(" on '%s'", machineName)); | ||||
|     } | ||||
| 
 | ||||
|     log_sink() << msg << std::endl; | ||||
|     mcRunningBuilds = | ||||
|         std::make_unique<MaintainCount<uint64_t>>(worker.runningBuilds); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue