/// <inheritdoc /> public bool AddIpcPip(IpcPip ipcPip, PipId valuePip) { Contract.Requires(ipcPip != null, "Argument pip cannot be null"); Tracing.Logger.Log.CannotAddCreatePipsDuringConfigOrModuleEvaluation(m_loggingContext); return(false); }
/// <summary> /// Adds a dataflow dependency from <paramref name="from"/> to <paramref name="to"/> /// (signifying /// </summary> public void AddDataflowDependency(PipId from, PipId to) { m_dataflowGraph.Add(from, to); }
public Pip HydratePip(PipId pipId, PipQueryContext queryContext) { return(m_pips[pipId]); }
public IEnumerable <PipId> GetDependents(PipId pipId) { Contract.Requires(pipId.IsValid); return(m_pipDependentsGetter?.Invoke(pipId) ?? Enumerable.Empty <PipId>()); }
/// <inheritdoc /> public override DirectoryArtifact AddSealDirectory([NotNull] SealDirectory sealDirectory, PipId valuePip) { var result = base.AddSealDirectory(sealDirectory, valuePip); AddFileDependents(sealDirectory.Contents, sealDirectory); AddDirectoryDependents(sealDirectory.ComposedDirectories, sealDirectory); return(result); }
public PipType GetPipType(PipId pipId) { Contract.Requires(pipId.IsValid); return(HydratePip(pipId).PipType); }
public Pip HydratePip(PipId pipId) { Contract.Requires(pipId.IsValid); return(m_pipHydrator(pipId)); }
private static PipId ReadPipId(BuildXLReader reader) { var pipId = new PipId(reader.ReadUInt32()); return((reader is PipReader pipReader) ? pipReader.RemapPipId(pipId) : pipId); }
/// <summary> /// Called when a cacheable pip completes so state about the pip can be cleaned up /// </summary> public virtual void CompletePip(PipId pipId) { }
internal static ServiceInfo Service(PipId shutdownPipId) { return(new ServiceInfo(ServicePipKind.Service, shutdownProcessPipId: shutdownPipId)); }
private static void WritePipId(BuildXLWriter writer, PipId pipId) => writer.Write(pipId.Value);
/// <inheritdoc /> public override PipId RemapPipId(PipId pipId) => m_pipGraphFragmentContext.RemapPipId(pipId);
/// <inheritdoc /> public DirectoryArtifact AddSealDirectory(SealDirectory sealDirectory, PipId valuePip) { Contract.Requires(sealDirectory != null); Tracing.Logger.Log.CannotAddCreatePipsDuringConfigOrModuleEvaluation(m_loggingContext); return(DirectoryArtifact.Invalid); }
/// <inheritdoc /> public bool AddWriteFile(WriteFile writeFile, PipId valuePip) { Contract.Requires(writeFile != null, "Argument writeFile cannot be null"); Tracing.Logger.Log.CannotAddCreatePipsDuringConfigOrModuleEvaluation(m_loggingContext); return(false); }
/// <inheritdoc /> public bool AddWriteFile(WriteFile writeFile, PipId valuePip) { Contract.Requires(writeFile != null, "Argument writeFile cannot be null"); return(PipAlreadyReloaded(writeFile) || m_builder.AddWriteFile(writeFile)); }
/// <nodoc /> public PipExecutionPerformance TryGetPipExePerf(PipId pipId) { return(Pip2Perf.TryGetValue(pipId, out var result) ? result : null); }
/// <summary> /// Transitions the state of the given pip on the worker /// </summary> public virtual void Transition(PipId pipId, WorkerPipState state) { m_workerPipStateManager.Transition(pipId, state); }
/// <nodoc /> public ProcessExecutionMonitoringReportedEventData?TryGetProcessMonitoringData(PipId pipId) { if (m_processMonitoringData.TryGetValue(pipId, out var result)) { return(result); } else { return(null); } }
public long GetSemiStableHash(PipId pipId) { Contract.Requires(pipId.IsValid); return(HydratePip(pipId).SemiStableHash); }
/// <nodoc /> public PipReference AsPipReference(PipId pipId) { return(new PipReference(PipTable, pipId, PipQueryContext.ViewerAnalyzer)); }
public IEnumerable <PipId> GetDependencies(PipId pipId) { Contract.Requires(pipId.IsValid); return(m_pipDependenciesGetter(pipId)); }
private bool TryScheduleIpcPip(Context context, ObjectLiteral obj, bool allowUndefinedTargetService, bool isServiceFinalization, out FileArtifact outputFile, out PipId pipId) { // IpcClientInfo IIpcMoniker moniker = Converter.ExtractRef <IIpcMoniker>(obj, m_ipcSendMoniker, allowUndefined: false); int? numRetries = Converter.ExtractNumber(obj, m_ipcSendMaxConnectRetries, allowUndefined: true); int? retryDelayMillis = Converter.ExtractNumber(obj, m_ipcSendConnectRetryDelayMillis, allowUndefined: true); var clientConfig = new ClientConfig(numRetries, retryDelayMillis); var ipcClientInfo = new IpcClientInfo(moniker.ToStringId(context.StringTable), clientConfig); // target service pip PipId?servicePipId = Converter.ExtractValue <PipId>(obj, m_ipcSendTargetServicePip, allowUndefined: allowUndefinedTargetService); // arguments PipData arguments; ReadOnlyArray <FileArtifact> fileDependencies; ReadOnlyArray <DirectoryArtifact> directoryDependencies; using (var ipcProcessBuilder = ProcessBuilder.Create(context.PathTable, context.FrontEndContext.GetPipDataBuilder())) { // process arguments ArrayLiteral argumentsArrayLiteral = Converter.ExtractArrayLiteral(obj, m_ipcSendMessageBody); TransformerExecuteArgumentsProcessor.ProcessArguments(context, ipcProcessBuilder, argumentsArrayLiteral); // input file dependencies var dependenciesArray = Converter.ExtractArrayLiteral(obj, m_ipcSendDependencies, allowUndefined: true); if (dependenciesArray != null) { for (int i = 0; i < dependenciesArray.Length; i++) { ProcessImplicitDependency(ipcProcessBuilder, dependenciesArray[i], convContext: new ConversionContext(pos: i, objectCtx: dependenciesArray)); } } arguments = ipcProcessBuilder.ArgumentsBuilder.ToPipData(" ", PipDataFragmentEscaping.CRuntimeArgumentRules); fileDependencies = ipcProcessBuilder.GetInputFilesSoFar(); directoryDependencies = ipcProcessBuilder.GetInputDirectoriesSoFar(); } // output AbsolutePath output = Converter.ExtractPath(obj, m_ipcSendOutputFile, allowUndefined: true); if (!output.IsValid) { output = context.GetPipConstructionHelper().GetUniqueObjectDirectory(m_ipcObjectFolderName).Path.Combine(context.PathTable, m_ipcOutputFileName); } // tags string[] tags = null; var tagsArray = Converter.ExtractArrayLiteral(obj, m_executeTags, allowUndefined: true); if (tagsArray != null && tagsArray.Count > 0) { tags = new string[tagsArray.Count]; for (int i = 0; i < tagsArray.Count; i++) { tags[i] = Converter.ExpectString(tagsArray[i], context: new ConversionContext(pos: i, objectCtx: tagsArray)); } } // skip materialization for files FileOrDirectoryArtifact[] skipMaterializationArtifacts = CollectionUtilities.EmptyArray <FileOrDirectoryArtifact>(); ArrayLiteral skipMaterializationLiteral = Converter.ExtractArrayLiteral(obj, m_ipcSendLazilyMaterializedDependencies, allowUndefined: true); if (skipMaterializationLiteral != null) { skipMaterializationArtifacts = new FileOrDirectoryArtifact[skipMaterializationLiteral.Length]; for (int i = 0; i < skipMaterializationLiteral.Length; i++) { Converter.ExpectFileOrStaticDirectory( skipMaterializationLiteral[i], out var fileArtifact, out var staticDirectory, context: new ConversionContext(pos: i, objectCtx: skipMaterializationLiteral)); Contract.Assert(fileArtifact.IsValid ^ staticDirectory != null); skipMaterializationArtifacts[i] = fileArtifact.IsValid ? FileOrDirectoryArtifact.Create(fileArtifact) : FileOrDirectoryArtifact.Create(staticDirectory.Root); } } // must run on master var mustRunOnMaster = Converter.ExtractOptionalBoolean(obj, m_ipcSendMustRunOnMaster) == true; outputFile = FileArtifact.CreateOutputFile(output); // create IPC pip and add it to the graph return(context.GetPipConstructionHelper().TryAddIpc( ipcClientInfo, arguments, outputFile, servicePipDependencies: servicePipId != null ? ReadOnlyArray <PipId> .From(new[] { servicePipId.Value }) : ReadOnlyArray <PipId> .Empty, fileDependencies: fileDependencies, directoryDependencies: directoryDependencies, skipMaterializationFor: ReadOnlyArray <FileOrDirectoryArtifact> .FromWithoutCopy(skipMaterializationArtifacts), isServiceFinalization: isServiceFinalization, mustRunOnMaster: mustRunOnMaster, tags: tags, out pipId)); }
private string RunSchedulerAndGetOutputContents(FileArtifact output, bool cacheHitAssert, PipId id) { if (cacheHitAssert) { RunScheduler().AssertCacheHit(id); } else { RunScheduler().AssertCacheMiss(id); } return(File.ReadAllText(ArtifactToString(output))); }
/// <inheritdoc /> public bool AddCopyFile(CopyFile copyFile, PipId valuePip) { Contract.Requires(copyFile != null, "Argument copyFile cannot be null"); return(PipAlreadyReloaded(copyFile) || m_builder.AddCopyFile(copyFile)); }
/// <inheritdoc /> public override bool AddWriteFile([NotNull] WriteFile writeFile, PipId valuePip) { return(base.AddWriteFile(writeFile, valuePip)); }
/// <inheritdoc /> public bool AddIpcPip(IpcPip ipcPip, PipId valuePip) { Contract.Requires(ipcPip != null, "Argument pip cannot be null"); return(PipAlreadyReloaded(ipcPip) || m_builder.AddIpcPip(ipcPip, valuePip)); }
private IReadOnlyList <PipId> GetOutgoingNodes(PipId node) { return(m_dataflowGraph.TryGetValue(node, out var outNodes) && outNodes != null ? outNodes : EmptyPipIdList); }
/// <inheritdoc /> public bool AddProcess(Process process, PipId valuePip) { Contract.Requires(process != null, "Argument process cannot be null"); return(PipAlreadyReloaded(process) || m_builder.AddProcess(process, valuePip)); }
public RewritePolicy GetRewritePolicy(PipId pipId) { return(((Process)m_pips[pipId]).RewritePolicy); }
/// <inheritdoc /> public bool AddProcess(Process process, PipId valuePip) { Contract.Requires(process != null, "Argument process cannot be null"); Tracing.Logger.Log.CannotAddCreatePipsDuringConfigOrModuleEvaluation(m_loggingContext); return(false); }