mono / Embeddinator-4000

Tools to turn .NET libraries into native libraries that can be consumed on Android, iOS, Mac, Linux and other platforms.
MIT License
758 stars 95 forks source link

Update to Mono 5.10.1.47 seems to break E4k 0.4.0 (NuGet) #670

Closed lemonmojo closed 6 years ago

lemonmojo commented 6 years ago

Just updated the whole Xamarin/MS stack (Mono, Xamarin.Mac, VS, etc.) and after the update my sample project (available on Github) doesn't build anymore.

Here are the errors I get:

/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/include/xamarin/runtime-generated.h(86,1): error G315394AC: must use 'enum' tag to refer to type 'MarshalManagedExceptionMode'
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/include/xamarin/runtime-generated.h(89,1): error G315394AC: must use 'enum' tag to refer to type 'MarshalObjectiveCExceptionMode'
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/include/xamarin/runtime.h(88,18): error GF12A802B: pointer to non-const type 'const Protocol *' with no explicit ownership
/PATH/Embeddinator-4000.targets(3,3): error MSB3073: The command "/PATH/packages/Embeddinator-4000.0.4.0/tools/objcgen bin/Debug/LIB.dll --target=framework --platform=macOS-modern --abi=x86_64 --nativeexception --compile --debug --outdir=bin/Debug/" exited with code 1.

And the info from VS's about screen:

=== Visual Studio Professional 2017 for Mac ===

Version 7.5 (build 1254)
Installation UUID: 7c1f22f0-9e53-4c07-9bd3-4086f6c262d4
Runtime:
    Mono 5.10.1.47 (2017-12/8eb8f7d5e74) (64-bit)
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 4.4.0.36 (master / 0c7c49a6)

    Package version: 510010047

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    2.0.5
    2.0.3
    2.0.0
    1.1.1
    1.0.4
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
    2.1.4
    2.0.3
    2.0.2
    1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

'/Applications/Xamarin Profiler.app' not found

=== Apple Developer Tools ===

Xcode 9.3 (14154)
Build 9E145

=== Xamarin.Mac ===

Version: 4.4.1.176 (Visual Studio Professional)

=== Xamarin.iOS ===

Version: 11.10.1.177 (Visual Studio Professional)
Hash: 7e782c1e
Branch: d15-7
Build date: 2018-04-25 15:27:13-0400

=== Xamarin.Android ===

Not Installed

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 705001254
Git revision: 498923ea36d2c7fe440c4e4b8cfb75bd50bbd748
Build date: 2018-05-05 10:35:24-04
Xamarin addins: 219f1c4943b4693b837b4173dd10ea982a47c852
Build lane: monodevelop-lion-d15-7

=== Operating System ===

Mac OS X 10.13.5
Darwin 17.6.0 Darwin Kernel Version 17.6.0
    Wed Apr 25 22:09:51 PDT 2018
    root:xnu-4570.60.20~7/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Internet of Things (IoT) development (Preview) 7.1
tombly commented 6 years ago

Same thing happening for me after upgrading today:

Compiling binding code...
Found Mono 5.10.1.47 (between 5.0.0.18 and 5.2.99)
Found Xamarin.iOS 11.10.1.177 (between 10.11.0.136 and 10.11.0.136)
    xcode-select -p
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT -fembed-bitcode -c ./glib.c -o ./armv7/glib.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT -fembed-bitcode -c ./mono_embeddinator.c -o ./armv7/mono_embeddinator.o 
In file included from ./mono_embeddinator.c:29:
In file included from ./mono_embeddinator.h:32:
In file included from ./mono-support.h:32:
In file included from /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/xamarin.h:14:
In file included from /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime.h:21:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime-generated.h:86:1: error: must use 'enum' tag to refer to type 'MarshalManagedExceptionMode'
MarshalManagedExceptionMode
^
enum 
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime-generated.h:89:1: error: must use 'enum' tag to refer to type 'MarshalObjectiveCExceptionMode'
MarshalObjectiveCExceptionMode
^
enum 
In file included from ./mono_embeddinator.c:29:
In file included from ./mono_embeddinator.h:32:
In file included from ./mono-support.h:32:
In file included from /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/xamarin.h:14:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime.h:88:18: error: pointer to non-const type 'const Protocol *' with no explicit ownership
        const Protocol **protocols; // the corresponding native protocols
                        ^
3 errors generated.

Done
robotogre commented 6 years ago

