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

8221 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 76fc9dc3bf
Improve our error handling code. (#8591)
* Move much of ErrorHandler.cs into a partial class in ErrorHandler.tools.cs,
  which is referenced by mtouch and mmp (but not our runtime).
* Add ErrorHandler.runtime.cs for runtime-specific bits, including a simpler
  version of ErrorHandler.Show. In particular this gets rid of the call to
  Environment.Exit, which should never happen at runtime.
* Rename MonoTouchException and MonoMacException to ProductException, which
  allows us to remove a lot of ifdefs.
* This required moving Application.LoadSymbols and Target.LoadSymbols to
  shared mtouch/mmp code.
2020-05-14 16:45:05 +02:00
Rolf Bjarne Kvinge 7ea03b8dd8
[jenkins] Hide the list of packages by default. (#8595)
* [jenkins] Hide the list of packages by default.

The list of packages got big with the NuGet packages, and we usually don't
want to see the whole thing, so hide it by default.

* Add newline to fix markdown parsing.
2020-05-14 15:47:47 +02:00
Rolf Bjarne Kvinge 048ebc047b
[src] Use the latest C# version in project files. (#8590) 2020-05-14 09:41:10 +02:00
Rolf Bjarne Kvinge 16ab321951
[tests] Remove some Classic code. (#8592) 2020-05-14 09:36:21 +02:00
Sebastien Pouliot f7b38340fd
[linker] Simplify MarkNSObject a bit (#8594)
also add a note that it's not optimal, as-is, if "Link All" is used since
it's too early to make a decision on overrides from user code, they could
be removed later (e.g. if the type is unused in the app).
2020-05-13 20:49:43 -04:00
Connor Adsit 8fc90c00e6
[Devops] Flag to disable Provisionator Cleanup (#8593) 2020-05-13 20:38:29 -04:00
Rolf Bjarne Kvinge 8f4d284ffc
[src] Only run make from csproj if the csproj isn't built from make. (#8587)
Fixes warnings like these:

           "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/src/generator.csproj" (default target) (1) ->
           (AfterBuild target) ->
             make[2] : warning : jobserver unavailable: using -j1.  Add `+' to parent make rule. [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/src/generator.csproj]
             make[2] : warning : jobserver unavailable: using -j1.  Add `+' to parent make rule. [/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/src/generator.csproj]

        2 Warning(s)
        0 Error(s)

    Time Elapsed 00:00:10.61
2020-05-13 16:54:34 +02:00
Rolf Bjarne Kvinge 3549ccf3dd
[msbuild] Inherit from Xamarin[Tool]Task instead of [Tool]Task in a most tasks. (#8582)
This makes it possible to remove a lot of duplicated code.
2020-05-13 15:44:59 +02:00
Rolf Bjarne Kvinge 76e067b47c
[mmp] Move several static Driver properties to be instance properties on the Application instance. (#8588)
* [mmp] Put the custom bundle name in the App instance.

* [mmp] Put the AOT options in the App instance.

* [mmp] Put the DisableLldbAttach and DisableOmitFramePointer options in the App instance.

* [mmp] Remove Driver.Registrar and use App.Registrar instead.
2020-05-13 15:35:20 +02:00
Rolf Bjarne Kvinge 5834572741
Create and publish .NET NuGet packages. (#8576)
Create the various NuGet packages to support .NET 5+. The packages are
currently empty (and not very useful), but the actual content will come later.

The current set of NuGet packages are (this list is duplicated for each
platform: iOS, tvOS, watchOS and macOS):

* Microsoft.iOS.Sdk: currently contains the basic MSBuild targets files for an
  MSBuild Project SDK. Will eventually contain all the build logic. Might also
  eventually contain other tools (mlaunch, bgen, etc.), but these might also
  end up in a different package.
* Microsoft.iOS.Ref: will contain the Xamarin.iOS.dll reference assembly.
* Microsoft.iOS.Runtime.[RID]: will contain architecture-specific files
  (libxamarin*.dylib, the Xamarin.iOS.dll implementation assembly, etc.):

The NuGets built on CI are automatically published to a NuGet feed.

The versioning for the NuGet packages required a few changes: OS bumps are now
changed in Make.versions instead of Make.config (this is explained in the
files themselves as well).
2020-05-13 15:23:29 +02:00
Rolf Bjarne Kvinge bf201c105e
[ObjCRuntime] Remove unused 'using'. (#8589) 2020-05-13 15:19:01 +02:00
Manuel de la Pena 1e78ea4d07
[Devops] Do link xcode to the expected path. (#8586) 2020-05-13 09:18:29 -04:00
Rolf Bjarne Kvinge 3e1862ada9
[mtouch/mmp] Make --setenv available to mmp as well. (#8572)
The actual implementation will be added in a later PR, when the code to
generate main is unified between mtouch and mmp.
2020-05-13 08:50:20 +02:00
Rolf Bjarne Kvinge 5f786dead4
[builds] Fix generation of the smcs script. (#8581)
This regressed in c517281f1c.
2020-05-13 08:49:26 +02:00
Rolf Bjarne Kvinge df2b5363b9
[mtouch] Validate the abi earlier. Fixes #xamarin/maccore@2222. (#8571)
This fixes this mtouch unit test:

    Xamarin.MTouch.Architectures_TVOS_Invalid : The error 'MT0075' was not found in the output.

because now we show MT0075 ("Invalid architecture 'ARMv7' for TVOS projects.")
as expected instead of failing to locate the 32-bit platform directory for
tvOS (which doesn't exist).

Fixes https://github.com/xamarin/maccore/issues/2222.
2020-05-13 08:41:59 +02:00
Rolf Bjarne Kvinge a4910bb0fa
[mtouch/mmp] Share --package-debug-symbols. (#8574) 2020-05-13 08:40:07 +02:00
Rolf Bjarne Kvinge 82c146bbd4
[system-dependencies] Add support for provisioning .NET 5 separately. (#8578)
* [system-dependencies] Add support for provisioning .NET 5 separately.

Add support for provisioning .NET 5 separately, and by default install it
locally (into builds/downloads) to avoid consuming a lot of disk space with
the various preview versions we'll need. A system install is still detected
and used if available.

* Use full path to the dotnet binary, since it might not be in PATH.

* [jenkins] Clean first, then provision.

Otherwise we'll clean whatever we provision locally.
2020-05-13 08:31:40 +02:00
Manuel de la Pena edb4fe8d27
[Harness] Move GitHub to be a VCS interface to simplify testing. (#8579)
Move to be a non static class so that we can later easily test the
TestSelector class.
2020-05-12 16:14:40 -04:00
Alex Soto 06871ab24f
[Tests] Use safe listed password by our Credentials Scanner tool (#8580) 2020-05-12 14:02:16 -04:00
Rolf Bjarne Kvinge abfb9f2179
[msbuild] Make the DeleteBase task inherit from the Delete task. (#8577)
Once upon a time the Delete task was sealed [1], so we couldn't subclass it as
we wanted. That time is long in the past, so we can now do what we wanted back
then.

[1]: 5c49171303
2020-05-12 17:47:17 +02:00
Manuel de la Pena 9f380e257e
[Devops] Move to use provisionator to get xcode. (#8570)
Move to use the provisionator and add a make file to generat the script
so that we only have to bump xcode in a single place.

Move all deps to provisionator and make provisionator download and
install the xi pkg that has been built to be tested in the pipeline, we
do not longer use curl to do it.
2020-05-12 10:59:53 -04:00
Rolf Bjarne Kvinge 29dc484922
Make makefiles compatible with make 4.3. (#8573)
In make 4.3 the pattern `.libs/watchos/%.arm64_32.dylib` in mk/rules.mk takes
precedence over the pattern `.libs/watchos/libtest.%.dylib` in
tests/test-libraries/Makefile when the pattern replacements are 'libtest' and
'arm64_32' respectively, because the former is shorter.

This seems to be a bug (in make 3.81) that has been fixed, because that's the
documented behavior.

Rewrite the logic to not use a pattern target in test/test-libraries/Makefile.
2020-05-12 16:38:05 +02:00
Rolf Bjarne Kvinge 570f5ad8a3
[mtouch/mmp] Rework the project files. (#8575)
* Files outside the project directory now show up with a much more logical
  name in the IDE. External files have a link target which is relative to the
  root xamarin-macios directory, and files included from the mono archive show
  up as such as well.
* Rename a few mtouch/mmp-specific files to contain 'mtouch' or 'mmp' in the
  filename, to avoid having multiple files in the projects with the same name
  (it's confusing every time you search for a filename in the IDE and get
  multiple filenames where only the directory is different).
* Add a tools.sln that contains only the mtouch and mmp projects. This makes
  it easier to work with both mtouch and mmp and the same time, while not
  making VSfM unbearably slow by loading many projects in the same solution.
2020-05-12 16:37:43 +02:00
Rolf Bjarne Kvinge 3ce9ac43d8
[mtouch/mmp] Share the mono native code. (#8564)
Also move the mono native code to the Application class from the Target
class, since it's per-Application, not per-Target.
2020-05-12 12:10:50 +02:00
Rolf Bjarne Kvinge 5193dfbf9a
[mtouch/mmp] Share --debugtrack code. (#8565) 2020-05-12 09:20:53 +02:00
Rolf Bjarne Kvinge 3d2981c130
[mtouch/mmp] Share Application.MonoGCParams. (#8566) 2020-05-12 09:20:20 +02:00
Sebastien Pouliot 6c3669f196
[mtouch] Add -d:DEBUG to .csproj Debug configuration (#8567)
otherwise debug won't work and you'll get a weird error

```
Using Xcode 11.4 (11E146) found in /Applications/Xcode114.app/Contents/Developer
Xamarin.iOS 13.21.0.154 (master): 296eabd9a using framework: /Applications/Xcode114.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk
A full rebuild will be performed because the cache is either incomplete or entirely missing.
A full rebuild has been forced because the cache for linker is not valid.
error MT2006: Can not load mscorlib.dll from: '/Users/poupou/git/master/xamarin-macios/tools/mtouch/lib/mono/Xamarin.iOS/mscorlib.dll'. Please reinstall Xamarin.iOS.

  at Xamarin.Bundler.Target.Initialize (System.Boolean show_warnings) [0x0002c] in /Users/poupou/git/master/xamarin-macios/tools/mtouch/Target.cs:275
  at Xamarin.Bundler.Application.Initialize () [0x007c2] in /Users/poupou/git/master/xamarin-macios/tools/mtouch/Application.cs:1104
  at Xamarin.Bundler.Application.BuildInitialize () [0x00008] in /Users/poupou/git/master/xamarin-macios/tools/mtouch/Application.cs:684
  at Xamarin.Bundler.Application+<>c.<BuildAll>b__135_0 (Xamarin.Bundler.Application v) [0x00000] in /Users/poupou/git/master/xamarin-macios/tools/mtouch/Application.cs:638
  at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x0001e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:578
  at Xamarin.Bundler.Application.BuildAll () [0x00023] in /Users/poupou/git/master/xamarin-macios/tools/mtouch/Application.cs:638
  at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x0041c] in /Users/poupou/git/master/xamarin-macios/tools/mtouch/mtouch.cs:1154
  at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /Users/poupou/git/master/xamarin-macios/tools/common/Driver.cs:35
```
2020-05-11 19:40:44 -04:00
Sebastien Pouliot 1d45792e5b
[linker] Remove internal [NullablePublicOnly] attribute from apps (#8568)
I've only seen it with .net5 so far but it's better handled in master
and flow back into the branch
2020-05-11 19:39:43 -04:00
Daniel Cazzulino 544938e5df
Update CODEOWNERS
Removing @kzu as code owner for /msbuild
2020-05-11 12:30:25 -03:00
Rolf Bjarne Kvinge ea25433d75
[mtouch/mmp] Share EnableProfiling. (#8563) 2020-05-11 16:42:21 +02:00
Rolf Bjarne Kvinge b18466f7f2
[mtouch/mmp] Share Abi code. (#8562) 2020-05-11 16:27:19 +02:00
Manuel de la Pena 52afa11bbd
[Harness] Fix broken tests. (#8551)
Tests are not ran as part of the CI and got borken again. Fix them, will
add them as part of the CI once they land fixed.
2020-05-11 09:52:24 -04:00
Sebastien Pouliot 3c263b0527
[linker] Fix RemoveAttributes pre-check (#8554)
The current check made the elimination of `[System.CLSCompliant]`
impossible.
2020-05-11 08:40:48 -04:00
Rolf Bjarne Kvinge 024538e1ba
[jenkins] Don't show multiple identical failed stages. (#8560) 2020-05-11 14:27:55 +02:00
Rolf Bjarne Kvinge e9cd70e085
[mtouch] Fix path to simlauncher.mm in project file. (#8561) 2020-05-11 14:27:48 +02:00
Rolf Bjarne Kvinge a8d9e2a67b
[ObjCRuntime/NSObject] Remove dead Classic code. (#8550) 2020-05-11 08:58:03 +02:00
Rolf Bjarne Kvinge 44653d7553
[mtouch/mmp] Share the RegistrarMode enum. (#8553) 2020-05-11 08:57:41 +02:00
Rolf Bjarne Kvinge 1457f8666d
[jenkins] Add support for specifying custom labels using a file. (#8549)
This makes it possible to select what should be done on CI when building a
commit on internal Jenkins (as opposed to when building a pull request, in
which case labels can be set on the pull request).
2020-05-08 15:44:41 +02:00
Rolf Bjarne Kvinge 2926083d20
[runtime/mmp] Put libxammac and xamarin headers for Xamarin.Mac in the same directory as the corresponding files for Xamarin.iOS. (#8542)
That's in /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/SDKs/Xamarin.macOS.sdk/[lib|include]

This allows for a bit more code share between mtouch and mmp.
2020-05-08 13:04:32 +02:00
Rolf Bjarne Kvinge f53fd82291
[mtouch] Introduce helper function for getting the architecture-specific directory where the platform assembly is. (#8537)
This removes a little bit of duplicated code.
2020-05-08 09:17:55 +02:00
Manuel de la Pena 0664584f4b
[Harness] Rollback change to use full path. (#8546)
The GetReader from the install log is broken and requires a re-eng.
Rollback to using the fullpath, not as nice, but that way we do not have
exceptions.

We are using issue #8545 to track the actual bug in the logs when we
request a Reader, if the reader cannot be created we should not be
throwing an exception, whats more, that reader should not be null since
otherwise we would not get the install logs.
2020-05-07 20:18:15 -04:00
Manuel de la Pena 8d08ad2ce3
[Foundation] Do not get in an infinite loop with empty creds. (#8543)
* [Foundation] Do not get in an infinite loop with empty creds.

As decribed in the issue, when the credentials for the base auth are set
to be empty the request reaches a timeout.

The inner issue is that when we have empty credentials the query that
is performed to the credentials db of the system throws an exception.
This exception is not raised to our code, but simply prints out in stderr.

When this situation occurs we get in an infinite loop in which we keep
sending the same credentials, we get another challenge, but the OS does
not do the right thing, we believe that we have to provide the creds
again (which are the same) and we get another challenge.. this goes on
an on until we reach the timeout.

Fortunately we know the number of failed challenges and the failure
response. With this information we can deduce if we already sent the
credentials, and if we did, do not set them again. In this case, the OS
sees no credentials in out delegate, uses the default handler and
correctly returns a 401.

fixes: https://github.com/xamarin/xamarin-macios/issues/8342
fixes: https://github.com/xamarin/xamarin-macios/issues/8344
2020-05-07 18:25:26 -04:00
Jonathan Peppers 666059f289
[msbuild] add System.Drawing.Common ref for bindings (#8528)
Fixes: https://github.com/xamarin/xamarin-macios/issues/8265

Usage of `System.Drawing` types in iOS binding projects are failing with:

    error CS1069: The type name 'Color' could not be found in the namespace 'System.Drawing'.
    This type has been forwarded to assembly 'System.Drawing.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
    Consider adding a reference to that assembly.

In 3a7bdc0, an `_AddExtraReferences` MSBuild target was added for iOS
and Mac projects, but mistakenly missing from binding projects.

I moved the `_AddExtraReferences` target to `Xamarin.Shared.targets`,
so it will be used for all project types.

I also updated a test, I could merely use `System.Drawing.Color` in
`StructsAndEnums.cs` to reproduce the failure.
2020-05-07 15:27:06 -05:00
Rolf Bjarne Kvinge 0e03a929e4
Merge pull request #8541 from rolfbjarne/linker-no-constructor
[linker] Don't pass information to linker steps by selectively creating them or using constructors.

Instead use the built-in logic to determine if a linker step should light up,
and use information available in the LinkContext to determine how steps should
behave.

This is required for .NET, where linker steps can't have custom constructors.

Several steps have not been modified, because they're not all required in .NET.
2020-05-07 18:18:57 +02:00
Rolf Bjarne Kvinge 0511006ec2
[mtouch/mmp] Introduce more specific helper functions for locating libxamarin*.dylib and Xamarin*.framework. (#8538)
This allows a little bit more sharing between mmp and mtouch.
2020-05-07 16:20:07 +02:00
Rolf Bjarne Kvinge d884c2a2c7 [linker] We don't need to pass the linker options to create sub steps anymore. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 17ac227fb3 [linker] Stop passing data to the OptimizeGeneratedCode steps using a constructor. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge d5aaa964e1 [linker] Stop passing data to the RemoveUserResources sub step using a constructor. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 41abc3af77 [linker] Always create the RemoveCode step, and instead detect if it should be active using the LinkContext field. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 196ea91a72 [linker] Always create the CoreRemoveSecurity step, and instead detect if it should be active using the LinkContext field. 2020-05-07 15:51:38 +02:00