Exemplo n.º 1
0
        internal static IpcPip InternalDeserialize(PipReader reader)
        {
            bool hasProvenance = reader.ReadBoolean();

            return(new IpcPip(
                       ipcInfo: IpcClientInfo.Deserialize(reader),
                       arguments: reader.ReadPipData(),
                       outputFile: reader.ReadFileArtifact(),
                       servicePipDependencies: reader.ReadReadOnlyArray(reader1 => ((PipReader)reader1).ReadPipId()),
                       fileDependencies: reader.ReadReadOnlyArray(reader1 => reader1.ReadFileArtifact()),
                       directoryDependencies: reader.ReadReadOnlyArray(reader1 => reader1.ReadDirectoryArtifact()),
                       skipMaterializationFor: reader.ReadReadOnlyArray(reader1 => reader1.ReadFileOrDirectoryArtifact()),
                       tags: reader.ReadReadOnlyArray(reader1 => reader1.ReadStringId()),
                       isServiceFinalization: reader.ReadBoolean(),
                       mustRunOnMaster: reader.ReadBoolean(),
                       provenance: hasProvenance ? reader.ReadPipProvenance() : null));
        }
Exemplo n.º 2
0
 internal static Process InternalDeserialize(PipReader reader)
 {
     return(new Process(
                executable: reader.ReadFileArtifact(),
                workingDirectory: reader.ReadAbsolutePath(),
                arguments: reader.ReadPipData(),
                responseFile: reader.ReadFileArtifact(),
                responseFileData: reader.ReadPipData(),
                environmentVariables: reader.ReadReadOnlyArray(reader1 => ((PipReader)reader1).ReadEnvironmentVariable()),
                standardInput: StandardInput.InternalDeserialize(reader),
                standardOutput: reader.ReadFileArtifact(),
                standardError: reader.ReadFileArtifact(),
                standardDirectory: reader.ReadAbsolutePath(),
                warningTimeout: reader.ReadNullableStruct(reader1 => reader1.ReadTimeSpan()),
                timeout: reader.ReadNullableStruct(reader1 => reader1.ReadTimeSpan()),
                dependencies: reader.ReadReadOnlyArray(reader1 => reader1.ReadFileArtifact()),
                outputs: reader.ReadReadOnlyArray(reader1 => reader1.ReadFileArtifactWithAttributes()),
                directoryDependencies: reader.ReadReadOnlyArray(reader1 => reader1.ReadDirectoryArtifact()),
                directoryOutputs: reader.ReadReadOnlyArray(reader1 => reader1.ReadDirectoryArtifact()),
                orderDependencies: reader.ReadReadOnlyArray(reader1 => ((PipReader)reader1).ReadPipId()),
                untrackedPaths: reader.ReadReadOnlyArray(reader1 => reader1.ReadAbsolutePath()),
                untrackedScopes: reader.ReadReadOnlyArray(reader1 => reader1.ReadAbsolutePath()),
                tags: reader.ReadReadOnlyArray(reader1 => reader1.ReadStringId()),
                successExitCodes: reader.ReadReadOnlyArray(reader1 => reader1.ReadInt32()),
                semaphores: reader.ReadReadOnlyArray(reader1 => ((PipReader)reader1).ReadProcessSemaphoreInfo()),
                provenance: reader.ReadPipProvenance(),
                toolDescription: reader.ReadStringId(),
                additionalTempDirectories: reader.ReadReadOnlyArray(reader1 => reader1.ReadAbsolutePath()),
                warningRegex: reader.ReadRegexDescriptor(),
                errorRegex: reader.ReadRegexDescriptor(),
                enableMultiLineErrorScanning: reader.ReadBoolean(),
                uniqueOutputDirectory: reader.ReadAbsolutePath(),
                uniqueRedirectedDirectoryRoot: reader.ReadAbsolutePath(),
                tempDirectory: reader.ReadAbsolutePath(),
                options: (Options)reader.ReadInt32(),
                serviceInfo: reader.ReadNullable(reader1 => ServiceInfo.InternalDeserialize(reader1)),
                retryExitCodes: reader.ReadReadOnlyArray(r => r.ReadInt32()),
                allowedSurvivingChildProcessNames: reader.ReadReadOnlyArray(reader1 => reader1.ReadPathAtom()),
                nestedProcessTerminationTimeout: reader.ReadNullableStruct(reader1 => reader1.ReadTimeSpan()),
                absentPathProbeMode: (AbsentPathProbeInUndeclaredOpaquesMode)reader.ReadByte(),
                doubleWritePolicy: (DoubleWritePolicy)reader.ReadByte(),
                containerIsolationLevel: (ContainerIsolationLevel)reader.ReadByte(),
                weight: reader.ReadInt32Compact(),
                priority: reader.ReadInt32Compact(),
                preserveOutputWhitelist: reader.ReadReadOnlyArray(r => r.ReadAbsolutePath()),
                changeAffectedInputListWrittenFile: reader.ReadFileArtifact(),
                preserveOutputsTrustLevel: reader.ReadInt32(),
                childProcessesToBreakawayFromSandbox: reader.ReadReadOnlyArray(reader1 => reader1.ReadPathAtom())
                ));
 }
Exemplo n.º 3
0
        /// <nodoc />
        internal static EnvironmentVariable Deserialize(PipReader reader)
        {
            Contract.Requires(reader != null);
            StringId name = reader.ReadStringId();

            if (name.IsValid)
            {
                PipData value         = reader.ReadPipData();
                bool    isPassThrough = reader.ReadBoolean();
                Contract.Assume(value.IsValid ^ isPassThrough);
                return(new EnvironmentVariable(name, value, isPassThrough));
            }
            else
            {
                return(default(EnvironmentVariable));
            }
        }
Exemplo n.º 4
0
        internal static SealDirectory InternalDeserializeSealDirectory(PipReader reader)
        {
            DirectoryArtifact artifact = reader.ReadDirectoryArtifact();
            var directory = new SealDirectory(
                artifact.Path,
                reader.ReadSortedReadOnlyArray(reader1 => reader1.ReadFileArtifact(), OrdinalFileArtifactComparer.Instance),
                (SealDirectoryKind)reader.ReadByte(),
                reader.ReadPipProvenance(),
                reader.ReadReadOnlyArray(reader1 => reader1.ReadStringId()),
                reader.ReadReadOnlyArray(reader1 => reader1.ReadStringId()),
                reader.ReadBoolean());

            directory.SetDirectoryArtifact(artifact);
            Contract.Assume(directory.IsInitialized && directory.Directory == artifact);

            return(directory);
        }
Exemplo n.º 5
0
        internal static CompositeSharedOpaqueSealDirectory InternalDeserializeCompositeSharedOpaqueSealDirectory(PipReader reader)
        {
            DirectoryArtifact artifact = reader.ReadDirectoryArtifact();
            var directory = new CompositeSharedOpaqueSealDirectory(
                artifact.Path,
                reader.ReadArray(reader1 => reader1.ReadDirectoryArtifact()),
                reader.ReadPipProvenance(),
                reader.ReadReadOnlyArray(reader1 => reader1.ReadStringId()),
                reader.ReadBoolean()
                    ? new SealDirectoryContentFilter((SealDirectoryContentFilter.ContentFilterKind)reader.ReadByte(), reader.ReadString())
                    : (SealDirectoryContentFilter?)null);

            directory.SetDirectoryArtifact(artifact);
            Contract.Assume(directory.IsInitialized && directory.Directory == artifact);

            return(directory);
        }