Mine is broken in the same way. :(

Also, I tried the latest Mono (5.12) and it has the same issue. In fact, I've tried installing every Mono package going back to 5.4 (version 5.4 breaks Visual Studio), and I can find no solution that will let me continue my work.....

 ./packages/Embeddinator-4000.0.4.0/tools/objcgen

 ./hello-from-csharp/bin/Debug/hello-from-csharp.dll --target=framework --platform=iOS --outdir=output -c --debug"
Symbol file /Users/tom/Projects/hello-from-csharp/packages/Embeddinator-4000.0.4.0/tools/IKVM.Reflection.pdb doesn't match image /Users/tom/Projects/hello-from-csharp/packages/Embeddinator-4000.0.4.0/tools/IKVM.Reflection.dll
Parsing assemblies...
    Parsed './hello-from-csharp/bin/Debug/hello-from-csharp.dll'
Processing assemblies...
    0 types found
Generating binding code...
    Generated: output/bindings.h
    Generated: output/bindings-private.h
    Generated: output/bindings.m
    Generated: output/bindings.xml
    Generated: output/embeddinator.h
    Generated: output/glib.h
    Generated: output/mono_embeddinator.h
    Generated: output/mono-support.h
    Generated: output/objc-support.h
    Generated: output/glib.c
    Generated: output/mono_embeddinator.c
    Generated: output/objc-support.m
    Generated: output/Make.config
Compiling binding code...
Found Mono 5.12.0.233 (between 5.4.1.7 and 5.4.1.7)
Found Xamarin.iOS 11.10.1.177 (between 11.6.1.3 and 11.6.1.3)
    xcode-select -p
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output/glib.c -o output/armv7/glib.o 
    xcrun clang -g -O0 -fobjc-arc -ObjC -Wall -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=8.0 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include -DXAMARIN_IOS -DMONO_EMBEDDINATOR_DLL_EXPORT  -c output/mono_embeddinator.c -o output/armv7/mono_embeddinator.o 
In file included from output/mono_embeddinator.c:29:
In file included from output/mono_embeddinator.h:32:
In file included from output/mono-support.h:36:
In file included from /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/xamarin.h:14:
In file included from /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime.h:21:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime-generated.h:86:1: error: must use 'enum' tag to refer to type 'MarshalManagedExceptionMode'
MarshalManagedExceptionMode
^
enum 
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime-generated.h:89:1: error: must use 'enum' tag to refer to type 'MarshalObjectiveCExceptionMode'
MarshalObjectiveCExceptionMode
^
enum 
In file included from output/mono_embeddinator.c:29:
In file included from output/mono_embeddinator.h:32:
In file included from output/mono-support.h:36:
In file included from /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/xamarin.h:14:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/SDKs/MonoTouch.iphoneos.sdk/usr/include/xamarin/runtime.h:88:18: error: pointer to non-const type 'const Protocol *' with no explicit ownership
        const Protocol **protocols; // the corresponding native protocols
                        ^
3 errors generated.

Done
tombly commented 6 years ago

Until this is sorted out, does anyone know if it is possible to download the previous version of VS Mac?

lemonmojo commented 6 years ago

Unfortunately it seems like there's no way to download previous releases curently: https://forums.xamarin.com/discussion/123413/install-previous-version-of-visual-studio-for-mac

chamons commented 6 years ago

Hey everyone, I'm taking a look now. This is a list of 15.6 packages you can downgrade to until I figure out what's going on:

https://dl.xamarin.com/XamarinforMac/Mac/xamarin.mac-4.2.1.28.pkg https://dl.xamarin.com/MonoTouch/Mac/xamarin.ios-11.9.1.24.pkg https://dl.xamarin.com/MonoFrameworkMDK/Macx86/MonoFramework-MDK-5.8.1.0.macos10.xamarin.universal.pkg

edit - Only downgrading Xamarin.iOS/Mac is needed.

lemonmojo commented 6 years ago

Thx, @chamons. I can confirm that with those pkgs E4k works again.

tombly commented 6 years ago

Awesome, thanks @chamons, back in business here with 15.6.

chamons commented 6 years ago

I've done some homework and can confirm that https://github.com/xamarin/xamarin-macios/commit/c9fac28a8f6840c069ad715b43f1a0192eb38ef6 needs to be added to 15-7 to un-break E4K. I will look at getting it added, but you can downgrade XI/XM to 15.6 or using master until then.

Mono/VSfM should be able to upgrade to 15.7 without issues (beyond the we didn't test mismatched version thing).

chamons commented 6 years ago

You can also work around this by installing XM/XI from the alpha channel, which has the fix from master already.

lemonmojo commented 6 years ago

Thx for the hint, @chamons. I can confirm that it works with the bits from the alpha channel.

SkyeHoefling commented 6 years ago

Confirming upgrading to the alpha channel fixes the issue

chamons commented 6 years ago

Ok, I'm going to close this as the fix will be pushed out more general to stable soon (it is in Alpha). Given how long it takes to push releases, I won't be able to get it out to stable sooner even if I worked on a service release.

Sorry for the trouble everyone!

emysa341 commented 6 years ago

I have the following (Latest) version, I am still having above errors, if I downgrade to Xamarin.iOS (11.9.1.24) and Xamarin.mac (4.2.1.28) it unbreaks the E4k. My question is, do we have a fix in the following version or still the fix exists in the alpha channel ?


Xamarin.Mac
Version: 4.4.1.193 (Visual Studio Community)

Xamarin.iOS
Version: 11.12.0.4 (Visual Studio Community)
Hash: 64fece5f
Branch: d15-7
Build date: 2018-05-29 20:00:44-0400
chamons commented 6 years ago

15-7 should have this fix @emysa341 - Could you open a new issue with a build log / information requested so we can figure out how this regressed.

jnajerasc commented 6 years ago

Another data point: I've been running the downgraded Xamarin.Mac version 4.2.1.28 for a few months now. Today, 2018-08-29, I upgraded my Visual Studio for Mac using the stable branch, which included upgrades to Mono (5.10.1.57 -> 5.12.0.301) and Xamarin.Mac (4.6.0.14). I started to get this error from Embeddinator: error MM2002: Failed to resolve "System.Diagnostics.PerformanceCounter" reference from "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

I downgraded only Xamarin.Mac back to 4.2.1.28 to resolve the error. Embeddinator outputs a valid framework bundle, which I'm still able to use in my Objective-C application.

emysa341 commented 6 years ago

@chamons I updated the visual studio again, it got fixed. Thanks though.

chamons commented 6 years ago

@jnajerasc That shouldn't have changed unless it in the mono bump.

Consider posting on the forum or raising and issue on xamarin-macios - https://github.com/xamarin/xamarin-macios/issues/new

emysa341 commented 6 years ago

@chamons Thanks for concern, I updated the mono, it got fixed.