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

4092 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge f3055ddd6d
[mtouch] Move native code sharing check for the remove-dynamic-registrar optimization until after checking the linker settings. (#3643)
Fixes this test failure:

1) Failed : Xamarin.MTouch.MT0113_linker
The error 'MT0113: Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All).' was not found in the output:
	Message #1 did not match:
		actual:   'Native code sharing has been disabled for the extension 'testServiceExtension' because the remove-dynamic-registrar optimization differ between the container app (default) and the extension (false).'
		expected: 'Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All).'

which happens because:

* Removing the dynamic registrar requires the linker, so removal of the dynamic registrar is disabled if the linker is not disabled
* This results in the app and appex having different values for the remove-dynamic-registrar option
* Thus the error message.

Technically either error is correct, but I prefer the previous one (about the
linker), because it directly assigns blame (the linker setting). Figuring out
what has to change (the linker setting) when the error message complains about
an optimization is not so straight forward for users.
2018-03-02 18:28:07 +01:00
Rolf Bjarne Kvinge b131a54be5
[static registrar] Optimize creation of delegates for blocks. (#3623)
* [static registrar] Optimize creation of delegates for blocks.

Optimize creation of delegates for blocks so that it doesn't require the
dynamic registrar.

This is done by getting the metadata token for the Create method that creates
the delegate, and embed that metadata token in the generated code from the
static registrar.

Also add tests, since this scenario was not covered by tests already.

* [mmptest] Fix test after recent changes.

* [test-libraries] Avoid duplicate symbols.

* [tests] Update according to changes.
2018-03-02 14:30:18 +01:00
Rolf Bjarne Kvinge 4be1cd723b
[runtime] Enable signal chaining for Xamarin.Mac apps. (#3631)
Reported in the forums: https://forums.xamarin.com/discussion/122594/xamarin-mac-signal-handling
2018-03-02 09:42:16 +01:00
Rolf Bjarne Kvinge a106cd7520
[mtouch] Bundle duplicated assemblies in the container app. Fixes #58873. (#3626)
Assemblies that satisfy all of these conditions:

* Are not in the container project.
* Are in multiple app extensions.

can (and should) be bundled in the container app.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58873
2018-03-02 09:39:42 +01:00
Rolf Bjarne Kvinge aa9243f528
[introspection] Put type-based exception in the type-based switch. (#3636) 2018-03-02 09:38:53 +01:00
Rolf Bjarne Kvinge 3ce723e577
[ObjCRuntime] Fix error message to show the assembly name instead of a pointer to the assembly name. (#3625) 2018-03-02 09:38:01 +01:00
Rolf Bjarne Kvinge 699d3ed582
[tests] Don't run mmp regression tests in parallel. Fixes maccore #645. (#3638)
* [tests] Don't run mmp regression tests in parallel. Fixes maccore #645.

For some reason vstool becomes confused and starts erroring out if multiple
vstools are running at the same time.

So work around this by executing the MMP regression tests serialized.

Fixes https://github.com/xamarin/maccore/issues/645.

* [xharness] Upload the logs from the mmp regression tests.
2018-03-02 07:48:41 +01:00
Rolf Bjarne Kvinge 573c8ae30b Bump maccore to get a few mlaunch fixes. (#3628)
Commit list for xamarin/maccore:

* xamarin/maccore@689fae7440 Bump maciostools to get a few mlaunch fixes.

Diff: c76baed02b...689fae7440
2018-03-01 14:21:57 -05:00
Chris Hamons c9fac28a8f
Fixes for Embeddinator after header changes (#3607)
- Two locations in our runtime headers were unable to be compiled outside of ObjC++ (Embeddinator)
2018-03-01 11:04:01 -06:00
Rolf Bjarne Kvinge 6c1bdea375
[xharness] Improve html report by formatting newlines and tabs in test failure messages using corresponding html tags. (#3627)
* [xharness] Improve html report by formatting newlines and tabs in test failure messages using corresponding html tags.

* [xharness] Improve nunit test reporting in html report by creating a list of failures.
2018-03-01 17:20:19 +01:00
Chris Hamons ca4360116c
[mmp] Add stripping of 32-bit dylibs to work with new App Store restrictions (#3387)
- https://github.com/xamarin/xamarin-macios/issues/3367
- App Store will now fail builds if you add in a 32-bit dylib
- If you are a 32-bit app you don't need the 64-bit part of your fat
dylib anyway
- Add --optimize=-trim-architectures to allow customization of behavior, as not everyone
uses app store

In addition, while writing tests for this is was noticed that mmp tests did not "really" run Release configuration correctly in most cases. Fixing this turned out to be a bit of a pain, but necessary to correctly test this (and other things).

- Turns out that /p:configuration:debug is not sufficient to tell mmp to
do the right thing
- That, in most projects, sets the DebugSymbols property, which really
is what is checked.
- However, two of our projects did not have that, so we always did
release mmp work.
- Removed configuration property for tests and added real "Release"
configuration option
2018-03-01 09:36:06 -06:00
Matt Ward 78e966d7ee [Security] Fix not being able to change the authorization prompt (#3612)
When asking for user credentials it was not possible to change the
default authorization prompt message so the application name is used
by default. When running an application with Mono this will be
mono-sgen64 or mono-sgen32.

The prompt is now added to the environment authorization item set
passed to AuthorizationCreate. It was being passed as part of the
rights item set. This allows a custom message to be set in the
authorization dialog.
2018-03-01 09:33:30 -06:00
Rolf Bjarne Kvinge de15337f61
[mtouch] Propagate the computed value for removal of the dynamic registrar to code shared app extensions. (#3622)
This fixes a startup crash in code shared app extensions due to having the
wrong value set in the runtime (the dynamic registrar was removed, but the
executable didn't know it).
2018-03-01 14:59:54 +01:00
Rolf Bjarne Kvinge 1a49079ee4
[static registrar] Make sure to include frameworks for linked away protocol types as well. (#3617)
At some point the code wasn't able to figure out the framework for linked away
types (because linked away types don't know which assembly they belong to, and
thus we couldn't verify that the type in question was a platform type or not),
so I skipped checking the namespace for such types.

Some time later I implemented support for storing the assembly for a linked
away type separately, so that it can later be looked up, and thus it's not
necessary to exclude linked away types anymore.

This fixes a build problem with the generated registrar code (which happens
only if the INCWidgetProviding interface is linked away) when building the
linkall extension tests:

    /work/maccore/master/xamarin-macios/tests/xharness/tmp-test-dir/link all1894/obj/iPhone/Debug64-today-extension/mtouch-cache/registrar.h:319:51: error: no type or protocol named 'NCWidgetProviding'
    @interface TodayViewController : UIViewController<NCWidgetProviding> {
                                                      ^
2018-03-01 14:57:58 +01:00
Rolf Bjarne Kvinge d421caeb97
[tests] Run iOS extensions tests on device. (#3618) 2018-03-01 14:57:28 +01:00
Rolf Bjarne Kvinge 514a3de817
[runtime] Fix exception marshalling when the dynamic registrar is removed. (#3616)
This can be reproduced by running monotouch-test with all optimizations in
Debug mode (because some of the exception marshalling tests are only enabled
in debug mode), so add such a configuration to xharness. To avoid bloating PR
builds, this configuration is only enabled when running all tests (either
manually selecting all tests for a PR, or on Wrench, where everything is
always tested).
2018-02-28 22:28:06 +01:00
Rolf Bjarne Kvinge 7ddb263e7d
[xharness] Propagate custom defines to referenced projects as well. Fixes maccore #655. (#3615)
The ProtocolTest test is located in the bindings-test assembly, and it
requires certain conditional compilation defines to be set in order to behave
properly.

With this fix we correctly set these defines when cloning the bindings-test
project (in addition to when we set the defines for the main project, which is
either monotouch-test or linkall for this test).

Fixes https://github.com/xamarin/maccore/issues/655.
2018-02-28 21:55:26 +01:00
Sebastien Pouliot 27e757e45e [tests][macos] Fix AuthenticodeDeformatterTest.VerifySignedAssembly failure on modern. Fixes 3207 (#3603)
* [tests][macos] Fix AuthenticodeDeformatterTest.VerifySignedAssembly failure on modern. Fixes 3207

Modern does not, by default/design, ship a machine.config file. This
means it only knowns about the default crypto shipped with .NET.

That's a problem for MD2 for which some old certificates might still
exists in the computer store, like our wrench bots.

That's generally not a problem since XM apps delegate trust to macOS
except for one case: Authenticode.

So verifying an authenticode signature can end up, thru X509Chain,
loading a certificate using MD2 without knowing how to create the
digest algorithm - and fail.

The fix is to register the algorithm manually (if not found).

https://github.com/xamarin/xamarin-macios/issues/3207

* [tests] Only call CryptoConfig on XM modern builds and add a reference to Mono.Security.dll on such projects
2018-02-28 09:35:08 +01:00
Bernhard Urban bc509bd7f1 Bump mono and touchunit (#3610)
* Bump mono

Commit list for mono/mono:

* mono/mono@331f927bfe Bump nunitlite (#7276)
* mono/mono@da6a45a158 Check if we are exceeding the worker count limit
* mono/mono@21d6b331fc Ios sdk changes (#7258)
* mono/mono@e87d1235da Merge mxe-Win32 and mxe-Win64 targets since we are building both in XA anyway (#7280)
* mono/mono@b9fb4d8857 Bump bockbuild to get curl error changes
* mono/mono@b7031bccfc Emit the same instances in hybrid aot mode as in full aot mode.
* mono/mono@3538148a18 [2017-12] [xbuild] add property that is available in msbuild (#7224)
* mono/mono@947e457f0e [sdks] Instead of using a XCODE_VERSION variable, let the caller set the XCODE_DIR variable directly, since x.ios is using a full path. (#7111)
* mono/mono@7f0c97aa03 Bump bockbuild for https://github.com/mono/bockbuild/pull/62 (#7207)
* mono/mono@85cfb9ccab Disable partial sharing during JITting, its only been tested in full aot mode, and doesn't seem to work with JITted methods. Fixes https://github.com/mono/mono/issues/7085.
* mono/mono@22a6ec10b1 Add hybrid aot tests.
* mono/mono@454bd206aa Remove reflection calls for value has to be set

Diff: 4adf8229e8...331f927bfe

* Bump Touch.Unit

Commit list for spouliot/Touch.Unit:

* spouliot/Touch.Unit@1c41c75 Revert "[TouchRunner] do not use FinallyDelegate in Runner, because it requires remoting API to be available (#49)" (#50)

Diff: 4ac4e32500...1c41c75983
2018-02-28 09:33:23 +01:00
Joel Martinez 3bb0702a45 bump maccore for classic deprecation (#3591) 2018-02-27 15:34:20 +01:00
Rolf Bjarne Kvinge d973192c57
[xharness] All variants of GuiUnit projects must be special-cased. (#3602)
This fixes an issue where multiple copies of the GuiUnit project would have
the same output directory, causing random problems when building those
projects in parallel.
2018-02-27 10:28:42 +01:00
Rolf Bjarne Kvinge afb6c6cd62
[xharness] Always build the test libraries before doing anything else. (#3601)
Fixes an issue where multiple projects would try to build the test libraries simultaneously.
2018-02-27 07:43:51 +01:00
John Miller 2a29834ba2 Update README.md (#3587)
* Update README.md

New README layout which includes sections to help direct visitors to the appropriate areas.
Adds note about the license

* Adds Gitter Button

Back by popular demand!

* Fixes Vote link
2018-02-26 14:31:49 -05:00
Rolf Bjarne Kvinge bfa4c548ed
[tests] Fix ProtocolTest to work with in both monotouch-test and linkall. (#3598)
The [Protocol] attributes the test checks for are not linked away in
monotouch-test (because monotouch-test only links SDK assemblies), but they
are linked away in link all, so adjust the test accordingly.
2018-02-26 17:37:09 +01:00
Rolf Bjarne Kvinge 346051c5e3
[xharness] Don't try to execute an empty collection of tests. Fixes xamarin/maccore#600. (#3600)
Fixes https://github.com/xamarin/maccore/issues/600.
2018-02-26 17:36:05 +01:00
Rolf Bjarne Kvinge a2676ba064
[introspection] Don't process IKPictureTaker, it may crash at any time. (#3599)
See also https://bugzilla.xamarin.com/show_bug.cgi?id=46624, where the same
logic was applied to apitest.

Ref: https://trello.com/c/T6vkA2QF/62-29311598-ikpicturetaker-crashes-randomly-upon-deallocation?menu=filter&filter=corenfc
2018-02-26 17:31:41 +01:00
Bernhard Urban f5b860cf75 [system-dependencies] simplify mono version check (#3596) 2018-02-26 14:45:26 +01:00
Rolf Bjarne Kvinge 452aeaa59b
[src] Fix csc warnings. (#3589)
Now that we've switched to csc, we're also delighted to get new warnings 🎉

    ObjCRuntime/Blocks.cs(54,26): warning CS0649: Field 'XamarinBlockDescriptor.descriptor' is never assigned to, and will always have its default value
    AudioUnit/AudioUnit.cs(405,19): warning CS0649: Field 'AudioUnit.handle' is never assigned to, and will always have its default value
    ObjCRuntime/Blocks.cs(55,23): warning CS0649: Field 'XamarinBlockDescriptor.ref_count' is never assigned to, and will always have its default value 0
    ObjCRuntime/Blocks.cs(54,26): warning CS0649: Field 'XamarinBlockDescriptor.descriptor' is never assigned to, and will always have its default value
    AudioUnit/AudioUnit.cs(405,19): warning CS0649: Field 'AudioUnit.handle' is never assigned to, and will always have its default value
    ObjCRuntime/Blocks.cs(55,23): warning CS0649: Field 'XamarinBlockDescriptor.ref_count' is never assigned to, and will always have its default value 0

We're so delighted that we want them gone asap 😎
2018-02-26 07:46:32 +01:00
Rolf Bjarne Kvinge 0dd292f3d1
Bump maccore & macios-binaries to fix the documentation workflow. (#3571)
This should make the "test-docs" step on wrench pass again.

Commit list for xamarin/macios-binaries:

* xamarin/macios-binaries@e1e8bdf Add ios/compat version of core.dll and temp.dll from d15-5 for documentation workflow. (#7)
* xamarin/macios-binaries@e64e7ef Merge pull request #5 from timrisi/ClassicDocs
* xamarin/macios-binaries@3c92bb1 Remove .DS_Store files
* xamarin/macios-binaries@587623f Add classic docs

Diff: 93fb980b0e...e1e8bdf7a8

Commit list for xamarin/maccore:

* xamarin/maccore@1b5311781c [docs] Look for binary classic files in the right place. (#646)

Diff: 4872731c32...1b5311781c
2018-02-22 22:37:32 +01:00
Chris Hamons 040461ba0a
Warn when building 32-bit macOS applications (#3564)
- https://github.com/xamarin/xamarin-macios/issues/3325
2018-02-22 12:47:28 -06:00
Vincent Dondain 3b56d5e780
[modelio] MDLVoxelArray should have a base type of MDLObject (fix xtro) (#3563)
Moving the base type to `MDLObject` wasn't a breaking change on macOS.
There is no reason for the ifdef and xtro reports the issue correctly.
2018-02-22 12:25:18 -05:00
Chris Hamons 4ba4dfc813
Build with CSC instead of MCS (#3393)
- Improve error messages from install-source when crashing
2018-02-22 11:07:33 -06:00
Bernhard Urban 4cab7b2c75 Bump mono & Touch.Unit (#3560)
* Bump mono

Commit list for mono/mono:

* mono/mono@4adf8229e8 bump nunit-lite (#7139)
* mono/mono@de4729fae2 [mono-api-html] Expand "ignore" functionality (#7154)
* mono/mono@721462c4a1 [2017-12] [corlib] Fix RuntimeFeatureTest.NoNewFeaturesAdded on mobile (#7152)

Diff: 177997b063...4adf8229e8

* bump Touch.Unit

Commit list for spouliot/Touch.Unit:

* spouliot/Touch.Unit@4ac4e32 [TouchRunner] do not use FinallyDelegate in Runner, because it requires remoting API to be available (#49)

Diff: b5b227e80b...4ac4e32500
2018-02-22 11:58:17 -05:00
Vincent Dondain afd33cb33a
[metalkit] Add 'MTKTextureLoader' missing bindings (fix xtro) (#3561) 2018-02-21 17:45:05 -05:00
Rolf Bjarne Kvinge 3f16223deb
[registrar] Fix resolving linked away generic types. Fixes #3523. (#3539)
* [registrar] Fix resolving linked away generic types. Fixes #3523.

Fixes #3523.

* [tests] Use a link all test instead of mtouch test.

It's much faster, since we're already building link all everywhere.

* [tests] Use the static registrar in all linkall simulator configurations.
2018-02-21 13:36:02 +01:00
Rolf Bjarne Kvinge c0c0e63a3b
[mtouch] Find the link context for code shared app extensions in the static registrar. Fixes #3514. (#3545)
When code sharing is enabled, only the container app/target will have a
LinkContext.

So make sure the static registrar finds that link context when it needs
information from the linker.

https://github.com/xamarin/xamarin-macios/issues/3514
2018-02-21 09:27:26 +01:00
Rolf Bjarne Kvinge f7d907983e
[tests] Fix NSDataTest.Https to use a site with a valid and complete certificate chain. Fixes #644. (#3549)
Fixes https://github.com/xamarin/maccore/issues/644.
2018-02-21 09:09:12 +01:00
Alex Soto ce05cbf9bf
[Appkit] Fix NSApplication.NextEvent signatures. (#3542)
* [Appkit] Fix NSApplication.NextEvent signature.

Fixes xamarin/xamarin-macios#3540
Fixes xamarin/xamarin-macios#3541

The following issues are addressed:

* The `expiration` parameter must allow `null`, it is documented as such.
* The `NSApplication.NextEvent` method now has a NSRunLoopMode overload.
* The `NSApplication.NextEvent` methods  where `mode` is a `string` are now
  deprecated in favour of the `[NSRunLoopMode|NSString]` overloads since
  passing a .NET `string` does not make sense due to pointer equality.

* Let's bring together the Obsoleted API's for easier review when XAMCORE_4_0 happpens.

* Fix Obsolete message.

* implement feedback
2018-02-21 00:57:58 -06:00
Rolf Bjarne Kvinge 4c53980502
[tests] Automatically rebuild 'test.config' if it can't be found. (#3527)
* [tests] Automatically rebuild 'test.config' if it can't be found.

This condition usually happens when I 'git clean -xfd' in tests/ and then want
to run tests from xharness.

The manual step is to run "make" in tests/, but it's better if we can do it automatically.

* [msbuild] Add file to fix build.
2018-02-21 07:37:34 +01:00
Sebastien Pouliot 43a4bd8d20
[tests] Fix NoFatCorlib to succeed when compiling a Xamarin.Sdk.framework (#3552)
A different location is needed when we build the SDK as a framework
and our bots (that test on devices) are running this configuration
2018-02-20 22:04:34 -05:00
Rolf Bjarne Kvinge 83509221e1
[tests] Update tests according to temporary directory name change. (#3548) 2018-02-20 17:59:14 +01:00
Vincent Dondain 51b3c0aaec
[healthkit] Fix typos in 'HKInsulinDeliveryReason' and 'HKBloodGlucoseMealTime' (#3503)
- Fixes https://github.com/xamarin/xamarin-macios/issues/3499
(HKBloodGlucoseMealTime misspellings in bindings)
- 'HKInsulinDeliveryReason' [doc](https://developer.apple.com/documentation/healthkit/hkinsulindeliveryreason?language=objc)
- 'HKBloodGlucoseMealTime' [doc](https://developer.apple.com/documentation/healthkit/hkbloodglucosemealtime?language=objc)
- Commented ApiTypoTest.
2018-02-20 11:57:59 -05:00
Rolf Bjarne Kvinge 43489a203e
[xharness] Fix 'MtouchExtraArgs' casing. Fixes #3516. (#3546)
https://github.com/xamarin/xamarin-macios/issues/3516
2018-02-20 17:41:51 +01:00
Manuel de la Pena e9798ce671
[Tests] Change the guid of the test project to allow to use VS. (#3538) 2018-02-20 16:22:23 +01:00
Sebastien Pouliot 2a964030a8
[linker] Take extra care to avoid 32/64 bits specific mscorlib.dll (#3532)
We want to avoid separate `mscorlib.dll` assemblies for 32/64 bits so
the  architecture specific code for `n[u]int` and `nfloat` must be
preserved in both cases.

Because a single, slightly larger, assembly is much smaller than two
(slightly smaller) ones.

This is not a common situation since the extraneous preserved API are
often used in the application (or 3rd party code) so, in most cases,
a single `mscorlib.dll` was already used.

This merely close the gap for some cases, like our `link all` application
where this happened.
2018-02-19 19:16:17 -05:00
Sebastien Pouliot dea72218b1
Bump mono to head of 2017-12 (#3535)
Commit list for mono/mono:

* mono/mono@177997b063 [sdks] Fix for XA integration (#7108)
* mono/mono@c8845164ad Merge more SDK changes from mono master. (#7090)
* mono/mono@ac87945049 Revert "Merge more SDK changes from mono master." (#7106)
* mono/mono@5ef368bb1e [sdks] Fix for XA integration (#7092)
* mono/mono@c67ec40879 Merge more SDK changes from mono master. (#7090)
* mono/mono@fd1fd05f18 * Generalize commit 0c6932a985175a5cf0cbc59ffd3af4abf3db248e to support LDARG{0|1|2|3}, LDLOC{0|1|2|3}, LDARGS, LDLOCS, LDARG and LDLOC instead of LDLOC and LDLOCS. Improves generated code similar to issue #60945 (#7062)
* mono/mono@936f7841d7 [ci] Disable monodoc tests on Windows for now
* mono/mono@9a2f778a91 [coop] Disable failing tests on PR (#6472)
* mono/mono@96eee2f901 Disable some PngCodecTest that have trouble on CI right now
* mono/mono@28e047fd35 [debugger] disable StepOutAsync test because it's flaky
* mono/mono@0d51a8063b [sdks] Backport changes from master (#7084)
* mono/mono@b232a3929b Bump aot file format version because of 7cac757e60cd61aa070f7e0fffca225364f58c0c. (#7083)

Diff: fbc4f0546d...177997b063

https://bugzilla.xamarin.com/show_bug.cgi?id=60945
2018-02-19 17:01:17 -05:00
Rolf Bjarne Kvinge 5788a9fa9b
[mtouch] Rename temporary directories so the order assemblies move is clearer. (#3531)
* [mtouch] Rename temporary directories so the order assemblies move is clearer.

I implemented this myself, but I can never remember in which order assemblies
go from one directory to another during the build.

So number these temporary directories, so that even the most forgetful minds
can understand without having to remember anything.

* [tests] Update test according to temporary directory name change.
2018-02-19 21:50:20 +01:00
Rolf Bjarne Kvinge 3113c5d2b5
[mtouch/mmp] Fix tracking of whether the static registrar should run again or not. Fixes #641. (#3534)
* [tests] Improve debug spew for the RebuildTest_WithExtensions test.

* [mtouch/mmp] Store/load if the dynamic registrar is removed or not into the cached link results.

Store/load if the dynamic registrar is removed or not into the cached link
results, so that we generate the correct main.m even if cached linker results
are used.

* [mtouch/mmp] The static registrar must not execute if we're loading cached results from the linker.

The static registrar must not execute if we're loading cached results from the
linker, because the static registrar needs information from the linker that's
not restored from the cache.

* [mtouch/mmp] Share Touch code.

* [mtouch/mmp] Make it possible to touch inexistent files (to create them).

* [mtouch/mmp] Fix tracking of whether the static registrar should run again or not.

The recent changes to support optimizing away the dynamic registrar caused the
Xamarin.MTouch.RebuildTest_WithExtensions test to regress.

The problem
-----------

* The linker now collects and stores information the static registrar needs.
* This information is not restored from disk when the linker realizes that it
  can reload previously linked assemblies instead of executing again.
* The static registrar runs again (for another reason).
* The information the static registrar needs isn't available, and incorrect
  output follows.

So fix 1: show an error if the static registrar runs when the linker loaded
cached results.

The exact scenario the test ran into is this:

* 1st build: everything is new and everything is built.
* 2nd build: contents of .exe changes, the linker runs again, the static
  registrar runs again, but sees that the generated output didn't change, so
  it doesn't write the new content to disk (this is an optimization to avoid
  compiling the registrar.m file again unless needed).
* 3rd build: only the .exe timestamp changes, the linker sees nothing changes
  in the contents of the .exe and loads the previously linked assemblies from
  disk, the static registrar sees that the .exe's timestamp is newer than
  registrar.m's timestamp and run again, but doesn't produce the right result
  because it doesn't have the information it needs.

Considered solutions
--------------------

1. Only track timestamps, not file contents. This is not ideal, since it will
   result in more work done: in particular for the case above, it would add a
   registrar.m compilation in build #2, and linker rerun + static registrar
   rerun + registrar.m compilation + final native link in build #3.
2. Always write the output of the static registrar, even if it hasn't changed.
   This is not ideal either, since it will also result in more work done: for
   the case above, it would add a registrar.m compilation + final native link
   in build #3.
3. Always write the output of the static registrar, but track if it changed or
   not, and if it didn't, just touch registrar.o instead of recompiling it.
   This only means the final native link in build #3 is added (see #5 for why
   this is worse than it sounds).
4. Always write the output of the static registrar, but track it it changed or
   not, and if it didn't, just touch registrar.o instead of recompiling it,
   and track that too, so that the final native link in build #3 isn't needed
   anymore. Unfortunately this may result in incorrect behavior, because now
   the msbuild tasks will detect that the executable has changed, and may run
   dsymutil + strip again. The executable didn't actually change, which means
   it would be the previously stripped executable, and thus we'd end up with
   an empty .dSYM because we ran dsymtil on an already stripped executable.
5. Idea #4, but write the output of the final link into a temporary directory
   instead of the .app, so that we could track whether we should update the
   executable in the .app or not. This is not optimal either, because
   executables can be *big* (I've seen multi-GB tvOS bitcode executables), and
   extra copies of such files should not be taken lightly.
6. Idea #4, but tell the MSBuild tasks that dsymutil/strip doesn't need to be
   rerun even if the timestamp of the executable changed. This might actually
   work, but now the solution's become quite complex.

Implemented solution
--------------------

Use stamp files to detect whether a file is up-to-date or not.

In particular:

* When we don't write to a file because the new contents are identical to the
  old contents, we now touch a .stamp file. This stamp file means "the
  accompanying file was determined to be up-to-date when the stamp was
  touched."
* When checking whether a file is up-to-date, also check for the presence of a
  .stamp file, and if it exists, use the highest timestamp between the stamp
  file and the actual file.

Now the test scenario becomes:

* 1st build: everything is new and everything is built.
* 2nd build: contents of .exe changes, the linker runs again, the static
  registrar runs again, but sees that the generated output didn't change, so
  it doesn't write the new content to disk, but it creates a registrar.m.stamp
  file to indicate the point in time when registrar.m was considered up-to-
  date.
* 3rd build: only the .exe timestamp changes, the linker sees nothing changes
  in the contents of the .exe and loads the previously linked assemblies from
  disk, the static registrar sees that the .exe's timestamp is *older* than
  registrar.m.stamp's timestamp and doesn't run again.

We only use the stamp file for source code (registrar.[m|h], main.[m|h],
pinvokes.[m|h]), since using it every time has too much potential for running
into other problems (for instance we should never create .stamp files inside
the .app).

Fixes these test failures:

    1) Failed : Xamarin.MTouch.RebuildTest_WithExtensions("single","",False,System.String[])
      single
      Expected: <empty>
      But was:  < "/Users/builder/data/lanes/5746/4123bf7e/source/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory371/testApp.app/testApp is modified, timestamp: 2/15/2018 3:04:11 PM > 2/15/2018 3:04:09 PM" >

    2) Failed : Xamarin.MTouch.RebuildTest_WithExtensions("dual","armv7,arm64",False,System.String[])
      dual
      Expected: <empty>
      But was:  < "/Users/builder/data/lanes/5746/4123bf7e/source/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory375/testApp.app/testApp is modified, timestamp: 2/15/2018 3:06:03 PM > 2/15/2018 3:06:00 PM" >

    3) Failed : Xamarin.MTouch.RebuildTest_WithExtensions("llvm","armv7+llvm",False,System.String[])
      llvm
      Expected: <empty>
      But was:  < "/Users/builder/data/lanes/5746/4123bf7e/source/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory379/testApp.app/testApp is modified, timestamp: 2/15/2018 3:07:14 PM > 2/15/2018 3:07:12 PM" >

    4) Failed : Xamarin.MTouch.RebuildTest_WithExtensions("debug","",True,System.String[])
      debug
      Expected: <empty>
      But was:  < "/Users/builder/data/lanes/5746/4123bf7e/source/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory383/testApp.app/testApp is modified, timestamp: 2/15/2018 3:08:16 PM > 2/15/2018 3:08:13 PM" >

    5) Failed : Xamarin.MTouch.RebuildTest_WithExtensions("single-framework","",False,System.String[])
      single-framework
      Expected: <empty>
      But was:  < "/Users/builder/data/lanes/5746/4123bf7e/source/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory387/testApp.app/testApp is modified, timestamp: 2/15/2018 3:09:18 PM > 2/15/2018 3:09:16 PM" >

Fixes https://github.com/xamarin/maccore/issues/641
2018-02-19 20:28:04 +01:00
Rolf Bjarne Kvinge 6d88e01b5e
[linker] Find linked away interfaces when resolving removed interfaces. Fixes #3513. (#3515)
The linker might remove interfaces that have already been linked away. Make
sure to look for the TypeDefinition for such interfaces among the types that
have already been linked away.

Fixes https://github.com/xamarin/xamarin-macios/issues/3513.
2018-02-19 11:36:38 +01:00
Matt Sylvia 96085adb66 Bump XI XM version numbers (#3519) 2018-02-16 15:33:23 -05:00