if (_commandLineOptions.OutputFilePath == null && !_commandLineOptions.OutNearInput)
throw new CommandLineException(SR.MissingOutputFile);
+ if (_commandLineOptions.SingleFileCompilation && !_commandLineOptions.OutNearInput)
+ throw new CommandLineException(SR.MissingOutNearInput);
+
ConfigureTarget();
InstructionSetSupport instructionSetSupport = ConfigureInstructionSetSupport();
RunSingleCompilation(singleCompilationInputFilePaths, instructionSetSupport, compositeRootPath, unrootedInputFilePaths, singleCompilationVersionBubbleModulesHash, typeSystemContext);
}
+
+ // In case of inputbubble ni.dll are created as ni.dll.tmp in order to not interfere with crossgen2, move them all to ni.dll
+ // See https://github.com/dotnet/runtime/issues/55663#issuecomment-898161751 for more details
+ if (_commandLineOptions.InputBubble)
+ {
+ foreach (var inputFile in inputFilePaths)
+ {
+ var tmpOutFile = inputFile.Value.Replace(".dll", ".ni.dll.tmp");
+ var outFile = inputFile.Value.Replace(".dll", ".ni.dll");
+ Console.WriteLine($@"Moving R2R PE file: {tmpOutFile} to {outFile}");
+ System.IO.File.Move(tmpOutFile, outFile);
+ }
+ }
}
else
{
//
// Initialize output filename
//
- var outFile = _commandLineOptions.OutNearInput ? inFilePaths.First().Value.Replace(".dll", ".ni.dll") : _commandLineOptions.OutputFilePath;
+ var suffixStr = _commandLineOptions.SingleFileCompilation && _commandLineOptions.InputBubble ? ".ni.dll.tmp" : ".ni.dll";
+ var outFile = _commandLineOptions.OutNearInput ? inFilePaths.First().Value.Replace(".dll", suffixStr) : _commandLineOptions.OutputFilePath;
using (PerfEventSource.StartStopEvents.CompilationEvents())
{