示例#1
0
 internal ProcessMutablePipState(
     PipType pipType,
     long semiStableHash,
     PageableStoreId storeId,
     ServiceInfo serviceInfo,
     Process.Options processOptions)
     : base(pipType, semiStableHash, storeId)
 {
     ServiceInfo    = serviceInfo;
     ProcessOptions = processOptions;
 }
示例#2
0
 internal ProcessMutablePipState(
     PipType pipType,
     long semiStableHash,
     PageableStoreId storeId,
     ServiceInfo serviceInfo,
     Process.Options processOptions,
     int priority,
     int?preserveOutputsTrustLevel = null)
     : base(pipType, semiStableHash, storeId)
 {
     ServiceInfo              = serviceInfo;
     ProcessOptions           = processOptions;
     Priority                 = priority;
     PreserveOutputTrustLevel = preserveOutputsTrustLevel ?? 0;
 }
示例#3
0
 internal ProcessMutablePipState(
     PipType pipType,
     long semiStableHash,
     PageableStoreId storeId,
     ServiceInfo serviceInfo,
     Process.Options processOptions,
     RewritePolicy rewritePolicy,
     AbsolutePath executablePath,
     int priority,
     int?preserveOutputsTrustLevel = null)
     : base(pipType, semiStableHash, storeId)
 {
     ServiceInfo              = serviceInfo;
     ProcessOptions           = processOptions;
     RewritePolicy            = rewritePolicy;
     ExecutablePath           = executablePath;
     Priority                 = priority;
     PreserveOutputTrustLevel = preserveOutputsTrustLevel ?? 0;
 }
示例#4
0
        public void TranslateGlobalUntrackedScope(bool translate, Process.Options requireGlobalDependencies)
        {
            DirectoryArtifact sourceDirectory       = DirectoryArtifact.CreateWithZeroPartialSealId(CreateUniqueDirectory(SourceRoot, prefix: "sourceDir"));
            DirectoryArtifact targetDirectory       = DirectoryArtifact.CreateWithZeroPartialSealId(CreateUniqueDirectory(SourceRoot, prefix: "targetDir"));
            FileArtifact      outputFileInTargetDir = CreateOutputFileArtifact(ArtifactToString(targetDirectory));
            FileArtifact      inputFileInTargetDir  = CreateSourceFile(ArtifactToString(targetDirectory));

            Configuration.Sandbox.GlobalUnsafeUntrackedScopes.Add(sourceDirectory);

            if (translate)
            {
                DirectoryTranslator = new DirectoryTranslator();
                DirectoryTranslator.AddTranslation(ArtifactToString(sourceDirectory), ArtifactToString(targetDirectory));
            }

            var ops = new Operation[]
            {
                Operation.ReadFile(inputFileInTargetDir, doNotInfer: true),
                Operation.WriteFile(outputFileInTargetDir)
            };

            var builder = CreatePipBuilder(ops);

            builder.Options |= requireGlobalDependencies;

            Process pip = SchedulePipBuilder(builder).Process;

            if (translate && ((requireGlobalDependencies & Process.Options.RequireGlobalDependencies) == Process.Options.RequireGlobalDependencies))
            {
                RunScheduler().AssertCacheMiss(pip.PipId);
                RunScheduler().AssertCacheHit(pip.PipId);
            }
            else
            {
                RunScheduler().AssertFailure();
                AssertWarningEventLogged(EventId.ProcessNotStoredToCacheDueToFileMonitoringViolations);
                AssertErrorEventLogged(EventId.FileMonitoringError);
            }
        }
示例#5
0
 internal ProcessMutablePipState(
     PipType pipType,
     long semiStableHash,
     PageableStoreId storeId,
     ServiceInfo serviceInfo,
     Process.Options processOptions,
     RewritePolicy rewritePolicy,
     AbsolutePath executablePath,
     int priority,
     ModuleId moduleId,
     int preserveOutputsTrustLevel = 0,
     bool isSucceedFast            = false)
     : base(pipType, semiStableHash, storeId)
 {
     ServiceInfo              = serviceInfo;
     ProcessOptions           = processOptions;
     RewritePolicy            = rewritePolicy;
     ExecutablePath           = executablePath;
     Priority                 = priority;
     PreserveOutputTrustLevel = preserveOutputsTrustLevel;
     ModuleId                 = moduleId;
     IsSucceedFast            = isSucceedFast;
 }
示例#6
0
 public ProcessBuilder WithOptions(Process.Options options)
 {
     m_options |= options;
     return(this);
 }