Skip to content

[BUG Report]: scisharp.tensorflow.redist-linux-gpu-primary package fails to build when obj folder doesn't exist #1297

@ericstj

Description

@ericstj

Description

Our builds don't use the default paths for bin and obj - instead they place all files in a separate folder (artifacts) in the root of our repository. This causes a problem when the TensorFlow restitcher project tries to run>

/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018: The "FileRestitch" task failed unexpectedly. [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/obj/tensorflow_redist_build_log.txt'. [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Int32 bufferSize) [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at System.IO.File.CreateText(String path) [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at InlineCode.FileRestitch.Execute() [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Execute() [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]
/home/cloudtest_azpcontainer/.nuget/packages/scisharp.tensorflow.redist-linux-gpu-primary/2.11.1/buildTransitive/netstandard2.0/SciSharp.TensorFlow.Redist-Linux-GPU-primary.targets(154,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/__w/1/s/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj]

The bug is here:

using (var writer = File.CreateText("obj/tensorflow_redist_build_log.txt"))

Rather than hardcode this path, you should accept it as an input - for example as $(IntermediateOutputPath) or $(BaseIntermediateOutputPath).

Reproduction Steps

Build attached project which will not create an obj folder.

testLinuxRedist.zip

Known Workarounds

Run a target that ensures obj folder is created.

  <Target Name="_EnsureObjFolder" BeforeTargets="FileRestitch">
    <MakeDir Directories="obj" />
  </Target>

Configuration and Other Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions