Build failure building Gendarme on Mac OSX

287 views
Skip to first unread message

Steve Palmer

unread,
Mar 11, 2013, 10:27:45 PM3/11/13
to gend...@googlegroups.com
Hi, folks. I seem to have found a build issue with Gendarme under Mac OSX:

/opt/local/bin/mcs -target:library -debug+ -d:TRACE -optimize+ -nowarn:1591  -warn:4 -warnaserror+ -nowarn:1591 -doc:../../bin/Gendarme.Rules.BadPractice.dll.doc \
-r:/Library/Frameworks/Mono.framework/Versions/2.10.11/lib/mono/gac/Mono.Cecil/0.9.4.0__0738eb9f132ed756/Mono.Cecil.dll -r:../../bin/Gendarme.Framework.dll -out:../../bin/Gendarme.Rules.BadPractice.dll ./AvoidAssemblyVersionMismatchRule.cs ./AvoidCallingProblematicMethodsRule.cs ./AvoidNullCheckWithAsOperatorRule.cs ./AvoidVisibleConstantFieldRule.cs ./CheckNewExceptionWithoutThrowingRule.cs ./CheckNewThreadWithoutStartRule.cs ./CloneMethodShouldNotReturnNullRule.cs ./ConstructorShouldNotCallVirtualMethodsRule.cs ./DisableDebuggingCodeRule.cs ./DoNotDecreaseVisibilityRule.cs ./DoNotForgetNotImplementedMethodsRule.cs ./DoNotUseEnumIsAssignableFromRule.cs ./DoNotUseGetInterfaceToCheckAssignabilityRule.cs ./EqualShouldHandleNullArgRule.cs ./GetEntryAssemblyMayReturnNullRule.cs ./ObsoleteMessagesShouldNotBeEmptyRule.cs ./OnlyUseDisposeForIDisposableTypesRule.cs ./PreferEmptyInstanceOverNullRule.cs ./PreferParamsArrayForVariableArgumentsRule.cs ./PreferSafeHandleRule.cs ./PreferTryParseRule.cs ./ReplaceIncompleteOddnessCheckRule.cs ./ReturnNullRule.cs ./ToStringReturnsNullRule.cs ./UseFileOpenOnlyWithFileAccessRule.cs ../../AssemblyInfo.cs ./../../AssemblyStaticInfo.cs
./AvoidAssemblyVersionMismatchRule.cs(87,41): error CS0117: `System.Version' does not contain a definition for `TryParse'
/opt/local/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)

This is on Mac OSX 10.8.2.

Running autoconf.sh from the mono-tools folder worked fine. Any idea what this might be? I can't find any prior mention of this on the group or anywhere else.

Sebastien Pouliot

unread,
Mar 12, 2013, 9:29:56 AM3/12/13
to gend...@googlegroups.com
You are trying to build against /opt/local/lib/mono/2.0/mscorlib.dll
which does not have the API, e.g. Version.TryParse, that are new in
.NET 4.0 (and which Gendarme requires).
> --
> You received this message because you are subscribed to the Google Groups
> "Gendarme" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gendarme+u...@googlegroups.com.
> To post to this group, send email to gend...@googlegroups.com.
> Visit this group at http://groups.google.com/group/gendarme?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Steve Palmer

unread,
Mar 12, 2013, 1:37:21 PM3/12/13
to gend...@googlegroups.com
Ah, thanks! Macports told me I had the latest mono SDK. I'll see if I can find a newer one.

Steve Palmer

unread,
Mar 12, 2013, 9:52:19 PM3/12/13
to gend...@googlegroups.com
OK, it appears that I already have /opt/local/lib/mono/4.0. So why isn't the make picking this up instead of using the one in 2.0?

Specifically, how do I fix this to tell make to use 4.0?

Cameron Yule

unread,
Apr 15, 2013, 2:14:18 PM4/15/13
to gend...@googlegroups.com
I'm having the same issue, did you get any further with this Steve?

I've managed to get Gendarme compiling on OS X by altering the common.make file to explicitly use the dmcs compiler - as opposed to mcs - as shown in the diff of the following Gist, but the fact that modification was necessary likely indicates something is wrong either with my configuration or with the Gendarme build system setup.

Reply all
Reply to author
Forward
0 new messages