Portability TODOs

0 views
Skip to first unread message

Jesse Jones

unread,
Aug 16, 2009, 10:13:04 PM8/16/09
to gend...@googlegroups.com
This covers MonoCompatibilityReviewRule.

-- Jesse

diff.patch

Sebastien Pouliot

unread,
Aug 22, 2009, 11:59:47 AM8/22/09
to gend...@googlegroups.com
On Sun, 2009-08-16 at 19:13 -0700, Jesse Jones wrote:
> namespace Gendarme.Rules.Portability {
>
> - // TODO: It would be nice to explain in a little more detail what MoMA is and whether this
> - // rule operates with a normal mono install. And if it doesn't what must be done to get the
> - // rule to work. And how do I "make sure your definition files are up to date"?
> -
> /// <summary>
> - /// This rule uses MoMA definition files to analyze assemblies and warns if called methods are:
> - /// <list type="bullet">
> - /// <item>
> - /// <description>marked with a <c>[MonoTODO]</c> attribute;</description>
> - /// </item>
> - /// <item>
> - /// <description>throw a <c>NotImplementedException</c>; or</description>
> - /// </item>
> - /// <item>
> - /// <description>does not exist in the current version of Mono</description>
> - /// </item>
> - /// </list>
> - /// The rule looks for the definitions in <c>~/.local/share/Gendarme/definitions.zip</c>.
> - /// If the file is missing it will try to download the latest version.
> + /// This rule will fire if one of the assemblies being checked contains a call to a .NET
> + /// method which is either not implemented on Mono or partially implemented. It does
> + /// this by downloading a MoMA definitions.zip file into <c>~/.local/share/Gendarme/definitions.zip</c>
> + /// (on Unix) and checking for calls to the methods therein. The rule will work without
> + /// MoMA but if it does fire it may be useful to download and run MoMA.
> /// </summary>
> - /// <remarks>This rule does not replace MoMA (which is obviously the easiest solution for Windows developers). It's goal is to help analyze multiple portability issues from the Linux side (where Gendarme is most likely being used)</remarks>
> + /// <remarks>
> + /// The definitions.zip will not be downloaded if it already exists so it's a good idea to
> + /// manually remove it now and then.
> + /// </remarks>

I had almost forgot about that. It used to be a problem but I think we
can now fix this properly, mostly because we're now releasing the sync
with the Mono project.

The trick is to check for definitions-{w.x.y.z}.zip and, if not found we
download it. This means that a new Mono release, triggers:
a) a new MoMA release (and definitions update);
b) a new Gendarme release (with a different version number);

So updating Gendarme will update the definitions to the matching Mono
release. That should cover most cases (and be better than the existing
behavior).

The next step is to use a configurable property to allow users to
specify a specific Mono version. E.g. someone use the latest Gendarme
but wants to check Mono compatibility with 2.4.2.3 (since it's the long
term supported version of Mono, included in SLE11 code base).

I'll look at implementing the above this weekend.

>
> - [Problem ("The method has some known limitations when used with the Mono runtime.")]
> - [Solution ("Check if this code is critical to your application. Also make sure your definition files are up to date.")]
> + [Problem ("The method is either missing or partially implemented on Mono.")]
> + [Solution ("Review the code. Also delete the definitions.zip to ensure that the latest version is downloaded.")]

Not that the original text was awesome by any mean but "Review the code"
is not enough. The later part (definitions) we can now drop. What about
"Review and test the code to ensure it can deal with the limitations"
for the solution ?

Sebastien

Jesse Jones

unread,
Aug 25, 2009, 6:38:15 PM8/25/09
to gend...@googlegroups.com

That's fine with me. Is it OK to check in with that change?

-- Jesse

Sebastien Pouliot

unread,
Aug 25, 2009, 7:13:17 PM8/25/09
to gend...@googlegroups.com

Yes, go ahead. I'll merge/commit my changes later tonight (it needs some
more testing).

Thanks
Sebastien

Jesse Jones

unread,
Aug 26, 2009, 12:10:59 PM8/26/09
to gend...@googlegroups.com

r140726

Note that I changed this to "Review and test the code to ensure that
it works properly on Mono."

-- Jesse

Reply all
Reply to author
Forward
0 new messages