From fbe80503bc05f3bb715b8bb5e8dc0b2c94a467d8 Mon Sep 17 00:00:00 2001 From: Jared Parsons Date: Tue, 20 Jul 2021 13:45:49 -0700 Subject: [PATCH] Remove file count limitation in server build The server protocol used to enforce a max of 65,535 files passed to the compilation. This isn't due to any limitation in the compiler but instead a guard against a bug in one of our internal build systems. It provided graceful failure when a build authoring bug caused the contents of the file system to be passed to the compiler. That is no longer an issue and the existing limit is blocking real customer scenarios. Should it become an issue again there is code we could insert into the customer targets to add a similar guard. I thought for a bit on what a new limit should be and eventually decided there wasn't a reasonable one. The compiler server already has a protocol guard on the size of the message payload. The batch compiler generally doesn't enforce limits of this nature, insead we attempt to scale to the build requested by the user. Hence just removed the limitation entirely closes #54775 --- src/Compilers/Core/CommandLine/BuildProtocol.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Compilers/Core/CommandLine/BuildProtocol.cs b/src/Compilers/Core/CommandLine/BuildProtocol.cs index 4ad65f3c4db6d..2d3836376f3e7 100644 --- a/src/Compilers/Core/CommandLine/BuildProtocol.cs +++ b/src/Compilers/Core/CommandLine/BuildProtocol.cs @@ -69,13 +69,6 @@ public BuildRequest(RequestLanguage language, CompilerHash = compilerHash; Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); - - if (Arguments.Count > ushort.MaxValue) - { - throw new ArgumentOutOfRangeException(nameof(arguments), - "Too many arguments: maximum of " - + ushort.MaxValue + " arguments allowed."); - } } public static BuildRequest Create(RequestLanguage language,