-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RestoreTaskEx needs to use a response file when calling NuGet.Build.Tasks.Console.exe #12843
Comments
Small update. The restore operation which triggers this error is coming from a nested <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Restore" Properties="RestoreWithR2R=true;RestoreUseStaticGraphEvaluation=false" /> That gives us a temporary work around. Hopefully helps pinpoint the issue a bit for you all :) |
Running `Build.cmd -pack -restore` on most machines is leading to the following error: > \NuGet.RestoreEx.targets(19,5): error : The filename or extension is too long This seems to be caused by an excessively long command line being passed to a tool within the NuGetRestoreEx task. Temporarily working around this by disabling static graph on this restore operation. NuGet/Home#12843
Running `Build.cmd -pack -restore` on most machines is leading to the following error: > \NuGet.RestoreEx.targets(19,5): error : The filename or extension is too long This seems to be caused by an excessively long command line being passed to a tool within the NuGetRestoreEx task. Temporarily working around this by disabling static graph on this restore operation. NuGet/Home#12843
Duplicate of #11968 |
I tried fixing this once and it caused a regression so we reverted it since not very many people hit the original issue. NuGet/NuGet.Client#4772 |
Duplicate of # 11968 see above #12843 (comment) |
Will move conversation over to #11968. It's a bit discouraging to see that particular issue has been opened for over a year now with no resolution. This is a frustratingly hard problem to diagnose when hit and the build is unusable until you root cause it. |
@jaredpar in NuGet/NuGet.Client#5413 it will now automatically detect if the command-line argument string is too long and serialize global properties over STDIN. I also added better error handling which will log much clearer errors if something happens during argument parsing. |
NuGet Product Used
MSBuild.exe
Product Version
Visual Studio 17.7 but guessing any existing release has this behavior
Worked before?
The bug has seemingly always existed but was recently exposed due to our increase in code size
Impact
I'm unable to use this version
Repro Steps & Context
Repro steps:
Build.cmd -restore -pack
This will error with
The reason is RestoreTaskEx project shells out to NuGet.Build.Tasks.Console.exe. One of the arguments it passes is a mapping of projects in the restore plus, their absolute path and several configuration.
Example:
I'm unsure what criteria is used here (assume it's just transitive dependencies) but it does scale with the number of included projects. That means once enough projects are included in the restore operation the command argument can exceed the maximum command line length. This will result in the
RestoreTaskEx
task failing as it exceeds this limit.Believe that RestoreTaskEx and NuGet.Build.Tasks.Console.exe should be communicating via a response file. This is common practice when shelling out from a build task to a tool that takes command lines whose length scales with the size of the build input.
Verbose Logs
Can provide a binary log if this helps with the diagnosis. Here is the full invocation for
Nuget.Build.Tasks.Console.exe
https://gist.github.com/jaredpar/7d73ac0106613d6b0c9a375043d3b9f6
The text was updated successfully, but these errors were encountered: