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

1899 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge a09c1e8cc5 [mtouch] Store a list of members for each native symbol.
There might be more than one member for each P/Invoke symbol, so make sure to
keep track of every one of them.
2017-01-18 10:48:11 +01:00
Rolf Bjarne Kvinge b4cc60572b [mtouch/mmp] Share code between link contexts. 2017-01-18 10:48:11 +01:00
Sebastien Pouliot 00b1c09acb [linker] Add an well known candidate inliner substep along with tests (#1513)
TL&DR: This is *how* it should be done and tested, it's not complete
(single, simple case) nor the most interesting case ;-)

The trick is to make sure each case is covered by tests so a mono
_bump_ won't give us a BCL that does not conform to what the linker
expect.

What's the impact ?

1. There is the expected reduction of metadata in mscorlib. Since both
   methods don't call other API there's no indirect effect (removal).

--- before	2017-01-15 11:12:44.000000000 -0500
+++ after	2017-01-15 11:12:56.000000000 -0500
@@ -13166,9 +13166,6 @@
 System.Void System.Security.SecurityException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)
 System.Void System.Security.SecurityException::.ctor(System.String)
 System.Void System.Security.SecurityException::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)
-System.Boolean System.Security.SecurityManager::CheckElevatedPermissions()
-System.Security.SecurityManager
-System.Void System.Security.SecurityManager::EnsureElevatedPermissions()
 System.Security.SecurityRulesAttribute
 System.Security.SecurityRuleSet System.Security.SecurityRulesAttribute::m_ruleSet
 System.Void System.Security.SecurityRulesAttribute::.ctor(System.Security.SecurityRuleSet)

2. There is no visible size change (even with #1) in mscorlib.dll due to
   padding (compiler /filealign)

   mscorlib.dll                793,600      793,600            0       0.00 %

3. there's a *very* small reduction of mscorlib.*.aotdata size

   mscorlib.armv7.aotdata      717,264      717,216          -48      -0.01 %
   mscorlib.arm64.aotdata      712,840      712,704         -136      -0.02 %

   AOT data *.aotdata        6,460,064    6,459,880         -184       0.00 %

4. there's no change in executable size - normal as the AOT compiler has
   _likely_ already doing the same optimization (before this commit)

   Executable               29,270,272   29,270,272            0       0.00 %

Full comparison: https://gist.github.com/spouliot/0464c8fa3a92b6486dfd90595d9eb718
2017-01-17 21:49:44 -05:00
Chris Hamons 482ab9051f [XM] Rework binding project test to try to fix build machine issues (#1474)
- https://bugzilla.xamarin.com/show_bug.cgi?id=50634
2017-01-17 10:06:10 -06:00
Manuel de la Pena d3c2c53805 Bump maccore which also bump maciotools. (#1511) 2017-01-16 14:01:24 -05:00
Sebastien Pouliot 0a25188751 [mtouch] Remove RemoveSelector step for XI (#1512)
We're not storing selectors in fields anymore so this step does nothing
expect iterating over the code.

The step is still needed for `mmp` (for Xamarin.Mac.dll)
2017-01-16 14:00:55 -05:00
Rolf Bjarne Kvinge 4cbfc537f7 [mtouch] Add the mtouch test project to the Xamarin.iOS solution. (#1510)
Add the mtouch test project to the Xamarin.iOS solution, and also create a new
mtouch solution that only contains projects directly related to mtouch.
2017-01-16 18:46:15 +01:00
Rolf Bjarne Kvinge d6c2422fcf [mtouch] Simplify code a bit. (#1508)
Simplify code a bit to avoid constant null checking and also take advantage of
the fact that HashSet.Add returns if the value was added or not (to avoid a
Contains check).
2017-01-16 18:35:28 +01:00
Rolf Bjarne Kvinge 6fe1c9feab [tests] Use a different bundle id for different apps that can be installed on the same device. (#1509)
* [tests] Use a different bundle id for different apps that can be installed on the same device.

* [xharness] Add workaround for radar #29847128.
2017-01-16 18:34:57 +01:00
Rolf Bjarne Kvinge 3a480b53bf Merge pull request #1506 from rolfbjarne/mtouch-single-invocation
[mtouch] Build extensions and the container app in the same mtouch process.
2017-01-16 18:33:42 +01:00
Sebastien Pouliot a563a66c34 [linker] Update BaseSubStep subclasses to use ExceptionalSubStep (#1507)
This allows mtouch to give better error message when something unexpected
occurs in the linker pipeline (at least for the sub-steps).

Practically it means fewer, contextless MT2001 errors. The replacements
error code are more precise, e.g.
* what was being done;
* what was being processed

and helps both diagnosing and, possibly, gives clues for workarounds
2017-01-16 11:42:41 -05:00
Rolf Bjarne Kvinge babe01d42e [tests] Automatically run today extension test runs, since there's no UI to manually start it. (#1501) 2017-01-16 16:24:44 +01:00
Rolf Bjarne Kvinge 787c63766e [xharness] Fix generation of today extension projects to work from Xamarin Studio. (#1502)
Minor tweaks to make the solutions/project files usable from the IDE, and not
only the command line.
2017-01-16 16:23:49 +01:00
Rolf Bjarne Kvinge f19d2707e3 [mtouch] MT0066 is an error. (#1505) 2017-01-16 16:22:08 +01:00
Rolf Bjarne Kvinge 6a780e76f0 [xharness] Fix today extension's project references. (#1504) 2017-01-16 16:18:53 +01:00
Rolf Bjarne Kvinge 65111d9e83 [xharness] Fix the name of referenced projects in derived projects. (#1503)
System.IO.Path expects unix-style directory separators, but MSBuild expects
window-style directory separators, so make sure to not confuse those.
2017-01-16 16:18:48 +01:00
Rolf Bjarne Kvinge 5aaea3ee49 [mtouch] Build extensions and the container app in the same mtouch process.
Build extensions and the container app in the same mtouch process, by storing
all the mtouch arguments when called to build extensions in a text file, and
then reloading those arguments when called to build the main app.

This is required if we want to share code between extensions and the
container.
2017-01-16 13:52:37 +01:00
Rolf Bjarne Kvinge 53fc697aad [mtouch] Refactor command-line parsing to be reusable.
Also add a few tests to verify how we treat the root assembly (or lack
thereof).
2017-01-16 13:52:37 +01:00
Rolf Bjarne Kvinge d2498370d9 [mtouch] Make the 'action' a local variable instead of a global one.
Make the 'action' a local variable instead of a global one so that argument
parsing can be done multiple times.
2017-01-16 12:45:03 +01:00
Rolf Bjarne Kvinge 052c2e9753 [mtouch] Refactor input validation a bit.
Move some input validation from the Main method to the App instance,
since it depends on the App instance.
2017-01-16 12:42:46 +01:00
Rolf Bjarne Kvinge 0a07b6ba8e Remove unnecessary bitcode from dylibs. Fixes #51352 (#1469)
This is a series of fixes to the dynamic libraries we build / create to remove
any unnecessary bloat (unused architectures, bitcode).

A brand new watchOS app with no changes goes from 35MB to 11MB with these
fixes (with incremental builds disabled, the app size is 10MB).

--------------------------------------------------------------------------------

* [runtime] Split list of architectures into simulator and device-specific lists.

* [runtime] Build separate dylibs for device and simulator.

Build separate dylibs for device and simulator, since we already install these
into different locations.

This makes both the simulator and device builds slightly faster (since the
respective dylibs are smaller, and less data to copy around).

For watchOS apps, this saves ~430kb.

* [runtime] Strip bitcode from dylibs. Fixes #51352.

We know that dylibs will never be shipped to the App Store, so we'll never
need them to have bitcode.

So just strip the bitcode from all our dylibs, since this makes apps with
fastdev significantly smaller (and thus much faster to upload to watch
devices).

For watchOS apps this is a very significant improvement: a branch new watchOS
app without any changes goes from 35MB to 17MB.

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

* [mtouch] Fix dylib compilation to not embed full bitcode.

Facts
=====

a. The output from the AOT compiler is an assembly (.s) file.
b. Clang's assembler does not support -fembed-bitcode-marker (only -fembed-
   bitcode), so when we ask clang to -fembed-bitcode-marker, the assembler
   receives a -fembed-bitcode argument.
c. This means that the assembled object file does not contain the
   __LLVM/__bitcode and __LLVM/__cmdline sections (it does however contain an
   __LLVM/__asm section).
d. The native linker will create a bitcode assembly section if none of the
   object files passed to the linker contain a __LLVM/__bitcode section and
   there's an __LLVM/__asm section present.
e. The end result is that when we build to a dylib, we end up (unexpectedly,
   because we ask Clang to -fembed-bitcode-marker) including both armv7k and
   bitcode in the dylib, thus bloating the dylib size significantly.

Solution
========

We manually add the __LLVM/__bitcode and __LLVM/__cmdline sections to the .s
file Mono's AOT compiler generated. This way the .o file will have the magic
sections, and the linker will not include bitcode (only the bitcode marker) in
the final library.

An empty watchOS extension with incremental builds is now 6MB smaller (down
to 11MB from 17MB).
2017-01-16 12:32:06 +01:00
Rolf Bjarne Kvinge 5f26772e1b [xharness] Add button to hide/show debug log in web page (and default to hidden). (#1490) 2017-01-16 07:32:28 +01:00
Rolf Bjarne Kvinge a02fb1d62e [xharness] Fix log stream handling. (#1494)
Don't create multiple writer streams for the same underlying file, instead
store the writer stream on the log instance, and return it whenever needed.

This fixes an issue where there would be multiple writer streams, which could
cause exceptions when creating more writer streams (access defined errors
because the file is already open).
2017-01-16 07:30:57 +01:00
Rolf Bjarne Kvinge c21f8d31ca [bmac] Parse --new-style again. (#1497)
This was changed in 1b1e345d72 since bmac.exe says --new-style is
deprecated.

However some users (MonoTouch.Hosting) manually call bmac (instead of going
through a binding project), and with 1b1e345d72 we changed the behavior when
--new-style was passed, so that it ended up trying to build Classic instead
(which is clearly not right for --new-style).

So make the bmac script understand --new-style again (to not break
compatibility), but don't forward the flag to bmac.exe (to avoid the
deprecation warning).
2017-01-16 07:27:46 +01:00
Rolf Bjarne Kvinge 9f02c44613 [xharness] Add support for using the system's Xamarin.iOS/Xamarin.Mac instead of a locally build one. (#1498)
* [tests] Use the target directory from the loaded configuration.

* [xharness] Find the root directory based on xharness.exe's location (unless specified).

* [tests] Add makefile target to generate test config using the system XI.
2017-01-16 07:24:14 +01:00
Jeffrey Stedfast 439e71fbf1 [msbuild] Fixed the logic to properly codesign *.appex's inside watch apps (#1499)
Several dependency targets were not being properly run because the Condition
expressions on e.g. the _CodesignAppExtensions target depended on variables
that were empty until the dependencies set them. But dependencies are only
executed if the parent target's Conditions were met.

Also changed the _CodesignVerify target to use the _ResolvedAppExtensions
variable instead of the _AppExtensionCodesignProperties variable. This means
that the _CodesignVerify target no longer depends on the
_ReadCodesignAppExtensionProperties target being executed and thus makes it
less likely that bugs like that will slip by in the future.
2017-01-13 16:05:15 -05:00
Sebastien Pouliot 6e31a77b8e [tests] Generalize CIImage test wrt colorspace. Fixes #51493 (#1496)
So it does not to fail on some iOS versions / devices.

https://bugzilla.xamarin.com/show_bug.cgi?id=51493
2017-01-13 13:05:32 -05:00
Rolf Bjarne Kvinge 0e322fc87c [xharness] Fix test resets, to avoid logs showing up after re-running a test. (#1493) 2017-01-13 18:48:25 +01:00
Rolf Bjarne Kvinge ab997e0a30 [xharness] Remove debug spew. (#1489) 2017-01-13 17:44:57 +01:00
Rolf Bjarne Kvinge a0ac4a8915 [xharness] Improve html formatting of harness exceptions a bit by indenting multi-line messages. (#1491) 2017-01-13 17:44:24 +01:00
Sebastien Pouliot c80a1bb10d [coreanimation] Add CAScroll smart enum (to replace NSString constants) (#1487) 2017-01-13 10:41:01 -05:00
Rolf Bjarne Kvinge 660a2fad27 [xharness] Calculate aggregate in the class a field is declared. (#1492) 2017-01-13 16:36:08 +01:00
Sebastien Pouliot d2cbd993ad Merge pull request #852 from spouliot/intro-model
[test][intro] Check for API parameters that are [Model] and not the [Protocol] interface
2017-01-12 17:11:40 -05:00
Rolf Bjarne Kvinge 54bfe2c98a [xharness] Provide better failure message for failing mac tests. (#1482)
* [xharness] Don't copy a ExecutionResult before executing.

The source might be an ignored test, even though the cloned task isn't, so if
we copy the ExecutionResult we might unexpectedly ignore the cloned task.

* [xharness] Provide better failure message for failing mac tests.
2017-01-12 16:32:45 -05:00
Vincent Dondain ebb7dceaa9 Update reference to maccore (#1483)
This includes the new mlaunch -install-progress argument needed by VS
to show a progress bar when deploying to device.
2017-01-12 16:15:47 -05:00
Sebastien Pouliot 99de1a772d [uikit] Cover null arrays in new UISegmentedControl.ctor (#1485)
Follow up to PR1477 [1] to cover case [2] for bug #33163 [3]

[1] https://github.com/xamarin/xamarin-macios/pull/1477
[2] https://github.com/xamarin/xamarin-macios/pull/1477#pullrequestreview-16295268
[3] https://bugzilla.xamarin.com/show_bug.cgi?id=33163
2017-01-12 15:33:13 -05:00
Jeffrey Stedfast e26ee5ca6c [msbuild] Refactor the IBTool task to be cleaner and more efficient (#1457)
[msbuild] Refactor the IBTool task to be cleaner and more efficient

Besides making the IBTool task cleaner and easier to understand,
a side-effect of this refactor was also to optimize the collecting
of the compiled outputs because we now only need to scan the
obj/ibtool directory once to collect each of the outputs.
2017-01-12 14:49:30 -05:00
Chris Hamons 2070d75205 [XM] Update ManagedSignature to work on XM and update XAMCORE_3_0 to 4 2017-01-12 13:46:19 -06:00
Sebastien Pouliot e238dac296 [ios][uikit] Fix [Model] in public API w/workarounds 2017-01-12 14:35:11 -05:00
Rolf Bjarne Kvinge cf169d43ac [xharness] Improve handling and reporting of unexpected exceptions. (#1480)
Unexpected exceptions are now caught in a more central location
(TestTask.RunInternalAsync), which means it's not necessary to catch
unexpected exceptions in other places (so those catch handlers have been
removed).

Additionally we now set the failure message when such an exception occurs, in
addition to writing the full exception details to a custom log file.
2017-01-12 20:08:42 +01:00
Rolf Bjarne Kvinge 483e067a3e [xharness] Improve a bit how logs are parsed and the results shown. (#1481)
Also find '[FAIL]'s in execution logs (which some mac tests produce) as well.
2017-01-12 19:40:14 +01:00
Timothy Risi 687aa6f25f Port monotouch-test suite to Xamarin.Mac (#1445)
* Port the Monotouch-test suite to run on Xamarin.Mac

Adds over 1300 new API tests for XM
2017-01-12 09:13:56 -09:00
Rolf Bjarne Kvinge 6f84d37d56 [mmp] Make sure Cecil is next to mmp.exe, so we doesn't load the system one. 2017-01-12 17:38:10 +01:00
Sebastien Pouliot 5195d45ecb [tests][tvos] Ignore UI[Collection|Table]ViewSource when checking for models/protocols
Both are our own creation and can be worked around with the `Delegate`
and `DataSource` properties (or the `Weak` ones).

We'll revisit this for `XAMCORE_4_0` as the test will fail again.

With this commit the remaining failures for tvOS should all be fixed

[FAIL] `UICollectionView.get_Source` return type `UICollectionViewSource` is a concrete type `[Model]` and not an interface `[Protocol]`
[FAIL] `UICollectionView.set_Source` includes a paramater of type `UICollectionViewSource` which is a concrete type `[Model]` and not an interface `[Protocol]`
[FAIL] `UITableView.get_Source` return type `UITableViewSource` is a concrete type `[Model]` and not an interface `[Protocol]`
[FAIL] `UITableView.set_Source` includes a paramater of type `UITableViewSource` which is a concrete type `[Model]` and not an interface `[Protocol]`
2017-01-12 10:39:19 -05:00
Marek Safar c210332a93 Cecil breaking change update 2017-01-12 10:26:24 -05:00
Sebastien Pouliot 4ffcfe4b4f [tests][coreanimation] Fix the ManagedSignature to ignore (was not always a protocol) CAAnimationDelegate and only process public API. Fix reported issues on CoreAnimation 2017-01-12 09:40:14 -05:00
Rolf Bjarne Kvinge 3693700e17 [xharness] Update where we look for mlaunch. (#1479)
We're shipping mlaunch now, which means we have other file system locations
where it might be.

Also don't look in Xamarin Studio anymore, it will always be an old version,
instead check the system's Xamarin.iOS version.
2017-01-12 15:12:16 +01:00
Sebastien Pouliot b1281b259f [cecil] Bump mono to get the latest Cecil's revision. Fixes #51336 (#1478)
This includes [1] which fix the parsing of broken .mdb as seen in [2]

Also fix mtouch's resolver and the static registrar to match some Cecil
API changes.

references:
[1] 045b0f9729
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=51336
2017-01-12 08:47:06 -05:00
Sebastien Pouliot aafa135c9c [uikit] Add convenience constructors for UISegmentedControl. Fixes #33163 (#1477)
* Existing `.ctor(object[])` now
    * changed to `params` (not a breaking change);
    * accept `NSString`, along with `string` and `UIImage`;
* Added `.ctor (NSArray)` (exposing the generated code to ease subclassing)
* Added `.ctor (params NSString[])`
* Added `.ctor (params string[])`
* Added `.ctor (params UIImage[])`

Also adds unit tests for all of them.

https://bugzilla.xamarin.com/show_bug.cgi?id=33163
2017-01-11 21:17:51 -05:00
Sebastien Pouliot 94c4a90c19 [watchos][objcruntime] Avoid extra unneeded (for the platform) code/symbols for NSLog (#1472) 2017-01-11 19:32:42 -05:00