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

1480 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge a0aa48465b
Fix generator diff after .NET modifications. (#8180)
* Some files were renamed after the .NET support was implemented, so the list
  of files to ignore for the diff had to be updated.
* Update .gitignore.
2020-03-24 15:52:03 +01:00
Rolf Bjarne Kvinge 3a30097d3a
[mtouch/mmp] Add better diagnostics if xcrun returns invalid data. (#8166) 2020-03-23 12:29:23 +01:00
Rolf Bjarne Kvinge c6e9932be9
[mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147. (#8150)
* [mtouch/mmp] Only use stdout from xcrun as the path of the file that was found. Fixes #8147.

xcrun can print stuff to stderr even if it succeeds and prints what it found
to stdout, which means we have to separate stdout and stderr when capturing
xcrun's output.

This also means that we need a few changes to our RunCommand API:

* Add support for capturing stdout and stderr separately by providing
  different callbacks/StringBuilder instances.
* Use overloads instead of default arguments, because with default arguments
  we end up with ambiguous matches in a lot of places with the new overloads.

Fixes https://github.com/xamarin/xamarin-macios/issues/8147.

* [tests] Fix mmptest build.

* [mtouch/mmp] Fix process log output.
2020-03-20 17:46:43 +01:00
Jo Shields b23c379dd8
Bump to mono:2020-02 (#7795)
Bump mono to 2020-02 head to be in sync with Android.

Co-authored-by: Imran Hameed <imhameed@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
2020-03-20 10:38:47 -04:00
Rolf Bjarne Kvinge 4d7186028e
[mtouch/mmp] Improve target framework code. (#8137)
* Unify target framework code between mtouch and mmp.
* Simplify the code in mmp: have three possible valid target frameworks for
  most of code, and add special code to handle setting any other valid target
  frameworks to redirect to one of those three valid target frameworks (and
  warn if given any of those valid, but not "main", target frameworks). Any
  other code can then depend on the target framework having exactly one of
  those specific values, which means we can make IsUnified* variables
  convenience properties instead.
* Unify a bit more of the argument parsing code between mtouch and mmp, since
  that made a few other things easier.
* Add TargetFramework.IsValidFramework to have one validation implementation.
* Move the implementation of TargetFramework.MonoFrameworkDirectory to mmp
  itself, it's not really related to the target framework.
* Remove Driver.IsUnified and IsClassic from mmp, they're not used anymore.
* Formally deprecate --xamarin-[full|system]-framework in mmp, they've really been deprecated for many years.
* Remove LinkerOptions.TargetFramework, it's not used anymore.
* Get rid of mmp's userTargetFramework fried, it's duplicated with the
  targetFramework field.
* Add a few tests, and tweak others a bit.

Breaking changes:

* Both mtouch and mmp require --target-framework now. The only direct
  consumers should be the MSBuild tasks, which already pass --target-framework
  all the time. This simplifies code, and removes assumptions.
2020-03-19 09:28:09 +01:00
Rolf Bjarne Kvinge 974ce49f9b
[mmp] Define DEV in the project file's Debug configuration for mmp to work correctly when built from within the IDE. (#8142) 2020-03-19 09:27:14 +01:00
Rolf Bjarne Kvinge 22f4418d2f
[linker] Update the list of opcodes we can't compute a constant value for. (#8143)
Teach the linker about more opcodes it can't compute a constant value for.
This way a debug version of mmp/mtouch doesn't print out these opcodes for
someone to check.

This code is only executed when debugging mtouch/mmp in the IDE, so no change
to released bits.
2020-03-19 09:26:24 +01:00
Rolf Bjarne Kvinge 2985e0d455
[mmp] Fix install_name_tool invocation. (#8132)
This regressed in 13a56ffb95.
2020-03-18 12:15:20 +01:00
Rolf Bjarne Kvinge 13a56ffb95
[mtouch/mmp] Rework how we find developer tools. Partial fix for #4634 and fixes #8005. (#8121)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/4634.
Fixes https://github.com/xamarin/xamarin-macios/issues/8005.
2020-03-17 15:49:39 +01:00
Rolf Bjarne Kvinge 0f12c101e0
Fix API comparison. Fixes #xamarin/maccore@2176. (#8108)
* Make everything in src/ build into a directory dependent upon BUILD_DIR.
  That way the API comparison can successfully build into a different
  directory.
* Use an absolute path as the temporary build directory. This works better
  when the path is used in directories with different depth from the root.

Fixes https://github.com/xamarin/maccore/issues/2176.
2020-03-16 09:48:52 +01:00
Rolf Bjarne Kvinge efb6efb26f
[linker] Remove dead code. (#8100) 2020-03-13 15:50:18 +01:00
Rolf Bjarne Kvinge 7b92e9cda4
[registrar] Remove unused function. (#8101) 2020-03-13 15:48:06 +01:00
Rolf Bjarne Kvinge 800d63bb4d Merge remote-tracking branch 'origin/master' into dotnet-bgen 2020-03-12 10:37:12 +01:00
Sebastien Pouliot 11f46d581b
[linker] Fix some strings (no effect on execution) (#8087)
* Extra whitespace in step name. Found by Whitney reviewing a backport;
* Two errors not using (localizable) resources strings. I likely forgot to add the file to the original PR.
2020-03-11 14:48:15 -04:00
Rolf Bjarne Kvinge dac68f33b4 Merge remote-tracking branch 'origin/master' into dotnet-bgen 2020-03-11 12:01:31 +01:00
Rolf Bjarne Kvinge 9b82c1c311
[mmp] Only iOS has dual bitness now, no need to check for Xamarin.Mac. (#8076) 2020-03-10 20:23:17 +01:00
Rolf Bjarne Kvinge d2420661da Add .NET 5 target frameworks. 2020-03-09 18:43:41 +01:00
Rolf Bjarne Kvinge 51b6b707e4
[devops] Fix provisioning device testing bots. (#8060)
It seems we only want to provision a few specific things, so modify the
selection logic to first ignore everything, then enable what we want.

This way we don't have to add new ignore flags here every time we add
something new to the provisioning script.

We also don't need to check if 7z and python3 provisioning is possible, since
we already know that (by manually checking the system-dependencies.sh script
for the current hash).
2020-03-06 21:17:22 +01:00
Sebastien Pouliot 2be35fb1c8
[mtouch][mmp] Share error.cs and make it safer against FormatException (#8047)
* [mtouch][mmp] Share error.cs and make it safer against FormatException

Beside the obvious code sharing [1] this makes the error reporting code
safer against `FormatException`.

Even with code review this happened a few times in the past - we get
a string that can't format correctly in some error handling code. This
means the `FormatException` must be fixed before we can see the
underlying root issue (delaying bug fixes and support).

Recent changes made for localization makes it harder to review the
original strings (and even harder for translated strings) for
correctness. This means we can end up with something like

```
String.Format ("{0} {1}", "foo");
``

and easily miss it (since they split between different files) if there
are several changes inside a PR.

Finally sprinkle some unit tests :)

[1] we should move everything to use `ProductException` but that will be
for another PR...
2020-03-06 09:34:16 -05:00
Rolf Bjarne Kvinge 19a4304c03
[tools] Remove the MonoTouch,v1.0 target framework. (#8051)
Nobody should be using it anymore.
2020-03-05 22:05:40 +01:00
Rolf Bjarne Kvinge 7744ad82db
[linker] No need to support monotouch.dll anymore. (#8050) 2020-03-05 22:05:08 +01:00
Sebastien Pouliot 54f2dae935
[mtouch] Add `force-rejected-types-removal` optimization (#8009)
This optimization can be enabled when it's not possible to use the
managed linker (e.g. **Don't link**) or when the managed linker cannot
remove references to deprecated types that would cause an application
to be rejected by Apple.

References to the existing types will be renamed, e.g. `UIWebView` to
`DeprecatedWebView`, in every assemblies.

The type definition is also renamed (for validity) and all custom
attributes on the types and their members will be removed.
Code inside the members will be replaced with a
`throw new NotSupportedException ();`.

The msbuild test app `MyReleaseBuild` has been updated to test that the
optimization is working as expected (device builds are slow so reusing
this test has little impact in test time).

Basically the test ensure that `UIWebView` is used and cannot be removed
by the compiler (optimization) or the managed linker (since it's
referenced). Since the optimization is enabled then we can `grep` then
final `.app` directory to ensure there's no mention of `UIWebView` inside
any of the files that would be submitted.

The application can be run, by itself, and will turn green if OK, red if
`DeprecatedWebView` can't be found (skeleton replacement for `UIWebView`)
or orange if a `NotSupportedException` is thrown.

Finally introspection tests have been updated to skip over the deprecated
(and renamed) types. It should not be an issue right now, since this
optimization is not enabled by default, but it made testing easier.
2020-03-02 09:20:29 -05:00
Sebastien Pouliot 0cdfb53d3c
[linker] Remove a few redundant lines of code (#8004) 2020-02-28 11:11:31 -05:00
Manuel de la Pena 147c363c07
[VSTS] update labels used in the pipeline. (#7996) 2020-02-27 13:12:55 -05:00
Manuel de la Pena 3d32ab52a7
[Harness] Move BCLTestImport sources to their rightful place. (#7985)
We initially added a cmd to do the bcl test import generation that has
never been used.

We are moving the bcl test importer code to xharness and creating a
NUnit test project to run the tests that we already added. Unit tests
pass.
2020-02-26 14:10:36 -05:00
Rolf Bjarne Kvinge 2b733ae79c
[mmp] Set 'disable_omit_fp' by default to provide better native stack traces in certain cases. (#7981)
* [mmp] Set 'disable_omit_fp' by default to provide better native stack traces in certain cases.

This may produce better stack traces when crashes occur, which could be
helpful for tracking down issues like
https://github.com/xamarin/maccore/issues/643.

Also add an mmp option to override the default behavior.

This is unlikely to cause any problems, because Visual Studio for Mac sets
MONO_DEBUG=disable_omit_fp at launch, which means that all processes launched
by VSMac will also have this variable set already.

* Fix lldb attach disabling.
2020-02-26 15:49:55 +01:00
Rolf Bjarne Kvinge 2f4dae9e00
[mmp] Don't ignore failures to execute pkg-config and simplify/improve logic. (#7969)
* [mmp] Don't ignore failures to execute pkg-config and simplify/improve logic.

* Show proper errors if pkg-config fails to execute.
* Extract logic to verify system mono version into its own function.
* Extract logic to execute pkg-config into its own function.

* Simplify code slightly.

* [mmp] Remove the MM5301 error message.

It's never used in mmp, and the same error code is already used in mtouch.
2020-02-26 00:38:20 +01:00
Rolf Bjarne Kvinge d2d93b6ec9
[mtouch/mmp] Share boolean parsing logic. (#7967) 2020-02-25 07:00:58 +01:00
Rolf Bjarne Kvinge beaa94c0f5
[mmp] Remove dead code. (#7968) 2020-02-25 06:57:31 +01:00
Rolf Bjarne Kvinge e9ac84097a
[mmp] Use relative path in mmp script. (#7909)
* [mmp] Use relative path in mmp script.

Makes relocating mmp easier.

* [mmp] Resolve the right directory.

mmp might be in two locations (the second one works because the Commands
directory is a symlink to the actual bin directory):

* /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin/mmp
* /Library/Frameworks/Xamarin.Mac.framework/Commands/mmp

The mmp script didn't work properly in the latter case, because it would
calculate where to find the mmp.exe assembly based on real location the parent
directory (which would be /Library/Frameworks/Xamarin.Mac.framework), instead
of the real location of the directory where mmp is
(/Library/Frameworks/Xamarin.Mac.framework/Commands, which would resolve to
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin).

The fix is to just get the real path of the Commands directory, and compute
the location of the mmp.exe from there.
2020-02-25 06:57:15 +01:00
Rolf Bjarne Kvinge feb5e96c2a
Rename bmac-mobile-mono to mono-sgen. (#7966)
bmac-mobile-mono is an old name (when we needed a specific executable to
execute bmac) that has nothing to do with its current usage (AOT code for
Xamarin.Mac apps).

So rename the executable to reflect current usage.

This makes looking at the installed files a bit less confusing.
2020-02-25 06:51:12 +01:00
Sebastien Pouliot 57b2a8ff63
[mtouch][mmp] Share TimeStampStep code in the linker pipelines (#7955)
This makes the `--time` options more useful to see inside the linker's
pipeline steps.

This was used only in `mtouch` before (and missed some steps [1]).
Now it's shared between both tools.

[1] not sure why... merge issue/backport maybe ?
2020-02-24 12:03:44 -05:00
Sebastien Pouliot d83e13edf1
[mtouch][mmp] Add a `--warn-on-type-ref=X` option (#7949)
Using this option it's possible to test for the presence of a type
reference in both pre-linked and post-linked assemblies.

This makes it possible to detect if
* a 3rd party assemblies are using some specific type you would like to avoid;
* a type reference has been removed during the build (e.g. linker)

Notes:
* Custom attributes are encoded differently and not included in the assembly type references metadata.
* Assembly that define a type `X` do not have a reference (but the definition) of the type (and won't be reported).

If either the pre or post-linked warnings are not useful then it's possible
 to add `-nowarn:150x` to exclude the results.

E.g.
* `-nowarn:1502` would not report references in pre-linked assemblies;
* `-nowarn:1503` would not report references in post-linked assemblies;

Finally `-warnaserror:150x` can be used to stop a build that would not
satisfy either the pre or post-linked condition.

* `-warnaserror:1502` would not report references in pre-linked assemblies;
* `-warnaserror:1503` would not report references in post-linked assemblies;

_side note_ same as https://github.com/xamarin/xamarin-macios/pull/7925
except that this one uses the localized mtouch/mmp errors only in master (so far)
2020-02-20 22:25:23 -05:00
Sebastien Pouliot 1ce5eeb3dc
[mtouch][mmp] Fix possible exception when logging strings with `{x}` (#7941)
We can end up with a format that has `{x}` inside it and no argument. If
this is logged (which depends on verbosity level) then we end up with an
uncaught exceptions and either `MT0000` or `MM0000` errors.

This happens in #7904 due to other, unrelated, issues (a variable is not
expanded) but this can happen in other circumstances, e.g. a file could
be named `{x}.cs`.

The easy fix is to use the right `Console.WriteLine` overload if there
are no arguments provided. This is always good since it avoid an non
required call to `String.Format`.

Fixes https://github.com/xamarin/xamarin-macios/issues/7904
2020-02-20 14:52:25 -05:00
Rolf Bjarne Kvinge 759180672d
[mtouch/mmp] Share code to locate the framework directory. (#7911) 2020-02-19 09:23:52 -05:00
Rolf Bjarne Kvinge 984374157c
[mtouch/mmp] Share Main. (#7910) 2020-02-18 16:05:42 -05:00
Rolf Bjarne Kvinge 96d5d3e02b
[mtouch/mmp] Share verbosity code. (#7908) 2020-02-18 15:44:19 -05:00
Manuel de la Pena 0de70e3dde
[VSTS] Correct order of params for make. (#7927) 2020-02-18 09:15:18 -05:00
Manuel de la Pena e21e50fe73
[VSTS] Clean always, no matter what. (#7926)
Good citizens clean after themselves, even when they are cancelled. Up
to this point if the task was cancelled we would not clean after us.
2020-02-18 09:14:48 -05:00
Manuel de la Pena 4937a5d626
[VSTS] Update pipeline yml to use the correct results pattern. (#7922) 2020-02-17 17:12:07 -05:00
Manuel de la Pena 09cf9a92dc
[VSTS] Propagate debug to the make rules (#7917)
If the pipeline is set on debug, to be able to see any issues, propagate
that to the make calls so that we can also get the information there,
else debugging issues with the pipelines + make is really hard.
2020-02-17 16:08:56 -05:00
Manuel de la Pena 59faa728cd
[VSTS] If we could not checkout, do not try to call scripts that are missing. (#7919)
Some of the bots fail to do the checkout (miss configuration). The clean
up step is always executed and assumes the pressence of a script, which
will fail since the script is not there.

The script is small, there is no need to add the rm in an extra file
that needs to be checkout.

This removes an extra warning that is set in the pipeline which is noise
when monitoring.
2020-02-17 15:26:38 -05:00
Manuel de la Pena e8e826e6a3
[VSTS] Ensure that certain tasks do not run when not needed. (#7916)
If the bot could no get the provisioning profiles installed, there is no
reason for certain tasks to run since they are all going to fail. This
adds A LOT of noise in the pipeline for the monitoring person to check
when there is no reason.
2020-02-17 13:12:44 -05:00
Alex Soto ec973295b5
Replace removed dsymutil `-t` switch with `-num-threads` (#7898) 2020-02-14 15:44:19 -05:00
Manuel de la Pena dc63adf39f
[VSTS] Remove the some hardcoded vars. (#7883)
Move to use a template for the DDFun pipeline. Copy the current pipeline
to a template, set some parameters and recreate the pipeline importing
the template.
2020-02-13 13:02:44 -05:00
Rolf Bjarne Kvinge 43336779cf
[mtouch] Fix looking up satellites for root assemblies without a path. (#7871)
This may happen when a root assembly is in the current directory.

This fixes the bug-13945 test in the scripted tests.
2020-02-13 08:06:24 +01:00
Manuel de la Pena c6650dfb14
[master] Bump mono to pickup needed nunitlite changes. (#7812)
* [master] Bump mono to pickup needed nunitlite changes.

Commits are:

* [interp] context can be uninitialized for get_resume_state callback (#18535) mono/mono@455cf7d
* [2019-12] [debugger] Native thread not executing managed code considered as terminated (#18504) mono/mono@a979811
* [jit] Compute has_references correctly for gshared types whose constraint is a generic valuetype. Also emit write barriers correctly for these types. (#18562) mono/mono@f9e5a6d
* [2019-12] Bump msbuild to track mono-2019-10 (#18577) mono/mono@01be275
* [runtime] Disable lldb backtrace display on osx, it hangs on attaching in lldb. (#18591) mono/mono@ef8188a
* configure.ac: remove AC_SEARCH_LIBS for libintl (#18595)  mono/mono@e55302c
* Bump bockbuild for Pango patch 1e2d68b
* [corlib] Split corlib xunit tests even more for iOS (#18620)  mono/mono@8b72dbb
* [2019-12] [merp] MONO_DEBUG=no-gdb-stacktrace shouldn't disable MERP (#18611) mono/mono@4c93e38
* [aot] Avoid inflating gparams with byreflike types during generic sharing. (#18682) mono/mono@0011444
* Update deprecated query parameter to header (#18705) mono/mono@e65846b
* [NUnitLite] Bump nunitlite submodule. (#18733)  mono/mono@36073a0

Diff: 2edccc52a7...36073a0c74

Other commits need for this to land"


* Add a MONO define so that we get the extensions written for mono.
* Update the sources on iphone to remove the TextUI which is not used.
* BONUS: Remove an annoying warning when compiling NUnitLite
* Update the templates too which are use by xharness.
```
warning CS0659: 'ResultState' overrides Object.Equals(object o) but does not override Object.GetHashCode()
```
2020-02-07 09:56:41 -05:00
Waleed Chaudhry f85556c1e5
[mtouch] Fix tests broken by localization (#7798) 2020-02-06 11:14:10 -05:00
Manuel de la Pena 54217496ac
[VSTS] Update ddfun pipeline to upload xml results. (#7796)
Add two new steps that will ensure that the xml is uploaded to vsts.
2020-02-04 18:51:45 -05:00
Waleed Chaudhry ed16e04923
[Localization] Fix mtouch/mmp errors being referenced in mlaunch (#7784) 2020-02-03 15:19:27 -05:00