Граф коммитов

2066 Коммитов

Автор SHA1 Сообщение Дата
Ankit Jain e3166fbb15 [msbuild][fsharp] Copy .mdb files when building with msbuild (#1641)
Mono's fork of msbuild uses a `$(_DebugFileExt)` property to specify
the debug file extension (.pdb/.mdb) to use. It defaults to .pdb. So,
with XI/XM, .mdb files don't get copied to the output folder.

We also add a `$(FscDebugFileExt)` property, which allows our default of
`.mdb` to be overridden.

But the `$(_DebugFileExt)` support  is not in upstream msbuild yet. So,
we can't ask the F# upstream to add it. Hence, this is being added to
our FSharp target files. Once, all this is upstream, we can remove the
overrides from our files.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51148
2017-02-06 15:27:07 -05:00
Jeffrey Stedfast bc251403c2 [msbuild] Properly decide on when to re-codesign app bundle (#1625)
If the user makes changes to an App Extension or Watch app,
then those bundles would change within the main app bundle
but the main app bundle would not get re-codesigned because
it was not properly considering those files as inputs in the
_CodesignAppBundle target.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52165
2017-02-06 13:52:30 -05:00
Chris Hamons f6918bdc43 Update xm apidiff to cycle8 (#1624) 2017-02-06 08:40:43 -06:00
Sebastien Pouliot a94e4dc423 Revert c633bd378f and fix #51805 with a new Cecil API (#1640)
* Revert "[mtouch][linker] Remove type forwarders. Fixes #51805 (#1589) (#1600)"

This reverts commit c633bd378f.

* [mono] Bump mono to get latest cecil (cycle9) and fix linker's ExternalType.Scope. Fixes #52187 and #51805

Original fix for bug #51805 was reverted since it caused a regression [2]
when type forwarders are used thru reflection, which happens when
serializing some types.

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=51805
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=52187
2017-02-03 16:12:28 -05:00
Alex Soto 3b0f1baf69 [mmp/btouch] Better error when bad xml linker input is given to mmp/mtouch (#1614)
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=52238

If you give mtouch/mmp a linker xml file with bad input for
example a Xamarin.iOS app and the linker.xml has a reference
to Xamarin.Mac instead of X.I.dll i.e.

<?xml version="1.0" encoding="UTF-8" ?>
<linker>
	<assembly fullname="Xamarin.Mac">
    	<type fullname="ObjCRuntime.Constants"/>
	</assembly>
</linker>

You will get a not so helpful generic error

MT2001 Could not link assemblies. Reason: Failed to process XML description: <unspecified>

It seems that when you use a xml file for linker you get a
`XmlResolutionException` from cecil when it fails to resolve
and the better error comes from the inner exception so we use
that instead.

New error output for XmlResolutionException:

MT2017: Could not process XML description: Failed to resolve assembly: 'Xamarin.Mac, Culture=neutral, PublicKeyToken=null'
2017-02-03 14:04:06 -06:00
Chris Hamons 9775b2e4a4 Fix block warning on RegisterCloudKitShare (#1533) 2017-02-03 10:08:51 -06:00
Rolf Bjarne Kvinge 818ef24336 [generator] Don't use type initializers with ifdefs. (#1634)
Because that won't work when those ifdefs are converted to normal ifs.
2017-02-03 14:13:31 +01:00
Rolf Bjarne Kvinge a22cda6eb3 [mtouch tests] Adjust FastDev_LinkWithTest after fe17d5db9f. (#1633)
We disabled fastdev for tvOS/watchOS projects with binding projects in
bac02538, and that broke the FastDev_LinkWithTest:

    Errors and Failures:
    1) Test Failure : Xamarin.MTouch.FastDev_LinkWithTest(TVOS)
         Binding symbol not in executable
      Expected: no item String ending with " T _theUltimateAnswer"
      But was:  < ... >

So adjust the test to match the new behavior.
2017-02-03 11:02:07 +01:00
Rolf Bjarne Kvinge e3eedb62d3 [mmptest] Use the right location for mono64. (#1630) 2017-02-03 09:24:35 +01:00
Rolf Bjarne Kvinge d9c23c2ba8 [mtouch] Automatically enable bitcode if LLVM is enabled. Fixes #52241. (#1620)
Currently we can't build watchOS projects if LLVM is enabled, but bitcode is
not (see bug #51634).

Additionally the IDEs do not have UI to select if bitcode is enabled or not,
so automatically enable it if LLVM is enabled (since most likely people will
be building for the App Store if LLVM is enabled).

https://bugzilla.xamarin.com/show_bug.cgi?id=51634
https://bugzilla.xamarin.com/show_bug.cgi?id=52241
2017-02-03 07:16:17 +01:00
Rolf Bjarne Kvinge 68415e88c5 [mtouch] Fix build error with fastdev & libpinvokes & paths with spaces. (#1618) 2017-02-02 18:09:42 +01:00
Sebastien Pouliot cc0f41f1a7 [mono] Bump to latest revison of mono-4.8.0-branch (#1611) 2017-02-01 15:42:58 -05:00
Chris Hamons 1db1ce5a40 [XM] Add BCL tests (#1447) 2017-02-01 11:05:08 -05:00
Rolf Bjarne Kvinge cf1157d1a8 [generator] Replace target-specific ifdefs with feature-specific ifdefs. (#1583)
Eventually these ifdefs will be replaced with normal ifs.
2017-02-01 16:21:03 +01:00
Rolf Bjarne Kvinge e9eb52a78a [docs] Improve MT0091's documentation a little bit. (#1609) 2017-02-01 14:58:54 +01:00
Rolf Bjarne Kvinge 35b17da170 [doc] Add blurb about MT1009. (#1608) 2017-02-01 14:30:45 +01:00
Rolf Bjarne Kvinge 76fadce1a3 Validate file permissions of installed files. (#1607)
Validate file permissions of installed files, so that we don't run into
bug #52113 again.

https://bugzilla.xamarin.com/show_bug.cgi?id=52113
2017-02-01 14:30:29 +01:00
Rolf Bjarne Kvinge 743a45456d [builds] Fix mdb permissions. Fixes #52113. (#1605) 2017-02-01 10:47:46 +01:00
Timothy Risi 48682b27aa Resource files for mac should be copied to the app bundle (#1500)
Resource files for mac should be copied to the app bundle
* Move the Satellite code used by mac to tools/common/Assembly.cs
* Add EmbeddedResources test to xammac_tests
2017-01-31 15:59:08 -09:00
Timothy Risi f3ebfc3cce Fix NSOpenGLPixelFormat ConvertToAttributes method (#1539)
Fix NSOpenGLPixelFormat ConvertToAttributes

* Add OpenGLProfile to list of NSOpenGLPixelFormatAttributes that require a value.  Check for 0 terminating the array
* Use InitializeHandle instead of 'Handle = '
* Add tests
2017-01-31 15:52:09 -09:00
Timothy Risi 406fe61266 NSSliderTouchBarItem.ValueAccesoryWidth should be nfloat, not double (#1585) 2017-01-31 14:31:14 -09:00
Sebastien Pouliot c633bd378f [mtouch][linker] Remove type forwarders. Fixes #51805 (#1589) (#1600)
a. System.Net.Http.Primitives.dll is user code *and* contains type
forwarders (it's like a facade) to another facade assembly,
System.Net.Primitives.dll, that ships with the SDK;

b. The former, System.Net.Http.Primitives.dll, is not processed by
the linker, e.g. no code is removed and the assembly cannot be deleted.
However we save back (as much as we can [1]) the result of any type
being resolved;

c. It also means the later, System.Net.Primitives.dll, is fully linked
and (in many cases) can be removed from the final application (as it's
mostly forwarders).

d. This means the final, re-saved, System.Net.Http.Primitives.dll binary
could point to non-existing metadata, i.e. the removed
System.Net.Primitives.dll, because of [1].

Because we resolve (and save) the forwarders *and* because we do not
allow code downloads or generation (Apple restriction) it is possible to
remove the forwarders, which will fix the issue for XI.

[1] The scope of exported types cannot be updated
abb4e902da/Mono.Cecil/ExportedType.cs (L41)

There is also a enhancement bug, #11165, about this but it predated our
PCL support and the resolve-n-save that we now do for forwarders. This
is now _fully_ fixed.

References:
* https://bugzilla.xamarin.com/show_bug.cgi?id=11165 (enhancement)
* https://bugzilla.xamarin.com/show_bug.cgi?id=51805
2017-01-31 16:22:34 -05:00
Sebastien Pouliot de090b86d4 [tests][macos][intro] Fix XM classic introspection tests. Fixes #52065 (#1595) (#1597)
The latest Sierra had a few surprises:

* CITextFeature is now 64bits only;
* The MediaPlayer framework is now 64bits only [1]

Both made the classic tests fails for XM.

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=52065
2017-01-31 14:45:30 -05:00
Rolf Bjarne Kvinge bac0253848 [mtouch] Automatically disable incremental builds if building to bitcode and any third-party bindings were found. Works around bug #51710. (#1592)
Most projects building to bitcode (any kind of bitcode, this includes the
marker-only version as well), will fail to link when linking with third-party
libraries and incremental builds are enabled.

So automatically disable incremental builds when we detect this scenario.

This is only a workaround until we can make this scenario build correctly.

https://bugzilla.xamarin.com/show_bug.cgi?id=51710
2017-01-31 14:55:54 +01:00
Rolf Bjarne Kvinge 7bfe13396e Bump maccore to get potential fix for #47750. (#1587)
https://bugzilla.xamarin.com/show_bug.cgi?id=47750
2017-01-31 07:07:02 +01:00
Rolf Bjarne Kvinge 76587376e9 [xharness] Fix code to compile with csc. (#1586) 2017-01-30 10:04:59 +01:00
Rolf Bjarne Kvinge 8b17770d36 [xharness] Make 'IncludeMac' an general switch for all macOS tests. (#1582) 2017-01-27 18:24:10 +01:00
Rolf Bjarne Kvinge 71e61b4b04 [xharness] Always add the mmp test to the list of tests, but mark it as ignored when it shouldn't be executed. (#1580) 2017-01-27 17:02:21 +01:00
Rolf Bjarne Kvinge c0c1136d70 [xharness] Get the INCLUDE_ make variables and disable tests accordingly. (#1578) 2017-01-27 10:52:49 +01:00
Rolf Bjarne Kvinge 92659752df [xharness] No need to run the mac binding projects twice. (#1577) 2017-01-27 10:36:09 +01:00
Rolf Bjarne Kvinge 47a7568f9b [tests] Refactor many of the mtouch tests to use new testing infrastructure. (#1569)
This makes a couple of future optimizations easier:

* Cache the compilation of test assemblies.
* Load mtouch.exe directly in the test process.
2017-01-27 07:35:32 +01:00
Rolf Bjarne Kvinge 98feef8dff [tests] The mtouch tests now require Cecil, so add the expected project reference to the solution. (#1568) 2017-01-27 07:32:44 +01:00
Jeffrey Stedfast f5b725e2af [msbuild] Added ProcessEnums property for ObjC Binding projects (#1557)
The new ProcessEnums property specifies whether or not to
pass /process-enums to the btouch task for iOS/Mac binding
projects.

Part of the fix for https://bugzilla.xamarin.com/show_bug.cgi?id=51753
2017-01-26 11:24:14 -05:00
Rolf Bjarne Kvinge f24c8f7331 [docs] Update text about MT4134 to not mention the legacy registrar anymore. (#1558)
Since the legacy registrar is not available anymore.
2017-01-26 15:31:26 +01:00
Rolf Bjarne Kvinge dae598f96a [docs] Update text about MT5211. Fixes #51772. (#1559)
https://bugzilla.xamarin.com/show_bug.cgi?id=51772
2017-01-26 15:23:47 +01:00
Jeffrey Stedfast 4c5647150c [msbuild] Added support for <Link>'d ImageAsset project files (#1543)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=28106
2017-01-25 13:00:29 -05:00
Manuel de la Pena d7a9bd462a [Debugger] Ensure that we use the correct paths in the mono mdb files (#1554)
* [Debugger] Ensure that we use the correct paths in the mono mdb files to be able to step into the mono code.

Fixes bug 51530.

* Make the mdb paths to be correct in other platforms.

* Ensure mdb paths are also correct in XM.
2017-01-25 13:17:02 +01:00
Alex Soto 1799c2f489 [generator] Add BindAs support (#1476)
* [generator] Add BindAs support for NSValue and NSNumber
https://trello.com/c/RYCPEnkh

The intent of BindAs attribute is to have a binding definition as

	[return: BindAs (typeof (bool?))]
	[Export ("boolMethod:")]
	NSNumber BoolMethod (int arg1);

and our generator outputs

	[Export ("boolMethod:")]
	public virtual global::System.Nullable<bool> BoolMethod (int arg1) { ...  }

So we internally do the NSNumber <-> bool conversion, this also
applies to properties, parameters and methods.

* [generator] Fix a small formating issue

* [tests] Add BindAsAttribute generator tests

* [generator] Implement @spouliot's feedback

* [tests] Add BI1048 and BI1049 error tests for [BindAs]

* [generator] Implement Rolf's suggestion to avoid almost all string comparisons in [BindAs] for types

* [generator] Add BindAs support for smart enums and arrays with tests

* [generator] Some code clean up and implementation of PR feedback

* [generator] Add Protocol|Model checks and tests also a NRE check in NSArray creator

BindAs attribute cannot be used in Protocol|Model interfaces

* [generator] Add NSNumber <-> Enum support

* [docs] add BindAs documentation

* [docs] Implement documentation feedback for BindAs
2017-01-25 07:14:55 +01:00
Rolf Bjarne Kvinge 3dac0bae81 Use @rpath instead of @executable_path in dylibs. (#1552)
Use @rpath instead of @executable_path in dylibs, since it allows us to be
more flexible when placing dylibs in the app.

In particular with this change it's trivial to put libmonosgen-2.0.dylib in
the container app, and reference it from extensions.
2017-01-24 20:24:32 +01:00
Rolf Bjarne Kvinge 30082029cb [mtouch] Fix compiler warning in generated main code. (#1550) 2017-01-24 13:43:38 +01:00
Rolf Bjarne Kvinge a42419ab2d [mtouch] Remove dead code. (#1549) 2017-01-24 13:43:01 +01:00
Rolf Bjarne Kvinge 62faa06f4b [mtouch] Don't parse appex executables for architecture(s). (#1551)
Don't parse appex executables for the architecture(s) when we have the exact
same information already in the process.
2017-01-24 13:42:49 +01:00
Rolf Bjarne Kvinge 29dbb38ad4 [mtouch] It's no longer necessary to set MONO_GC_PARAMS during AOT-compilation. (#1548)
According to Vlad it's not necessary to set MONO_GC_PARAMS during AOT-
compilation, since all MONO_GC_PARAMS options can be changed at runtime:

Rolf Kvinge [16:35] @vlad.brezae is this true for all the different options MONO_GC_PARAMS take: https://github.com/xamarin/xamarin-macios/pull/1546#discussion_r97318092?
Rolf Kvinge [16:36] I remember this: https://bugzilla.xamarin.com/show_bug.cgi?id=35414#c14
Rofl Kvinge [16:36] which apparently you changed here, so that it can be changed at runtime: https://bugzilla.xamarin.com/show_bug.cgi?id=35414#c27
Rolf Kvinge [16:36] but I don't know if this is true for all the options you can pass using MONO_GC_PARAMS
Vlad Brezae [16:41] yes, it should be true for all of them, that was a bug
Rolf Kvinge [16:41] ok, that's great news 😄
2017-01-24 10:07:42 +01:00
batmaninpink ca8bb9386b recognize networkextension app extension (#1545) 2017-01-24 07:50:37 +01:00
Vlad Brezae cd9292ffdd Enable selecting the sgen major mode (#1546)
* [mmp/mtouch] Add option for concurrent sgen

* [msbuild] Add support for concurrent sgen properties

* [mmp] Test for concurrent sgen option
2017-01-24 07:28:15 +01:00
Vincent Dondain 0b37471271 [msbuild] Only use File.GetLastWriteTimeUtc (#1547)
Instead of just using File.GetLastWriteTime.
Fixes bug #51694: Use File.GetLastWriteTimeUtc not File.GetLastWriteTime
https://bugzilla.xamarin.com/show_bug.cgi?id=51694
2017-01-23 15:31:44 -05:00
Rolf Bjarne Kvinge dca6fc6985 [NSString] Make GetLocalizedUserNotificationString take a params array. (#1544)
GetLocalizedUserNotificationString is a printf-like function, so it's natural
for the array of arguments to be a params array.
2017-01-23 10:08:20 +01:00
Jeffrey Stedfast 252b0dc3df [msbuild] Parallelized codesigning of *.dylibs and frameworks (#1528)
* [msbuild] Parallelized codesigning of *.dylibs and frameworks

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=51298

* Disable timestamps for MtouchDebug builds
2017-01-20 11:28:34 -05:00
Rolf Bjarne Kvinge 025226999a [tests] Sleep a bit to work around HFS' lack of sub-second timestamp values. (#1541)
HFS timestamp resolution is 1 second, which means that we can't distinguish
files modified again within 1 second. This means that this test will fail more
often the faster we make mtouch, so add a forced sleep to make sure we don't
do things faster than the file system can keep track of.
2017-01-20 16:55:08 +01:00
Rolf Bjarne Kvinge 1a7a4ab463 [mtouch] Add support for specifying how to optimize LLVM output. (#1532)
Performance tests
-----------------

This is for a new watchOS extension project, built for release.

* The default (currently -O2) optimizations:      41s (  baseline )  30.027.060 bytes (     baseline    )
* All optimizations disabled (`--llvm-opt=all=`): 17s (-24s = -59%)  32.978.312 bytes (+2.951.252 = +10%)
* Optimized for size (`--llvm-opt=all=-Os`):      36s ( -5s = -12%)  28.617.408 bytes (-1.409.652 =  -5%)
* Optimized for more size (`--llvm-opt=all=-Oz`): 35s ( -6s = -15%)  28.601.016 bytes (-1.426.044 =  -5%)
* Optimized slightly (`--llvm-opt=all=-O1`):      35s ( -6s = -15%)  28.666.556 bytes (-1.360.504 =  -5%)
* Optimized a lot (`--llvm-opt=all=-O3`):         41s (  0s =   0%)  30.403.996 bytes (+  376.936 =  +1%)

Conclusions
-----------

* The fastest build by far (less than twice as fast) is if optimizations are
  disabled, but this adds a 10% size penalty (~3 MB in this test case),
  compared to the baseline, and 15% size penalty (4.3 MB) compared to -Oz.
* -Oz seems to have the best overall results: at least as fast as any other
  optimized build, and the smallest app as well.

Caveats
-------

Some optimizations might not work the AOT compiled code. The resulting
binaries have not been tested.
2017-01-20 16:11:48 +01:00