@@ -3,13 +3,17 @@ import redub.buildapi;
33public import redub.misc.shell;
44import core.sys.posix.sys.ioctl ;
55
6- string getHighPriorityCmd ()
6+ string [] getHighPriorityCmd (string [] compileFlags )
77{
88 version (Posix )
99 {
10- return " nice -n 0 " ;
10+ import std.array ;
11+ string [] ret = new string [compileFlags.length + 3 ];
12+ ret[0 .. 3 ] = [" nice" , " -n" , " 0" ].staticArray;
13+ ret[3 .. $] = compileFlags;
14+ return ret;
1115 }
12- else return " " ;
16+ return compileFlags ;
1317}
1418
1519ProcessExec2 execCompiler (const BuildConfiguration cfg, Compiler compiler, string [] compileFlags, out string compilationCommands, bool hasHighPriority, out string cmdFile, const string [string ] env)
@@ -27,7 +31,7 @@ ProcessExec2 execCompiler(const BuildConfiguration cfg, Compiler compiler, strin
2731 {
2832 cmdFile = createCommandFile(cfg, compileFlags, compilationCommands);
2933 compilationCommands = compilerBin ~ " " ~ compilationCommands;
30- ProcessExec2 ret = executeShell2( compilerBin~ " @" ~ cmdFile, env, Config.none, size_t .max, cfg.workingDir);
34+ ProcessExec2 ret = executeProcess2([ compilerBin, " @" ~ cmdFile] , env, Config.none, size_t .max, cfg.workingDir);
3135
3236 version (Windows )
3337 {
@@ -37,11 +41,10 @@ ProcessExec2 execCompiler(const BuildConfiguration cfg, Compiler compiler, strin
3741 SetPriorityClass(ret.pipe.pid.osHandle, REALTIME_PRIORITY_CLASS );
3842 }
3943 }
40-
4144 return ret;
4245 }
4346 compilationCommands = escapeCompilationCommands(compilerBin, compileFlags);
44- return executeShell2 ( getHighPriorityCmd ~ compilationCommands , env, Config.none, size_t .max, cfg.workingDir);
47+ return executeProcess2 ( cast ( const ( char )[][]) getHighPriorityCmd(compileFlags) , env, Config.none, size_t .max, cfg.workingDir);
4548}
4649
4750
@@ -115,5 +118,5 @@ auto executeArchiver(const ThreadBuildData data, CompilingSession s, string main
115118
116119 putSourceFiles(cmd, null , [cacheDir], data.cfg.sourceFiles, data.cfg.excludeSourceFiles, " .o" , " .obj" );
117120
118- return executeShell (escapeShellCommand( cmd) , data.env);
121+ return execute ( cmd, data.env);
119122}
0 commit comments