Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

[Build] Add a patch to check whether we have .NET 4.6 at build time. #164

Merged
merged 1 commit into from
Sep 15, 2016

Conversation

Therzok
Copy link
Contributor

@Therzok Therzok commented Sep 15, 2016

No description provided.

@Therzok
Copy link
Contributor Author

Therzok commented Sep 15, 2016

Let's see how jenkins copes with this.

@@ -224,6 +230,9 @@ AM_CONDITIONAL(ENABLE_MONOGETOPTIONS, test "x$has_mono" = "xtrue")

CSFLAGS="$DEBUG_FLAGS $CSDEFINES $WIN64DEFINES -unsafe"

if text "x$missing_net_4_6" = "xno" ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: s/text/test/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
if test "x$has_mono" = "xfalse" ; then
PKG_CHECK_MODULES(MONO_DEPENDENCY, mono-2 >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
if "x$has_mono" = "xtrue" ; then
PKG_CHECK_MODULES(MONO_DEPENDENCY, mono < $MONO_NET_4_6, missing_net_4_6=true, missing_net_4_6=false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather use NET_4_6_SUPPORT (uppercase).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@Therzok Therzok force-pushed the configure-patch branch 2 times, most recently from 3a88086 to e7bd823 Compare September 15, 2016 07:47
@@ -88,15 +88,19 @@ static string Utf8PtrToStringFast (IntPtr ptr, int len)
}
}

#if HAVE_NET_4_6
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're doing a check at buildtime then you don't need a reflection check at runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -106,9 +106,19 @@ OFF_T_FLAGS="-define:OFF_T_$ac_cv_sizeof_off_t"
AC_SUBST(OFF_T_FLAGS)

MONO_REQUIRED_VERSION=1.0
MONO_NET_4_6=4.4
Copy link
Contributor

Choose a reason for hiding this comment

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

How about "FIRST_MONO_VERSION_WITH_NET_4_6_SUPPORT"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

if (hasFastGetStringOverload)
return Utf8PtrToStringFast (ptr, len);

#if HAVE_NET_4_6
Copy link
Contributor

Choose a reason for hiding this comment

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

How about wrapping the old 3 lines with #if UTF8_SLOWPATH , and after them, return Utf8PtrToStringFast (ptr, len); this way removing this build check in the future will be easier and cause less diff noise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see it done ;)

Copy link
Contributor Author

@Therzok Therzok Sep 15, 2016

Choose a reason for hiding this comment

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

The diff is still here since you commented on the define, see below, the Utf8PtrStringFast is inlined now under the same HAVE_NET_4_6.

This way, you can use unifdef to remove the segments.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant this way: #165

PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
if test "x$has_mono" = "xfalse" ; then
PKG_CHECK_MODULES(MONO_DEPENDENCY, mono-2 >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
if test "x$has_mono" = "xtrue" ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Beware, you placed this if test "x$has_mono" = "xtrue" check inside a has_mono=xfalse block, so potentially this may always evaluate to false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But the above pkg check resets the value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh oops, disregard this.

@Therzok Therzok merged commit 97ebfe8 into gtk-sharp-2-12-branch Sep 15, 2016
@Therzok Therzok deleted the configure-patch branch September 15, 2016 08:28
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.

2 participants