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

Unable to compile when an assembly name contains a comma #6726

Closed shejan0 closed 4 years ago

shejan0 commented 4 years ago

Steps to Reproduce

  1. Create a new Cocoa Mac App (C#)
  2. In the Project's Options, adding mmp argument "-nowarn" to the 'Mac Build' configuration
  3. Attempting to compile code with no changes

Expected Behavior

Code should compile, and presumingly run, ignoring the warning that my XCode is out of date

Actual Behavior

Error is given:

Building LearningVisualStudioMac (Debug)
Build started 8/6/2019 12:40:42 PM.
__________________________________________________
Project "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/LearningVisualStudioMac.csproj" (Build target(s)):

Target _BeforeCoreCompileImageAssets:
  Skipping target "_BeforeCoreCompileImageAssets" because all output files are up-to-date with respect to the input files.
Target _CoreCompileImageAssets:
  Skipping target "_CoreCompileImageAssets" because all output files are up-to-date with respect to the input files.
Target _CoreCompileInterfaceDefinitions:
      BundleResources Output:
        obj/Debug/ibtool/Main.storyboardc/Info.plist
        obj/Debug/ibtool/Main.storyboardc/MainMenu.nib
        obj/Debug/ibtool/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib
        obj/Debug/ibtool/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib
      OutputManifests Output:
        obj/Debug/ibtool-manifests/Main.storyboardc
Target _CoreCompileColladaAssets:
  Skipping target "_CoreCompileColladaAssets" because it has no inputs.
Target CoreCompile:
    /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Roslyn/csc.exe /noconfig /unsafe+ /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:__UNIFIED__;__MACOS__;DEBUG /errorendlocation /preferreduilang:en-US /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/mscorlib.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Core.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Net.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Xamarin.Mac.dll /debug+ /debug:portable /optimize- /out:"obj/Debug/Lmao, its code time.exe" /target:exe /utf8output Main.cs AppDelegate.cs ViewController.cs ViewController.designer.cs "/var/folders/hf/m2h_8zjn1qq6vrdpqwsrfgwr0000gn/T/Xamarin.Mac,Version=v2.0.AssemblyAttributes.cs"
Target CopyFilesToOutputDirectory:
    Copying file from "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/obj/Debug/Lmao, its code time.exe" to "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/bin/Debug/Lmao, its code time.exe".
    LearningVisualStudioMac -> /Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/bin/Debug/Lmao, its code time.exe
    Copying file from "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/obj/Debug/Lmao, its code time.pdb" to "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/bin/Debug/Lmao, its code time.pdb".
Target _DetectSigningIdentity:
    Detected signing identity:
      Bundle Id: com.OufNibba.LearningVisualStudioMac
      App Id: com.OufNibba.LearningVisualStudioMac
Target _CopyContentToBundle:
  Skipping target "_CopyContentToBundle" because all output files are up-to-date with respect to the input files.
Target _CompileAppManifest:
  Skipping target "_CompileAppManifest" because all output files are up-to-date with respect to the input files.
Target _CompileToNative:
    /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin/mmp "@/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/obj/Debug/response-file.rsp" -nowarn 
    MMP : error MM0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
    System.ArgumentException: Malformed name
      at Mono.Cecil.AssemblyNameReference.Parse (System.String fullName) [0x00159] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/cecil/Mono.Cecil/AssemblyNameReference.cs:208 
      at Xamarin.Bundler.MonoMacResolver.Resolve (System.String fullName) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/resolver.cs:45 
      at Xamarin.Bundler.MonoMacResolver.GetAssembly (System.String fileName) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/resolver.cs:40 
      at Xamarin.Bundler.Driver.Link () [0x00053] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:1398 
      at Xamarin.Bundler.Driver.Pack (System.Collections.Generic.IList`1[T] unprocessed) [0x005cf] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:808 
      at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x01124] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:518 
      at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:211 
Done building target "_CompileToNative" in project "LearningVisualStudioMac.csproj" -- FAILED.

Done building project "LearningVisualStudioMac.csproj" -- FAILED.

Build FAILED.

MMP : error MM0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:12.73

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Build: 1 error, 0 warnings

Environment

=== Visual Studio Community 2019 for Mac ===

Version 8.1.4 (build 5)
Installation UUID: 96850c6a-caa2-4dd1-a87c-c2a61d80539f
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 5.6.0.25 (d16-0 / 50f75273)

    Package version: 518010028

=== Mono Framework MDK ===

Runtime:
    Mono 5.18.1.28 (2018-08/223ea7ef92e) (64-bit)
    Package version: 518010028

=== NuGet ===

Version: 5.0.2.5988

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.1.11
SDK: /usr/local/share/dotnet/sdk/2.1.700/Sdks
SDK Version: 2.1.700
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.10
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.1 (14460.46)
Build 10B61

=== Xamarin.Mac ===

Version: 5.10.0.157 (Visual Studio Community)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:48-0400

=== Xamarin.iOS ===

Version: 12.10.0.157 (Visual Studio Community)
Hash: 6bd94753
Branch: d16-1
Build date: 2019-06-12 17:28:47-0400

=== Xamarin Designer ===

Version: 16.1.0.467
Hash: f1657e133
Branch: remotes/origin/d16-1-new-document-model
Build date: 2019-06-18 21:57:42 UTC

=== Xamarin.Android ===

Not Installed

=== Microsoft Mobile OpenJDK ===

Java SDK: Not Found

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android Device Manager ===

Version: 1.2.0.44
Hash: aac645b
Branch: remotes/origin/d16-1
Build date: 2019-05-29 19:55:24 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 801040005
Git revision: 9c98f365cacfac65fbbaf0a77b2ea7864abef759
Build date: 2019-06-28 21:07:05+00
Build branch: release-8.1
Xamarin extensions: 8cc25b5cb090e6c23b62a7901000c299977eb08d

=== Operating System ===

Mac OS X 10.13.6
Darwin 17.7.0 Darwin Kernel Version 17.7.0
    Sun Jun  2 20:31:42 PDT 2019
    root:xnu-4570.71.46~1/RELEASE_X86_64 x86_64

Build Logs

Building LearningVisualStudioMac (Debug)
Build started 8/6/2019 12:40:42 PM.
__________________________________________________
Project "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/LearningVisualStudioMac.csproj" (Build target(s)):

Target _BeforeCoreCompileImageAssets:
  Skipping target "_BeforeCoreCompileImageAssets" because all output files are up-to-date with respect to the input files.
Target _CoreCompileImageAssets:
  Skipping target "_CoreCompileImageAssets" because all output files are up-to-date with respect to the input files.
Target _CoreCompileInterfaceDefinitions:
      BundleResources Output:
        obj/Debug/ibtool/Main.storyboardc/Info.plist
        obj/Debug/ibtool/Main.storyboardc/MainMenu.nib
        obj/Debug/ibtool/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib
        obj/Debug/ibtool/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib
      OutputManifests Output:
        obj/Debug/ibtool-manifests/Main.storyboardc
Target _CoreCompileColladaAssets:
  Skipping target "_CoreCompileColladaAssets" because it has no inputs.
Target CoreCompile:
    /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/Current/bin/Roslyn/csc.exe /noconfig /unsafe+ /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:__UNIFIED__;__MACOS__;DEBUG /errorendlocation /preferreduilang:en-US /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/mscorlib.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Core.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Net.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Xamarin.Mac.dll /debug+ /debug:portable /optimize- /out:"obj/Debug/Lmao, its code time.exe" /target:exe /utf8output Main.cs AppDelegate.cs ViewController.cs ViewController.designer.cs "/var/folders/hf/m2h_8zjn1qq6vrdpqwsrfgwr0000gn/T/Xamarin.Mac,Version=v2.0.AssemblyAttributes.cs"
Target CopyFilesToOutputDirectory:
    Copying file from "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/obj/Debug/Lmao, its code time.exe" to "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/bin/Debug/Lmao, its code time.exe".
    LearningVisualStudioMac -> /Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/bin/Debug/Lmao, its code time.exe
    Copying file from "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/obj/Debug/Lmao, its code time.pdb" to "/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/bin/Debug/Lmao, its code time.pdb".
Target _DetectSigningIdentity:
    Detected signing identity:
      Bundle Id: com.OufNibba.LearningVisualStudioMac
      App Id: com.OufNibba.LearningVisualStudioMac
Target _CopyContentToBundle:
  Skipping target "_CopyContentToBundle" because all output files are up-to-date with respect to the input files.
Target _CompileAppManifest:
  Skipping target "_CompileAppManifest" because all output files are up-to-date with respect to the input files.
Target _CompileToNative:
    /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin/mmp "@/Users/mac/Documents/Visual Studio/LearningVisualStudioMac/LearningVisualStudioMac/obj/Debug/response-file.rsp" -nowarn 
    MMP : error MM0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
    System.ArgumentException: Malformed name
      at Mono.Cecil.AssemblyNameReference.Parse (System.String fullName) [0x00159] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/cecil/Mono.Cecil/AssemblyNameReference.cs:208 
      at Xamarin.Bundler.MonoMacResolver.Resolve (System.String fullName) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/resolver.cs:45 
      at Xamarin.Bundler.MonoMacResolver.GetAssembly (System.String fileName) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/resolver.cs:40 
      at Xamarin.Bundler.Driver.Link () [0x00053] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:1398 
      at Xamarin.Bundler.Driver.Pack (System.Collections.Generic.IList`1[T] unprocessed) [0x005cf] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:808 
      at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x01124] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:518 
      at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mmp/driver.cs:211 
