cake-build / cake-build/cake

Path.cs does not round trip when used to read a file from a directory and then to execute file operations

Open
#2,494 0 comments 0 reactions 0 assignees View on GitHub
Bug Help wanted Up-for-grabs
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
3h 37m
Merged PRs (30d)
21

Description

### What You Are Seeing?

[Path.cs](https://github.com/cake-build/cake/blob/dfdadb1b84804bfc3782597346a1dadc7bbdba89/src/Cake.Core/IO/Path.cs#L66) will convert all `\` to `/`, even if `'\'` is part of the *file name* on macOS.

The result is that the `CleanDirectories` command fails if any file includes a`'\'` in its name. For example: If `/users/user/source/bad\file.txt` exists, and Cake runs `CleanDirectories("/users/user/source")`, then the task will fail to find `/users/user/source/bad/file.txt` in order to delete it, and fail.

### What is Expected?

I would expect `CleanDirectories` to not *fail*. I would expect paths to round-trip.

### What version of Cake are you using?

31.0 - I'd expect all versions to be affected.

### Are you running on a 32 or 64 bit system?

64

### What environment are you running on? Windows? Linux? Mac?

macOS

### Are you running on a CI Server? If so, which one?

No

### How Did You Get This To Happen? (Steps to Reproduce)

This is a simple problem to reproduce.
Repeated from above:
If `/users/user/source/bad\file.txt` exists, and Cake runs `CleanDirectories("/users/user/source")`.

Specifically, I ran into this because `log4net` generated a "bad" file using a config that works as intended on Windows.
```

...


...
```

### Output Log

`build.sh` executes Cake using:
```
exec mono "$CAKE_EXE" --paths_tools=cake -experimental "$@"
```

The Clean task looks like:
```
Task("Clean")
.Does(() =>
{
CleanDirectories($"src/**/bin");
CleanDirectories($"src/**/obj");
CleanDirectories($"tests/**/bin");
CleanDirectories($"tests/**/obj");
CleanDirectory("release");
});
```

~~~sh
WS2337:WorkflowsApi matt.preucil$ ./build.sh -Target=Clean -Verbosity=Diagnostic
Feeds used:
/Users/matt.preucil/.nuget/packages/
https://www.nuget.org/api/v2/
https://faithlife.myget.org/F/nuget/auth/53afb7cf-930c-4c68-9a99-8b4db8255909/api/v3/index.json
http://nuget/nuget/

All packages listed in /Users/matt.preucil/Source/WorkflowsApi/cake/packages.config are already installed.
Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing /Users/matt.preucil/Source/WorkflowsApi/build.cake...
Processing build script...
Installing tools...
Found package 'NUnit.ConsoleRunner 3.8.0' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package NUnit.ConsoleRunner.3.8.0 has already been installed.
Successfully installed 'NUnit.ConsoleRunner 3.8.0' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 24.54 ms
Found package 'fsdgenaspnet 1.0.0' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package fsdgenaspnet.1.0.0 has already been installed.
Successfully installed 'fsdgenaspnet 1.0.0' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 1.06 ms
Found package 'fsdgencsharp 1.1.0' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package fsdgencsharp.1.1.0 has already been installed.
Successfully installed 'fsdgencsharp 1.1.0' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 0.95 ms
Found package 'fsdgenmd 1.1.0' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package fsdgenmd.1.1.0 has already been installed.
Successfully installed 'fsdgenmd 1.1.0' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 0.94 ms
Found package 'fsdgenjs 1.2.0' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package fsdgenjs.1.2.0 has already been installed.
Successfully installed 'fsdgenjs 1.2.0' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 0.95 ms
Found package 'Argus.Console 1.0.1.41' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package Argus.Console.1.0.1.41 has already been installed.
Successfully installed 'Argus.Console 1.0.1.41' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 1.5 ms
Found package 'Logos.NuGet.Packager 2.0.0.28' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package Logos.NuGet.Packager.2.0.0.28 has already been installed.
Successfully installed 'Logos.NuGet.Packager 2.0.0.28' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 0.95 ms
Found package 'Logos.SourceIndexer 0.0.5' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package Logos.SourceIndexer.0.0.5 has already been installed.
Successfully installed 'Logos.SourceIndexer 0.0.5' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 0.84 ms
Found package 'Logos.UpdateSolutionInfo 1.1.0' in '/Users/matt.preucil/Source/WorkflowsApi/cake'.
Package Logos.UpdateSolutionInfo.1.1.0 has already been installed.
Successfully installed 'Logos.UpdateSolutionInfo 1.1.0' to /Users/matt.preucil/Source/WorkflowsApi/cake
Executing nuget actions took 1.41 ms
Adding assembly reference to mscorlib.dll...
Adding assembly reference to System.Core.dll...
Adding assembly reference to Cake.Core.dll...
Adding assembly reference to Cake.Common.dll...
Adding assembly reference to Cake.exe...
Adding assembly reference to System.dll...
Adding assembly reference to System.Xml.dll...
Adding assembly reference to System.Xml.Linq.dll...
Adding assembly reference to System.Data.dll...
Adding assembly reference to System.Runtime.dll...
Adding assembly reference to System.Collections.dll...
Adding assembly reference to netstandard.dll...
Importing namespace Cake.Common...
Importing namespace Cake.Common.Build...
Importing namespace Cake.Common.Build.AppVeyor...
Importing namespace Cake.Common.Build.AppVeyor.Data...
Importing namespace Cake.Common.Build.Bamboo...
Importing namespace Cake.Common.Build.Bamboo.Data...
Importing namespace Cake.Common.Build.BitbucketPipelines...
Importing namespace Cake.Common.Build.BitbucketPipelines.Data...
Importing namespace Cake.Common.Build.Bitrise...
Importing namespace Cake.Common.Build.Bitrise.Data...
Importing namespace Cake.Common.Build.ContinuaCI...
Importing namespace Cake.Common.Build.ContinuaCI.Data...
Importing namespace Cake.Common.Build.GitLabCI...
Importing namespace Cake.Common.Build.GitLabCI.Data...
Importing namespace Cake.Common.Build.GoCD...
Importing namespace Cake.Common.Build.GoCD.Data...
Importing namespace Cake.Common.Build.Jenkins...
Importing namespace Cake.Common.Build.Jenkins.Data...
Importing namespace Cake.Common.Build.MyGet...
Importing namespace Cake.Common.Build.TeamCity...
Importing namespace Cake.Common.Build.TFBuild...
Importing namespace Cake.Common.Build.TFBuild.Data...
Importing namespace Cake.Common.Build.TravisCI...
Importing namespace Cake.Common.Build.TravisCI.Data...
Importing namespace Cake.Common.Diagnostics...
Importing namespace Cake.Common.IO...
Importing namespace Cake.Common.IO.Paths...
Importing namespace Cake.Common.Net...
Importing namespace Cake.Common.Security...
Importing namespace Cake.Common.Solution...
Importing namespace Cake.Common.Solution.Project...
Importing namespace Cake.Common.Solution.Project.Properties...
Importing namespace Cake.Common.Solution.Project.XmlDoc...
Importing namespace Cake.Common.Text...
Importing namespace Cake.Common.Tools...
Importing namespace Cake.Common.Tools.Cake...
Importing namespace Cake.Common.Tools.Chocolatey...
Importing namespace Cake.Common.Tools.Chocolatey.ApiKey...
Importing namespace Cake.Common.Tools.Chocolatey.Config...
Importing namespace Cake.Common.Tools.Chocolatey.Download...
Importing namespace Cake.Common.Tools.Chocolatey.Features...
Importing namespace Cake.Common.Tools.Chocolatey.Install...
Importing namespace Cake.Common.Tools.Chocolatey.New...
Importing namespace Cake.Common.Tools.Chocolatey.Pack...
Importing namespace Cake.Common.Tools.Chocolatey.Pin...
Importing namespace Cake.Common.Tools.Chocolatey.Push...
Importing namespace Cake.Common.Tools.Chocolatey.Sources...
Importing namespace Cake.Common.Tools.Chocolatey.Uninstall...
Importing namespace Cake.Common.Tools.Chocolatey.Upgrade...
Importing namespace Cake.Common.Tools.DotCover...
Importing namespace Cake.Common.Tools.DotCover.Analyse...
Importing namespace Cake.Common.Tools.DotCover.Cover...
Importing namespace Cake.Common.Tools.DotCover.Merge...
Importing namespace Cake.Common.Tools.DotCover.Report...
Importing namespace Cake.Common.Tools.DotNetCore...
Importing namespace Cake.Common.Tools.DotNetCore.Build...
Importing namespace Cake.Common.Tools.DotNetCore.BuildServer...
Importing namespace Cake.Common.Tools.DotNetCore.Clean...
Importing namespace Cake.Common.Tools.DotNetCore.Execute...
Importing namespace Cake.Common.Tools.DotNetCore.MSBuild...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Delete...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Push...
Importing namespace Cake.Common.Tools.DotNetCore.Pack...
Importing namespace Cake.Common.Tools.DotNetCore.Publish...
Importing namespace Cake.Common.Tools.DotNetCore.Restore...
Importing namespace Cake.Common.Tools.DotNetCore.Run...
Importing namespace Cake.Common.Tools.DotNetCore.Test...
Importing namespace Cake.Common.Tools.DotNetCore.Tool...
Importing namespace Cake.Common.Tools.DotNetCore.VSTest...
Importing namespace Cake.Common.Tools.DupFinder...
Importing namespace Cake.Common.Tools.Fixie...
Importing namespace Cake.Common.Tools.GitLink...
Importing namespace Cake.Common.Tools.GitReleaseManager...
Importing namespace Cake.Common.Tools.GitReleaseManager.AddAssets...
Importing namespace Cake.Common.Tools.GitReleaseManager.Close...
Importing namespace Cake.Common.Tools.GitReleaseManager.Create...
Importing namespace Cake.Common.Tools.GitReleaseManager.Export...
Importing namespace Cake.Common.Tools.GitReleaseManager.Publish...
Importing namespace Cake.Common.Tools.GitReleaseNotes...
Importing namespace Cake.Common.Tools.GitVersion...
Importing namespace Cake.Common.Tools.ILMerge...
Importing namespace Cake.Common.Tools.ILRepack...
Importing namespace Cake.Common.Tools.InnoSetup...
Importing namespace Cake.Common.Tools.InspectCode...
Importing namespace Cake.Common.Tools.MSBuild...
Importing namespace Cake.Common.Tools.MSpec...
Importing namespace Cake.Common.Tools.MSTest...
Importing namespace Cake.Common.Tools.NSIS...
Importing namespace Cake.Common.Tools.NuGet...
Importing namespace Cake.Common.Tools.NuGet.Add...
Importing namespace Cake.Common.Tools.NuGet.Init...
Importing namespace Cake.Common.Tools.NuGet.Install...
Importing namespace Cake.Common.Tools.NuGet.List...
Importing namespace Cake.Common.Tools.NuGet.Pack...
Importing namespace Cake.Common.Tools.NuGet.Push...
Importing namespace Cake.Common.Tools.NuGet.Restore...
Importing namespace Cake.Common.Tools.NuGet.SetApiKey...
Importing namespace Cake.Common.Tools.NuGet.SetProxy...
Importing namespace Cake.Common.Tools.NuGet.Sources...
Importing namespace Cake.Common.Tools.NuGet.Update...
Importing namespace Cake.Common.Tools.NUnit...
Importing namespace Cake.Common.Tools.OctopusDeploy...
Importing namespace Cake.Common.Tools.OpenCover...
Importing namespace Cake.Common.Tools.ReportGenerator...
Importing namespace Cake.Common.Tools.ReportUnit...
Importing namespace Cake.Common.Tools.Roundhouse...
Importing namespace Cake.Common.Tools.SignTool...
Importing namespace Cake.Common.Tools.SpecFlow...
Importing namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport...
Importing namespace Cake.Common.Tools.SpecFlow.TestExecutionReport...
Importing namespace Cake.Common.Tools.TextTransform...
Importing namespace Cake.Common.Tools.VSTest...
Importing namespace Cake.Common.Tools.VSWhere...
Importing namespace Cake.Common.Tools.VSWhere.All...
Importing namespace Cake.Common.Tools.VSWhere.Latest...
Importing namespace Cake.Common.Tools.VSWhere.Legacy...
Importing namespace Cake.Common.Tools.VSWhere.Product...
Importing namespace Cake.Common.Tools.WiX...
Importing namespace Cake.Common.Tools.WiX.Heat...
Importing namespace Cake.Common.Tools.XBuild...
Importing namespace Cake.Common.Tools.XUnit...
Importing namespace Cake.Common.Xml...
Importing namespace Cake.Core...
Importing namespace Cake.Core.Diagnostics...
Importing namespace Cake.Core.IO...
Importing namespace Cake.Core.Scripting...
Importing namespace System...
Importing namespace System.Collections.Generic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Text...
Importing namespace System.Threading.Tasks...
Compiling build script...

========================================
Clean
========================================
Executing task: Clean
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ClientCore/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ClientData/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.Core/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ServerCore/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ServerData/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.v1/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.v1.WebApi/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ClientCore/obj
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ClientData/obj
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.Core/obj
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ServerCore/obj
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.ServerData/obj
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.v1/obj
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/src/Faithlife.WorkflowsApi.v1.WebApi/obj
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/tests/Faithlife.WorkflowsApi.v1.UnitTests/bin
Cleaning directory /Users/matt.preucil/Source/WorkflowsApi/tests/OldClients/Faithlife.WorkflowsApi.OldClient_0_1_106/bin
An error occurred when executing task 'Clean'.
Error: System.AggregateException: One or more errors occurred. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/matt.preucil/Source/WorkflowsApi/tests/OldClients/Faithlife.WorkflowsApi.OldClient_0_1_106/bin/x64/Release/logs/oldclient.txt'.
at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x000f7] in <96663bfa99794d8ba6608379d7217040>:0
at System.IO.FileInfo.Delete () [0x00038] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.IO.File.Delete () [0x00000] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Cake.Common.IO.DirectoryCleaner.CleanDirectory (Cake.Core.IO.IDirectory root, System.Func`2[T,TResult] predicate, System.Int32 level) [0x00067] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.CleanDirectory (Cake.Core.IO.IDirectory root, System.Func`2[T,TResult] predicate, System.Int32 level) [0x00022] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.CleanDirectory (Cake.Core.IO.IDirectory root, System.Func`2[T,TResult] predicate, System.Int32 level) [0x00022] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.Clean (Cake.Core.ICakeContext context, Cake.Core.IO.DirectoryPath path, System.Func`2[T,TResult] predicate) [0x000a8] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.Clean (Cake.Core.ICakeContext context, Cake.Core.IO.DirectoryPath path) [0x00000] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryAliases.CleanDirectory (Cake.Core.ICakeContext context, Cake.Core.IO.DirectoryPath path) [0x00000] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryAliases.CleanDirectories (Cake.Core.ICakeContext context, System.Collections.Generic.IEnumerable`1[T] directories) [0x0001e] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryAliases.CleanDirectories (Cake.Core.ICakeContext context, System.String pattern) [0x00021] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Submission#0.CleanDirectories (System.String pattern) [0x0000c] in <2a6b92a8b46445acb19bf07d8a13e1a9>:0
at Submission#0.<>b__0_1 () [0x00019] in <2a6b92a8b46445acb19bf07d8a13e1a9>:0
at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass17_0.b__0 (Cake.Core.ICakeContext context) [0x00000] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass20_0.b__0 (Cake.Core.ICakeContext x) [0x00000] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Cake.Core.CakeTask+d__43.MoveNext () [0x00066] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.DefaultExecutionStrategy+d__4.MoveNext () [0x000ee] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.CakeEngine+d__31.MoveNext () [0x00131] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.CakeEngine+d__28.MoveNext () [0x00124] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.CakeEngine+d__27.MoveNext () [0x00338] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Scripting.BuildScriptHost+d__3.MoveNext () [0x0009f] in :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Submission#0+<>d__0.MoveNext () [0x004cf] in <2a6b92a8b46445acb19bf07d8a13e1a9>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState+d__9`1[TResult].MoveNext () [0x00186] in <3bfae55b53254752b1c3dc824b21dbe3>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Microsoft.CodeAnalysis.Scripting.Script`1+d__21[T].MoveNext () [0x000a8] in <3bfae55b53254752b1c3dc824b21dbe3>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <96663bfa99794d8ba6608379d7217040>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <96663bfa99794d8ba6608379d7217040>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Scripting.Roslyn.RoslynScriptSession.Execute (Cake.Core.Scripting.Script script) [0x001a7] in :0
at Cake.Core.Scripting.ScriptRunner.Run (Cake.Core.Scripting.IScriptHost host, Cake.Core.IO.FilePath scriptPath, System.Collections.Generic.IDictionary`2[TKey,TValue] arguments) [0x00358] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Cake.Commands.BuildCommand.Execute (Cake.CakeOptions options) [0x0003f] in :0
at Cake.CakeApplication.Run (Cake.CakeOptions options) [0x00015] in :0
at Cake.Program.Main () [0x000d1] in :0
---> (Inner Exception #0) System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/matt.preucil/Source/WorkflowsApi/tests/OldClients/Faithlife.WorkflowsApi.OldClient_0_1_106/bin/x64/Release/logs/oldclient.txt'.
at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x000f7] in <96663bfa99794d8ba6608379d7217040>:0
at System.IO.FileInfo.Delete () [0x00038] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.IO.File.Delete () [0x00000] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Cake.Common.IO.DirectoryCleaner.CleanDirectory (Cake.Core.IO.IDirectory root, System.Func`2[T,TResult] predicate, System.Int32 level) [0x00067] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.CleanDirectory (Cake.Core.IO.IDirectory root, System.Func`2[T,TResult] predicate, System.Int32 level) [0x00022] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.CleanDirectory (Cake.Core.IO.IDirectory root, System.Func`2[T,TResult] predicate, System.Int32 level) [0x00022] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.Clean (Cake.Core.ICakeContext context, Cake.Core.IO.DirectoryPath path, System.Func`2[T,TResult] predicate) [0x000a8] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryCleaner.Clean (Cake.Core.ICakeContext context, Cake.Core.IO.DirectoryPath path) [0x00000] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryAliases.CleanDirectory (Cake.Core.ICakeContext context, Cake.Core.IO.DirectoryPath path) [0x00000] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryAliases.CleanDirectories (Cake.Core.ICakeContext context, System.Collections.Generic.IEnumerable`1[T] directories) [0x0001e] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Cake.Common.IO.DirectoryAliases.CleanDirectories (Cake.Core.ICakeContext context, System.String pattern) [0x00021] in <629bfe4bf94149d9bd96a9ce923ed00c>:0
at Submission#0.CleanDirectories (System.String pattern) [0x0000c] in <2a6b92a8b46445acb19bf07d8a13e1a9>:0
at Submission#0.<>b__0_1 () [0x00019] in <2a6b92a8b46445acb19bf07d8a13e1a9>:0
at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass17_0.b__0 (Cake.Core.ICakeContext context) [0x00000] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass20_0.b__0 (Cake.Core.ICakeContext x) [0x00000] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Cake.Core.CakeTask+d__43.MoveNext () [0x00066] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.DefaultExecutionStrategy+d__4.MoveNext () [0x000ee] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.CakeEngine+d__31.MoveNext () [0x00131] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.CakeEngine+d__28.MoveNext () [0x00124] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.CakeEngine+d__27.MoveNext () [0x00338] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Scripting.BuildScriptHost+d__3.MoveNext () [0x0009f] in :0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <5b0aab9fcc1a4aee9b9c4ae93daf4114>:0
at Submission#0+<>d__0.MoveNext () [0x004cf] in <2a6b92a8b46445acb19bf07d8a13e1a9>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState+d__9`1[TResult].MoveNext () [0x00186] in <3bfae55b53254752b1c3dc824b21dbe3>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <96663bfa99794d8ba6608379d7217040>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <96663bfa99794d8ba6608379d7217040>:0
at Microsoft.CodeAnalysis.Scripting.Script`1+d__21[T].MoveNext () [0x000a8] in <3bfae55b53254752b1c3dc824b21dbe3>:0 <---
~~~

Contributor guide

Open the contributing guide

Research direction

Start in src/Cake.Core/IO/Path.cs, especially the path conversion described around line 66, and reproduce the macOS case with a filename containing a backslash. Verify the fix by running CleanDirectories on that directory and confirming the original path round-trips and the file operation does not fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.