Closed bstichter closed 1 year ago
Some commentary on the specific locale warnings mentioned in our situation can be found in this Stack article: https://stackoverflow.com/a/76283533. The change triggering this problem came from this pull request: https://github.com/ChilliCream/graphql-platform/pull/6012
The PR https://github.com/dotnet/msbuild/pull/9391 should resolve this, but we can try ignoring stderr before the new release of msbuild
but we can try ignoring stderr before the new release of msbuild
This issue might be relevant as it appears not possible to differentiate between stdout and stderr: https://github.com/dotnet/msbuild/issues/6838.
Redirecting stderr might not resolve the issue either because the errors in question are generated by preceding commands.
The ConsoleOutput
of Exec
task is an array that contains each line. I think we should determine version string line and filter the output solves this?
Is there an existing issue for this?
Product
Strawberry Shake
Describe the bug
The current implementation of the Strawberry Shake version check calls "dotnet --version", captures the result into a build variable, and tests the version using VersionGreaterThanOrEquals(). Any additional content output by the dotnet CLI will corrupt the version and cause this check to fail. The check either needs to use an alternate approach to retrieve the version that is not subject to this or needs to filter the output to eliminate extraneous information and retain only the version number.
The specific condition that we encountered this was because the dotnet CLI will generate warning messages if the "en_US.UTF-8" locale is not set up on your system even if it is not actually used. The warning message is: /usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8).
This will fail a Strawberry Shake build with the error: /opt/app-root/.nuget/packages/strawberryshake.server/13.1.0/build/StrawberryShake.Server.targets(38,20): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals(/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8);6.0.120, 6)" cannot be evaluated. Version string was not in a correct format..
In this case, we were able to work around the problem by updating our containers to add the locale expected by the dotnet CLI. This problem would exist, however, for any additional output generated by the dotnet CLI even in other conditions.
Steps to reproduce
Relevant log output
Additional Context?
No response
Version
13.4.0