-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Describe the bug
We have some Azure pipelines that run some .NET commands through Wine on Linux agents. Upon trying to upgrade from .NET 6 to .NET 8, we can no longer run any dotnet command from Wine (for example, /opt/wine-stable/bin/wine64 $HOME/win-dotnet/dotnet.exe --version) on our pipelines. Instead we get an exception:
Unhandled exception. System.IO.IOException: Invalid access.
at System.ConsolePal.SetConsoleOutputEncoding(Encoding enc)
at System.Console.set_OutputEncoding(Encoding value)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
I'm using dotnet --version as an example in this bug, but it happens for dotnet *anything*.
- Running
/path/to/wine64 /path/to/dotnet.exe --versionfrom the Azure agent pipeline job works on .NET 5/6 - Running
/path/to/wine64 /path/to/dotnet.exe --versionin a regular Terminal on the same agent works on .NET 5/6/7/8 - Native Linux .NET 8 commands work from the pipeline, if
dotnet-sdkis installed
In Wine, we get the following warning when running from an Azure agent:
0024:warn:console:console_ioctl Incorrect access to Shell-no-window console (ioctl=50403c)
Which possibly was not a problem until hitting this code that was added: dotnet/sdk@697d62c
To Reproduce
Prereq: an Azure agent that runs on Linux
- Install the latest version of
wine-stableon the agent - Download and unzip the latest version of .NET 7 or .NET 8 for Windows somewhere on the agent, for example
$HOME/win-dotnet - In a pipeline script targeting the agent, run
/opt/wine-stable/bin/wine64 $HOME/win-dotnet/dotnet.exe --version - Run pipeline -> hit exception.
Example pipeline file: https://gist.github.com/Wedgetable/e75b08ae1eb3b2fb10cc2a53a9953745
Exceptions (if any)
Unhandled exception. System.IO.IOException: Invalid access.
at System.ConsolePal.SetConsoleOutputEncoding(Encoding enc)
at System.Console.set_OutputEncoding(Encoding value)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Further technical details
- Agent version: 3.232.1
- OS: Ubuntu 20.04.6 LTS 64-bit
- wine64 version: wine-9.0
- .NET SDK for Windows version(s): 7.0.405, 8.0.101
Not sure if this is a .NET bug, a Wine bug, or an Azure pipelines agent bug. We are currently getting technical support from CodeWeavers on this issue as well.