UnifiedAPI project not build against currently installed version of Mono

Hi,

I hesitated between posting here or the VS for Mac board. But since the issue is specifically related to the UnifiedAPI, I assumed it would be platform specific. Sorry if I'm wrong.

I have mono 4.8.1.0 installed and I made sure to delete all other versions of mono from /Library/Frameworks/Mono.framework/Versions (in case this would be the issue).

If I build my UnifiedAPI branch with this code inside:

[DllImport("__Internal", EntryPoint="mono_get_runtime_build_info")]
public extern static string GetMonoVersion();
...
Console.WriteLine("Mono version: {0}", GetMonoVersion());

I get the following console output:

Mono version: 5.2.0 (tarball)

If I build my ClassicAPI branch with the same code, I get the following console output:

Mono version: 4.8.1 (mono-4.8.0-branch/22a39d7)

Mono version 4.8.1.0 is definitely what is expected since this is what I have installed. Anyone can explain to me what's up with this?

This is quite important for me since I build against mono 4.8.1.0 to solve this issue: https://bugzilla.xamarin.com/show_bug.cgi?id=60128

Any help would be appreciated.

Best Answer

Answers

  • XavierFortinXavierFortin USMember ✭✭

    Sorry for the spam.

    I was forgetting. It's important to note I'm using Xamarin Studio and mdtool to build both apps in this case since VS for Mac does not support mono 4.8.1.0.

  • XavierFortinXavierFortin USMember ✭✭

    Hi Chris,

    Thank you for the quick response.

    @ChrisHamons said:

    • If you want a mono fix, you have to rebuild Xamarin.Mac against that mono.

    This definitely looks like what I'd need. Doesn't sound trivial though.

    I can build it, but there is a check on the Mono version. In latest, it's on Mono 5.8.0.0. While I can change the check to 4.8.1.0, is this really advisable? I would suppose the check is there for a reason. And I get an error building with 4.8.1.0 regardless.

    Should I get/build an older version of Xamarin.Mac that already include my preferred Mono version? Because this seems like it could become an issue too.

  • ChrisHamonsChrisHamons USXamarin Team Xamurai

    No, you can not just change the pre-build check to 4.8 and get a successful Xamarin.Mac.

    Xamarin.Mac (and iOS) use various mono APIs which change between versions. Trying to build a new XM with 4.8 is going to be a world of pain.

    Let's back up like three steps though.

    1) Have you tried latest XM master (https://jenkins.mono-project.com/view/Xamarin.MaciOS/job/xamarin-macios-builds-master/) to see if it's fixed already? There have been a number of changes related to web request, and this sounds a lot like https://bugzilla.xamarin.com/show_bug.cgi?id=60317

    2) If it isn't fixed, then your biggest goal should be getting the mono team a sample to reproduce the issue. We can't fix what we can't see, and building XM with older mono is a baidaids at best. A small console app is best, but a small XM app can work.

    3) If you want to build xamarin-macios you can ask questions here - https://gitter.im/xamarin/xamarin-macios

  • XavierFortinXavierFortin USMember ✭✭

    @ChrisHamons said:
    1) Have you tried latest XM master (https://jenkins.mono-project.com/view/Xamarin.MaciOS/job/xamarin-macios-builds-master/) to see if it's fixed already? There have been a number of changes related to web request, and this sounds a lot like https://bugzilla.xamarin.com/show_bug.cgi?id=60317

    Well, when I was fiddling with the source, I did just build it normally with Mono 5.8 and try. It didn't solve the timeout though. From your link, I suppose I can download the xamarin.mac-4.1.0.324.pkg link and just install it? I did this too, just in case, and still no success.

    @ChrisHamons said:
    2) If it isn't fixed, then your biggest goal should be getting the mono team a sample to reproduce the issue. We can't fix what we can't see, and building XM with older mono is a baidaids at best. A small console app is best, but a small XM app can work.

    While I perfectly understand your train of thought, some time the ugliest but quickest solution is the best. I would sure prefer it to be fixed in most recent version of Mono. The solution is not as simple as building a small app reproducing the issue though. I would also need to build a small server reproducing the issue and, since I haven't had the time to investigate the specific cause, this is where it gets more tricky.

    I'm not saying I'll never come up with something, but up to now I've had quite a lot of other things to do and building against Mono 4.8.1.0, while nor the recommended nor the prettiest solution, as worked while being easy to implement.

    Clearly, with the UnifiedAPI, this is no longer the case, which is, by the way, somewhat worrying. It's not the first time we had issue with Mono and needed to revert back to a previous version. Up to now, it was a simple matter and ensured that we could easily "fix" any regression that would come to be in new Mono versions. I suppose reverting Xamarin.Mac in those situation will be the new solution from now on.

    All that being said, I'll get into this a bit more seriously now since, ultimately, updating Mono would have been unavoidable one day or another.

    @ChrisHamons said:
    3) If you want to build xamarin-macios you can ask questions here - https://gitter.im/xamarin/xamarin-macios

    I think I'll put this on the shelf for now since this appears to be non trivial.

    Thank you again,

    I'll look into providing a environment to reproduce the issue.

  • ChrisHamonsChrisHamons USXamarin Team Xamurai

    Yep, reverting XM will revert the stored mono.

    You could also/instead use system mono Target Framework (https://developer.xamarin.com/guides/mac/advanced_topics/target-framework/) which would use the system mono. You get the keep the pieces if that breaks things though, it's unsupported for a reason.

Sign In or Register to comment.