Hubert-Rybak/dotnet-warp

Warp targeting osx when running on Windows fails

boekabart opened this issue · 1 comments

I have this application, totally 'clean' (not a single nuget package), that I can build for both windows and osx.

Was trying to run WARP, which works when I target windows, but not when targeting osx (on my windows dev or buildserver box):

152819 ~\Sandbox\Prive\TypeLes\src\TypeLes [develop ≡ +0 ~1 -0 !]> dotnet warp -r osx-x64 --verbose
- Running Publish...Running dotnet publish -c Release -r osx-x64 -o dotnetwarp_temp /p:ShowLinkerSizeComparison=true C:\Users\bartd\Sandbox\Prive\TypeLes\src\TypeLes
| Running Publish...Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

| Running Publish...  Restoring packages for C:\Users\bartd\Sandbox\Prive\TypeLes\src\TypeLes\TypeLes.csproj...
/ Running Publish...  Restore completed in 162,07 ms for C:\Users\bartd\Sandbox\Prive\TypeLes\src\TypeLes\TypeLes.csproj.
- Running Publish...  TypeLes -> C:\Users\bartd\Sandbox\Prive\TypeLes\src\TypeLes\bin\Release\netcoreapp2.2\osx-x64\TypeLes.dll
| Running Publish...  TypeLes -> C:\Users\bartd\Sandbox\Prive\TypeLes\src\TypeLes\dotnetwarp_temp\

O Running Publish...
- Running Pack...Running C:\Users\bartd\.dotnet\tools\.store\dotnet-warp\1.0.4\dotnet-warp\1.0.4\tools\netcoreapp2.2\any\warp\macos-x64.warp-packer --arch macos-x64 --input_dir C:\Users\bartd\Sandbox\Prive\TypeLes\src\TypeLes\dotnetwarp_temp --exec TypeLes --output TypeLes
X Running Pack...

Unhandled Exception: System.ComponentModel.Win32Exception: The specified executable is not a valid application for this OS platform.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at DotnetWarp.CmdCommands.CommandWrapper.Run(IEnumerable`1 argumentList, Boolean isVerbose) in D:\Projects\dotnet-warp\src\dotnet-warp\CmdCommands\CommandWrapper.cs:line 42
   at DotnetWarp.CmdCommands.CmdCommand.RunCommand(IEnumerable`1 arguments, Boolean isVerbose) in D:\Projects\dotnet-warp\src\dotnet-warp\CmdCommands\CmdCommand.cs:line 16
   at DotnetWarp.CmdCommands.WarpCli.Pack(WarpPackOptions warpPackOptions) in D:\Projects\dotnet-warp\src\dotnet-warp\CmdCommands\WarpCli.cs:line 46
   at DotnetWarp.Program.<>c__DisplayClass21_1.<RunActions>b__0(Spinner spinner) in D:\Projects\dotnet-warp\src\dotnet-warp\Program.cs:line 152
   at Kurukuru.Spinner.Start(String text, Action`1 action, Pattern pattern, Pattern fallbackPattern)
   at DotnetWarp.Program.RunActions(List`1 actions) in D:\Projects\dotnet-warp\src\dotnet-warp\Program.cs:line 149
   at DotnetWarp.Program.OnExecute() in D:\Projects\dotnet-warp\src\dotnet-warp\Program.cs:line 117
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.Invoke(MethodInfo method, Object instance, Object[] arguments)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass138_0.<OnExecute>b__0()
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](CommandLineContext context)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](IConsole console, String[] args)
   at DotnetWarp.Program.Main(String[] args) in D:\Projects\dotnet-warp\src\dotnet-warp\Program.cs:line 20

Looking at the the code in 0813516 , I seems that the target platform also is used to select the warp executable to use?

Is this by design (as in - cross platform warping not possible), or a bug?

Should be trivial to repro on any freshly created dotnet console app.

Unfortunetly, it's not possible, as Warp needs to be run with platform specific executable.