Done building target "_CompileToNative" in project "LearningVisualStudioMac.csproj" -- FAILED.

Done building project "LearningVisualStudioMac.csproj" -- FAILED.

Build FAILED.

MMP : error MM0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:12.73

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Build: 1 error, 0 warnings

Example Project (If Possible)

Default Cocoa Mac App for C# template

chamons commented 4 years ago

Try --nowarn with two dashes

shejan0 commented 4 years ago

Try --nowarn with two dashes

Still same issue.

chamons commented 4 years ago

Can you please attach a showing the issue --nowarn works just for me:

https://gist.github.com/chamons/b04197ae7c299c3cb1c47c147ad6f621

shejan0 commented 4 years ago

Can you please attach a showing the issue --nowarn works just for me:

https://gist.github.com/chamons/b04197ae7c299c3cb1c47c147ad6f621

https://youtu.be/DqLpKLGoxjA

chamons commented 4 years ago

Could you attach the full build log and project in question? It's hard to debug a video. :)

shejan0 commented 4 years ago

The Full Build Log is in the original question, as for the project:

LearningVisualStudioMac.zip

rolfbjarne commented 4 years ago

The problem isn't the --nowarn argument, it's the fact that there's an assembly with a comma in the name:

 Added assembly /Users/rolf/Downloads/LearningVisualStudioMac/LearningVisualStudioMac/bin/Debug/Lmao, its code time.exe
    MMP : error MM0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new

the workaround is to rename the output assembly to something without a comma.

rolfbjarne commented 4 years ago

A quick test seems to indicate that this works: https://gist.github.com/rolfbjarne/61e6772ddfbf421c6bd18b7b8e06332b, but any PR would also need a test, both for Xamarin.iOS and Xamarin.Mac.