Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Updated define constants to address bugzilla 24797 and add missing supported features. - #353

Merged
fsgit merged 2 commits into
fsharp:masterfrom
7sharp9:updatedefines
Dec 1, 2014
Merged

fsgit merged 2 commits into
fsharp:masterfrom
7sharp9:updatedefines

Conversation

@7sharp9

@7sharp9 7sharp9 commented Nov 27, 2014

Copy link
Copy Markdown
Member
  • Removed FX_NO_STRUCTURAL_EQUALITY, FX_NO_CUSTOMATTRIBUTEDATA as these
    are both provided in mscorlib for monotouch/monodroid.
    (FX_NO_STRUCTURAL_EQUALITY actually causes an issue with array
    comparisons within tuples, see bugzilla 24797)
  • Removed FX_NO_BIGINT_CULTURE_PARSE as its already covered by
    FX_NO_BIGINT
  • Added FX_ATLEAST_45, FSHARP_CORE_4_5 as .Net 4.5 features defined
    within are supported by monotouch/monodroid

7sharp9 added 2 commits November 27, 2014 16:59
…pported features.

Removed FX_NO_STRUCTURAL_EQUALITY, FX_NO_CUSTOMATTRIBUTEDATA as these
are both provided in mscorlib for monotouch/monodroid.
FX_NO_STRUCTURAL_EQUALITY actually causes an issue with array
comparisons within tuples, see:
https://bugzilla.xamarin.com/show_bug.cgi?id=24797

Removed FX_NO_BIGINT_CULTURE_PARSE as its already covered by
FX_NO_BIGINT

Added FX_ATLEAST_45, FSHARP_CORE_4_5 as .Net 4.5 features defined
within are supported by monotouch/monodroid
Comment thread src/FSharpSource.targets

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is FX_NO_CUSTOMATTRIBUTEDATA still here? thanks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MonoDroid FSharp.Core fails to build without it, the mscorlib must be different. There's also an explicit mscorlib referenced in MonoTouch unlike android.

I don't know who put together the android one so I can't comment on the reasons behind it.

On 27 Nov 2014, at 19:26, Don Syme [email protected] wrote:

In src/FSharpSource.targets:

@@ -141,9 +141,9 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do

v2.1
$(TargetFramework)

  • $(DefineConstants);FX_NO_STRUCTURAL_EQUALITY
    $(DefineConstants);FX_NO_CUSTOMATTRIBUTEDATA
    Why is FX_NO_CUSTOMATTRIBUTEDATA still here? thanks

—
Reply to this email directly or view it on GitHub.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(cc @migueldeicaza)

It's really, really important to work out the exact configuration of FSharp.Core we need MonoAndroid and MonoTouch. Let's iterate on this until we are sure we're doing the right thing. Here's what I see

  • Currently, the FSharp.Core.dll for MonoAndroid and MonoTouch use the same version number. So we are effectively assuming these two platforms are identical w.r.t. FSharp.Core. We need to work out if that assumption is valid. I think it is, see below (though maybe we don't even need a special version at all!)
  • Currently, the FSharp.Core for MonoAndroid is built against these DLLs from October 2013, and the FSharp.Core for MonoTouch is built against these DLLs from 2013 with an extra mscorlib-runtime.dll. We should update these DLLs to the latest installed by Xamarin MonoAndroid and MonoTouch SDKs. Comparing with C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll these appear out-of-date by now.
  • Looking at the differences between FSharp.Core 4.3.1.0 for .NET 4.x and the MonoTouch/MonoAndroid, the only differences remaining are FX_NO_BIGINT, FX_NO_EXCEPTIONDISPATCHINFO and FX_NO_CUSTOMATTRIBUTEDATA (the latter for MonoDroid only). I think all of these can be removed once we update the base DLLs in "dependencies" since C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0 and C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0 both appear to contain System.Numerics.dll, a very up-to-date mscorlib.dll with ExceptionDispatchInfo etc.

All this makes me wonder why we need a specific build of FSharp.Core for MonoAndroid and MonoTouch at all. If we can remove the three #defines above, the FSharp.Core will be identical to the .NET 4.x 4.3.1.0 FSharp.Core. So why don't we just use that instead? It would make everything much, much simpler to do that.

Concretely I recommend updating the dependcy DLLs (including adding System.Numeric), then rebuilding and rerunning all tests (including on-device), and then if everything passes try the same with FSharp.Core 4.3.1.0. If that works fine, then let's scrap the special builds of FSharp.Core for MonoAndroid and MonoTouch.

Thanks
Don

@7sharp9

7sharp9 commented Dec 1, 2014

Copy link
Copy Markdown
Member Author

@dsyme What about FX_NO_REFLECTION_EMIT? Thats set by monotouch.

@dsyme

dsyme commented Dec 1, 2014

Copy link
Copy Markdown
Contributor

Oh, that's frustrating. The only place FX_NO_REFLECTION_EMIT is used meaningfully is

#if FX_NO_REFLECTION_EMIT
#else
                | :? System.Reflection.Emit.AssemblyBuilder -> []
#endif

in quotations.fs (the other two mentions of FX_NO_REFLECTION_EMIT can be removed). This check could have been handled in some other way in FSharp.Core (i.e. so it didn't induce a static requirement to have the System.Reflection.Emit.AssemblyBuilder type available).

But yes, this does mean that FSharp.Core.dll 4.3.1.0 for .NET 4.x is not quite a suitable FSharp.Core.dll for MonoTouch. But the good nes is that it does appear that that is valid to use the same FSharp.Core for MonoTouch and MonoAndroid (by continuing to define FX_NO_REFLECTION_EMIT for both cases).

So, let's stick with building the special FSharp.Core DLL for MonoAndroid/MonoTouch, using one unified version number for it, and adjusting the #defines appropriately, and defining FX_NO_REFLECTION_EMIT for it?

@dsyme

dsyme commented Dec 1, 2014

Copy link
Copy Markdown
Contributor

I think we should pull this then fix up the FX_NO_CUSTOMATTRIBUTDATA issue and make sure we're building against latest MonoAndroid and MonoTouch mscorlib.

fsgit added a commit that referenced this pull request Dec 1, 2014
Updated define constants to address bugzilla 24797 and add missing supported features.
@fsgit
fsgit merged commit a313c67 into fsharp:master Dec 1, 2014
@fsgit

fsgit commented Dec 1, 2014

Copy link
Copy Markdown
Contributor

The MonoAndroid and MonoTouch DLLs have now been updated:

557082e

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants