问题
I got this warning after adding a long string generated programmatically as an Azure Pipelines variable (as a quick and easy way to test changes instead of pushing a file to my repo):
##[warning]Environment variable 'INPUT_SCRIPT' exceeds the maximum supported length. Environment variable length: 40384 , Maximum supported length: 32766
The warning is pretty clear to understand and seems appropriate given a regular environment variable, but the task that used this new pipelines variable works as expected (assuming the entire string is there). Is this warning relevant? Will it bite me in the back later if I just ... leave it in?
回答1:
The theoretical maximum length of an environment variable is around 32,760 characters. All environment variables must live together in a single environment block, which itself has a limit of 32767 characters.In practice, you have to share the environment block with all the other variables in the block, so your random call to SetEnvironmentVariable with a 32,760-character string is unlikely to succeed.It also depends on how you’re setting the variable; i.e., the code that your environment-variable-setting technique passes through before it gets to the SetEnvironmentVariable call. For details ,please refer to this link.
Here are two cases with the same warning for reference: 1 and 2
Is this warning relevant? Will it bite me in the back later if I just ... leave it in?
For this issue, I have not found the errors caused by this warning. Since you have already paid attention to this issue, if you encounter errors, you can share them here. Let us investigate them further.
来源:https://stackoverflow.com/questions/56534338/what-is-the-maximum-length-of-a-variable-in-azure-pipelines