xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.43k stars 507 forks source link

OutputPath issues with default net6.0-macos project #12174

Open kdubau opened 3 years ago

kdubau commented 3 years ago

Steps to Reproduce

  1. dotnet new macos
  2. add <RuntimeIdentifier>osx-x64</RuntimeIdentifier> to thee csproj because https://github.com/xamarin/xamarin-macios/issues/12000 is still. an issue.
  3. dotnet build /bl
  4. looks at the outputs in bin/Debug

Expected Behavior

Actual Behavior

See my comments inline with the tree output below.

bin/Debug/
└── net6.0-macos
    ├── osx-x64     <--------------- If I understand correctly every single file should be under this directory
    │   ├── Microsoft.*.dll
    │   ├── Microsoft.macOS.registrar.a
    │   ├── Microsoft.macOS.registrar.coreclr.a
    │   ├── System.*.dll
    │   ├── WindowsBase.dll
    │   ├── Xamarin.Mac.dll
    │   ├── libSystem.Globalization.Native.dylib
    │   ├── libSystem.IO.Compression.Native.dylib
    │   ├── libSystem.Native.dylib
    │   ├── libSystem.Net.Security.Native.dylib
    │   ├── libSystem.Security.Cryptography.Native.Apple.dylib
    │   ├── libSystem.Security.Cryptography.Native.OpenSsl.dylib
    │   ├── libcoreclr.dylib
    │   ├── libdbgshim.dylib
    │   ├── libhostfxr.dylib
    │   ├── libhostpolicy.dylib
    │   ├── libmono-component-diagnostics_tracing-static.a
    │   ├── libmono-component-diagnostics_tracing-stub-static.a
    │   ├── libmono-component-hot_reload-static.a
    │   ├── libmono-component-hot_reload-stub-static.a
    │   ├── libmscordbi.dylib
    │   ├── libxamarin-dotnet-coreclr-debug.a
    │   ├── libxamarin-dotnet-coreclr-debug.dylib
    │   ├── libxamarin-dotnet-coreclr.a
    │   ├── libxamarin-dotnet-coreclr.dylib
    │   ├── libxamarin-dotnet-debug.a
    │   ├── libxamarin-dotnet-debug.dylib
    │   ├── libxamarin-dotnet.a
    │   ├── libxamarin-dotnet.dylib
    │   ├── mscorlib.dll
    │   ├── netstandard.dll
    │   ├── publish     <----------- Not entirely sure about this, the files look duped, and I didn't publish
    │   │   ├── Microsoft.macOS.registrar.a
    │   │   ├── Microsoft.macOS.registrar.coreclr.a
    │   │   ├── libmono-component-diagnostics_tracing-static.a
    │   │   ├── libmono-component-diagnostics_tracing-stub-static.a
    │   │   ├── libmono-component-hot_reload-static.a
    │   │   ├── libmono-component-hot_reload-stub-static.a
    │   │   ├── libxamarin-dotnet-coreclr-debug.a
    │   │   ├── libxamarin-dotnet-coreclr.a
    │   │   ├── libxamarin-dotnet-debug.a
    │   │   ├── libxamarin-dotnet.a
    │   │   ├── test-macos-app
    │   │   └── test-macos-app.runtimeconfig.json
    │   ├── ref
    │   │   └── test-macos-app.dll
    │   ├── test-macos-app
    │   ├── test-macos-app.app     <--------------- I believe the "correct" .app bundle
    │   │   └── Contents
    │   │       ├── Info.plist
    │   │       ├── MacOS
    │   │       │   └── test-macos-app
    │   │       ├── MonoBundle
    │   │       │   ├── Microsoft.*.dll
    │   │       │   ├── System.*.dll
    │   │       │   ├── WindowsBase.dll
    │   │       │   ├── Xamarin.Mac.dll
    │   │       │   ├── libSystem.Globalization.Native.dylib
    │   │       │   ├── libSystem.IO.Compression.Native.dylib
    │   │       │   ├── libSystem.Native.dylib
    │   │       │   ├── libSystem.Net.Security.Native.dylib
    │   │       │   ├── libSystem.Security.Cryptography.Native.Apple.dylib
    │   │       │   ├── libSystem.Security.Cryptography.Native.OpenSsl.dylib
    │   │       │   ├── libcoreclr.dylib
    │   │       │   ├── libdbgshim.dylib
    │   │       │   ├── libhostfxr.dylib
    │   │       │   ├── libhostpolicy.dylib
    │   │       │   ├── libmscordbi.dylib
    │   │       │   ├── mscorlib.dll
    │   │       │   ├── netstandard.dll
    │   │       │   ├── runtimeconfig.bin
    │   │       │   ├── test-macos-app.dll
    │   │       │   └── test-macos-app.pdb
    │   │       ├── PkgInfo
    │   │       └── Resources
    │   │           ├── AppIcon.icns
    │   │           ├── Assets.car
    │   │           └── Main.storyboardc
    │   │               ├── Info.plist
    │   │               ├── MainMenu.nib
    │   │               ├── NSWindowController-B8D-0N-5wS.nib
    │   │               └── XfG-lQ-9wD-view-m2S-Jp-Qdl.nib
    │   ├── test-macos-app.dll
    │   ├── test-macos-app.pdb
    │   └── test-macos-app.runtimeconfig.json
    ├── publish     <------------------------------- It's empty but not expecting to see this.
    ├── ref              <-------------------------- Again, not under runtime directory.
    │   └── test-macos-app.dll
    ├── test-macos-app.app   <----------------------- A second, very partial/incomplete, .app bundle
    │   └── Contents
    │       ├── Info.plist
    │       ├── MonoBundle
    │       │   └── runtimeconfig.bin
    │       ├── PkgInfo
    │       └── Resources
    │           ├── AppIcon.icns
    │           ├── Assets.car
    │           └── Main.storyboardc
    │               ├── Info.plist
    │               ├── MainMenu.nib
    │               ├── NSWindowController-B8D-0N-5wS.nib
    │               └── XfG-lQ-9wD-view-m2S-Jp-Qdl.nib
    ├── test-macos-app.dll    <------------------ More not under runtime directory.
    ├── test-macos-app.pdb
    └── test-macos-app.runtimeconfig.json

Environment

.NET SDK (reflecting any global.json):
 Version:   6.0.100-preview.6.21355.2
 Commit:    7f8e0d76c0

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  11.4
 OS Platform: Darwin
 RID:         osx.11.0-x64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.100-preview.6.21355.2/

Host (useful for support):
  Version: 6.0.0-preview.6.21352.12
  Commit:  770d630b28

Build Logs

Binary log although it's super easy to repro :) msbuild.binlog.zip

kdubau commented 3 years ago

Pretty much the same issues when building with CoreCLR runtime with <UseMonoRuntime>false</UseMonoRuntime>: msbuild.binlog.zip

rolfbjarne commented 3 years ago

This is the location of the correct app bundle (when building for a single RuntimeIdentifier):

bin/Debug/net6.0-macos/osx-x64/test-macos-app.app

If you're building for multiple RuntimeIdentifiers (RuntimeIdentifiers=osx-x64;osx-arm64), this will be the correct app bundle:

bin/Debug/net6.0-macos/test-macos-app.app

We'll look into all the other files to see what's happening.