DupFinder failing with 'The filename or extension is too long'
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 19
Description
### What You Are Seeing?
Calling `DupFinder(@"**/*.cs");` fails with "Error: The filename or extension is too long"
### What is Expected?
DupFinder should run without error.
JetBrains DupFinder.exe already handles wildcard expansion correctly. I don't think the current implementation is correct that Cake is trying to do this on DupFinder's behalf.
Alternatively, there should be a way to pass in the wildcard so it is passed untouched through to DupFinder.exe
### What version of Cake are you using?
0.19.5
### Are you running on a 32 or 64 bit system?
64
### What environment are you running on? Windows? Linux? Mac?
Windows
### How Did You Get This To Happen? (Steps to Reproduce)
Solution has projects which include `node_modules` deep directory hierarchies.
### Output Log
```
Error: System.ComponentModel.Win32Exception (0x80004005): The filename or extension is too long
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Cake.Core.IO.ProcessRunner.Start(FilePath filePath, ProcessSettings settings)
at Cake.Core.Tooling.Tool`1.RunProcess(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processS
ettings)
at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings
, Action`1 postAction)
at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments)
at Cake.Common.Tools.DupFinder.DupFinderRunner.Run(IEnumerable`1 filePaths, DupFinderSettings settings)
at Cake.Common.Tools.DupFinder.DupFinderAliases.DupFinder(ICakeContext context, String pattern, DupFinderSettings set
tings)
at Submission#0.<.ctor>b__32()
at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass5_0.b__0(ICakeContext context)
at Cake.Core.ActionTask.Execute(ICakeContext context)
at Cake.Core.DefaultExecutionStrategy.Execute(CakeTask task, ICakeContext context)
at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask
task, CakeReport report)
at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target)
at Cake.Scripting.BuildScriptHost.RunTarget(String target)
at Submission#0..ctor(Session session, Object& submissionResult)
at Submission#0.(Session session)
at Roslyn.Scripting.CommonScriptEngine.Execute[T](String code, String path, DiagnosticBag diagnostics, Session sessio
n, Boolean isInteractive)
at Roslyn.Scripting.Session.Execute(String code)
at Cake.Scripting.Roslyn.Stable.DefaultRoslynScriptSession.Execute(Script script)
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
at Cake.Commands.BuildCommand.Execute(CakeOptions options)
at Cake.CakeApplication.Run(CakeOptions options)
at Cake.Program.Main()
```
Contributor guide
Research direction
Start at Cake.Common.Tools.DupFinder.DupFinderRunner.Run from the stack trace and follow how the pattern becomes process arguments through Cake.Core.Tooling.Tool and Cake.Core.IO.ProcessRunner. Reproduce on Windows with deep node_modules paths and DupFinder("**/*.cs"); done means DupFinder receives the wildcard without the filename-length failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100