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

2011 Коммитов

Автор SHA1 Сообщение Дата
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
Alan McGovern 834f3e3be5 [system-dependencies] Handle monos updateinfo (#1540)
Current mono master is versioned as `409001455` in it's updateinfo
which (technically) violates the format. Rewrite the parser to take
an arbitrary number of digits in the final slot instead of assuming
it's always going to be 3.

Now you can provision mono/master:
```
$ cat /Library/Frameworks/Mono.framework/Home/updateinfo
964ebddd-1ffe-47e7-8128-5ce17ffffb05 409001455

$ cat /Library/Frameworks/Mono.framework/Home/updateinfo | cut -d' ' -f2 | cut -c6- | awk '{print(int($0))}'
1455
```
2017-01-20 14:56:31 +01:00
Sebastien Pouliot 2f93bc6c64 [generator] Fix a potential compile time error in generated *Async methods (#1536)
This can happen when a parameter of the method being [Async]-ified has
the same name as one of the delegate parameter.

E.g.

* Binding code

```
	delegate void MTKTextureLoaderCallback ([NullAllowed] IMTLTexture texture, [NullAllowed] NSError error);

	[Async]
	void FromTexture (MDLTexture texture, [NullAllowed] MTKTextureLoaderOptions options, MTKTextureLoaderCallback completionHandler);
```

* Generated code

```
		public unsafe virtual Task<global::Metal.IMTLTexture> FromTextureAsync (global::ModelIO.MDLTexture texture, NSDictionary options)
		{
			var tcs = new TaskCompletionSource<global::Metal.IMTLTexture> ();
>			FromTexture(texture, options, (texture, error) => {
				if (error != null)
					tcs.SetException (new NSErrorException(error));
				else
					tcs.SetResult (texture);
			});
			return tcs.Task;
		}
```

* Errpr

```
MTKTextureLoader.g.cs(397,35): error CS0136: A local variable named `texture' cannot be declared in this scope because it would give a different meaning to `texture', which is already used in a `parent or current' scope to denote something else
```

Note: we are appending, not prepending, a '_' character

Because:

* we don't want to pick up a fight with GetUniqueParamName that already
  prepend a '_' in some cases;

* Pre-fixing '_' does not work for parameters names starting with a `@`
2017-01-20 08:16:46 -05:00
Rolf Bjarne Kvinge 786ae13f80 [mtouch] Fix an unnecessary re-link when the linker copies assemblies without processing them. (#1534)
Event sequence:

* mtouch is executed with the linker disabled.
* The linker pipeline copies all input assemblies (since the linker is
  disabled the assemblies don't change) into the PreBuild directory. This will
  keep the original timestamps of the input assemblies.
* mtouch is executed again, when none of the input assemblies changed.
* The linker pipeline will re-execute, because it will see that at least one
  of the input assemblies (at least the .exe) is newer than at least one of
  the assemblies in the PreBuild directory (usually a framework assembly,
  because those have the original timestamp from their install location).

Fix:

Touch all the assemblies in the PreBuild directory after the linker pipeline
executes the first time. This way the second time mtouch is executed, it will
find that all assemblies in the PreBuild directory have timestamps later than
all the input assemblies, so it will load the cached linked assemblies,
instead of re-executing the linker pipeline.
2017-01-20 10:45:08 +01:00
Rolf Bjarne Kvinge 72080fb320 [xharness] Lines containing 'ghprbPull' are probably not build errors. (#1537) 2017-01-20 10:43:49 +01:00
Rolf Bjarne Kvinge da690aff81 [xharness] Show test xml files in the html report. (#1535)
* [xharness] Show test xml files in the html report.

* [xharness] Force links to xml files to show up in a new top-level window.

Jenkins shows the html report in an iframe, and links will load in that
iframe. This means that the browser renders the contents of the link as if it
was html, and rendering xml as html results in a blank page.

So set the target attribute on links to xml files, so that those xml files
open as top-level pages, and then the browser will rendering the xml like xml.
2017-01-20 10:42:55 +01:00