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

8782 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 558af9612a [dotnet] Add support for consuming binding projects. (#9376)
* Port the interdependent-binding-projects test to .NET (it's the simplest
  test project we have with binding projects).
* Add a lot of the shared source code for mtouch/mmp to dotnet-linker, and
  make it compile. Most issues were fixed by adding a few stubbed out classes,
  since there are large chunks of the mtouch/mmp code we're not using yet, so
  stubbing out while things are being implemented works fine.
* Add a step in dotnet-linker for loading the linker output (the linked
  assemblies) into our bundler code.
* Add another step in dotnet-linker to extract native resources from binding
  libraries.
* Augment the build process to take into account the native resources we found
  in any binding libraries.
2020-08-20 08:35:12 +02:00
Rolf Bjarne Kvinge a8291e4351 [tests] Add missing eols to a few Info.plists. 2020-08-20 08:34:07 +02:00
Rolf Bjarne Kvinge a124a1a0c7 [tests] Make sure the .NET version of the independent-binding-projects test have a unique bundle identifier.
Otherwise there could be a problem when installing a test app into the
simulator if there's already an existing app there with the same bundle
identifer, because that doesn't remove existing files, and if there are
existing files in the bundle, the app might end up crashing (in particular
there may be files in a .monotouch-32/64 subdirectory which are not removed,
and those take precedence when looking for assemblies, eventually causing a
conflict).
2020-08-20 08:33:43 +02:00
Sebastien Pouliot f8637d780a
Bump versions (well) after d16-8 branch (#9407) 2020-08-19 20:24:40 -04:00
Whitney Schmidt 2f377f0887
fix tiny typo (#9399) 2020-08-19 12:57:05 -04:00
Manuel de la Pena c20cbfe301
[DevOps] Just clean the xamarin-macios dir to ensure we do not delete maccore creds. (#9396)
The credentials for maccore are downloaded to a pat file (to be found).
When we call make git-clean, because we do use the -x options, all
files are deleted, including the pat file.

We move to call git clean -xdf inside xamarin-macios, which will delete
the test result files.

Once we find the exact path pattern, we can update the make git-clean to
not remove them but this commit unblocks the failing CI builds.
2020-08-18 15:11:59 -04:00
Rolf Bjarne Kvinge 695ca8d680 [xharness] Don't clone the same project multiple times when reached through different project references.
Problem:

1. interdependent-binding-project references binding-test and bindings-test2.
2. bindings-test2 references bindings-test.

This means bindings-test is reached through 2 projects: both
interdependent-binding-projects and bindings-test2, and previously we'd
process each of these references separately, effectively making two separate
clones of the bindings-test project.

Instead keep track of all referenced projects from the leaf project, and if we
encounter a project we've already cloned, use that directly.
2020-08-18 15:22:24 +02:00
Rolf Bjarne Kvinge b84e5e8049 [tests] Add a reference to System.Json in the interdependent-binding-projects test. 2020-08-18 11:35:42 +02:00
Rolf Bjarne Kvinge 138ebc7288 [xharness] Bump timeout for the .NET tests.
More tests take longer to run!
2020-08-17 19:59:05 +02:00
Rolf Bjarne Kvinge ea30bc9cea [xharness] Make sure MSBUILD_EXE_PATH is not set when executing dotnet.
Something ends up confused, and dotnet hangs.
2020-08-17 11:09:06 +02:00
Rolf Bjarne Kvinge 5795f11bf0 [tests] Adjust the bindings-test2 project to work with xharness.
xharness needs to inspect project files, but can't do so through imported
projects, so move some of the logic from the imported shared.csproj to the
main csproj.
2020-08-17 09:32:12 +02:00
Rolf Bjarne Kvinge d577bf7446
[mtouch] Don't validate the --target-framework argument if we're just calling mlaunch. (#9374)
This fixes an issue where mtouch would complain about a missing --target-framework argument when it's not actually needed:

    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch  --launchsim bin/iPhoneSimulator/Release/MyApp.app [...]
  	error MT0086: A target framework (--target-framework) must be specified.

what makes this worse is that passing --target-framework to mtouch makes
mlaunch fail, because mlaunch doesn't accept a --target-framework argument.
2020-08-17 08:37:29 +02:00
Přemek Vysoký b1f7bd44d9
[xharness] Do not mark DeviceLoaders as loaded when loading fails (#9367) 2020-08-17 08:27:48 +02:00
Manuel de la Pena c60759d857
[Mono] Bump to match android on 66e2b840 (#9380)
Commits:
* mono/mono@66e2b84: [aot] Fix an assert which is hit for generic instances with a lot of arguments. (#20239)
* mono/mono@d3daacd: Bump msbuild to latest commit
* mono/mono@e59c1cd: Fix Cairo issue on macOS Big Sur (#20154)
* mono/mono@648655b: [aot] Avoid a crash in generic sharing for invalid generic instances. (#20158)
* mono/mono@ec71e8a: [2020-02] Reapply "Emit DWARF debug_abbrev offset for compile units as a label instead of 0" (#20046)
* mono/mono@20bb4f9: [mono][mini] Do a non-virtual call for bound delegates (#20039)
* mono/mono@9ca6fa6: [merp] Remove dead code (#20043)
* mono/mono@2ff424b: [crashing] Improve crash chaining (#20018)

Complete diff:

mono/mono@83105ba...66e2b84

Related Android: https://github.com/xamarin/xamarin-android/pull/5014
2020-08-14 21:35:08 -04:00
Manuel de la Pena 7e7caa00a6
[Submission] Fix all the selectors that apple warns about. (#9268)
We have noticed the following message from Apple when performing
submissions with Xamarin.iOS:

> ITMS-90338: Non-public API usage - The app references non-public
> selectors in WcBc.iOS: behaviorTypes, convolutionState,
> discoverAllContactUserInfosWithCompletionHandler:,
> discoverAllContactsCompletionBlock,
> discoverUserInfoWithEmailAddress:completionHandler:,
> discoverUserInfoWithUserRecordID:completionHandler:,
> discoverUserInfosCompletionBlock, displayContact, drawableResizesAsynchronously,
> encodeToCommandBuffer:sourceImage:convolutionState:,
> encodeToCommandBuffer:sourceImage:destinationImage:state:,
> getProperty:onChannel:responseHandler:, hasProperty:onChannel:responseHandler:,
> initWithEmailAddresses:userRecordIDs:, initWithMIDIEntity:dataReadyHandler:,
> initWithZoneID:options:, initWithZoneID:subscriptionID:options:,
> isPublicDatabase, mouseUpAction, newDrawable, propertyChangedCallback,
> removeAllAppearanceStreams, replaceTextStorage:, retrieveConnectedPeripherals,
> retrievePeripherals:, setDiscoverAllContactsCompletionBlock:,
> setDiscoverUserInfosCompletionBlock:, setDrawableResizesAsynchronously:,
> setEditedMask:, setMouseUpAction:, setMovieControlMode:,
> setProperty:onChannel:responseHandler:, setPropertyChangedCallback:,
> setSocketFamily:, setTemporaryAttributes:forCharacterRange:, setUserRecordIDs:,
> sourceOffset, subscriptionOptions, takeBackgroundColorFrom:, takePasswordFrom:,
> temporalAntialiasingEnabled, userRecordIDs. If method names in your source code
> match the private Apple APIs listed above, altering your method names will help
> prevent this app from being flagged in future submissions. In addition, note
> that one or more of the above APIs may be located in a static library that was
> included with your app. If so, they must be removed. For further information,
> visit the Technical Support Information at http://developer.apple.com/support/technical/

All of them have been removed but without a break in the API excep
"initWithMIDIEntity:dataReadyHandler:" wich does look like an error on
Apples side.

Empty stubs are used as much as possible except on those cases in which
a handler is called or an output variable should be modified (buffer,
out param) to minimize the users surprise at runtime.
2020-08-14 14:53:01 -04:00
Rolf Bjarne Kvinge 184114ee3c [dotnet-linker] Propagate the verbosity elsewhere. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge b8482ca160 [dotnet] Read native linker flags from binding libraries from the managed linker. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 1d303fe856 [dotnet-linker] Add an ExtractBindingLibrariesStep.
This step will extract native libraries from binding assemblies, and adjust the native
linker flags to link with those native libraries.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge d630495a5d [dotnet-linker] Add error reporting to ConfigurationAwareStep 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 61b3cec57a [msbuild] Add support for passing -force_load to the native linker in the LinkNativeCode task. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 641a3fb4fc [msbuild] Add support for passing LinkerFlags to the LinkNativeCode task 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 6f1b1c62bb [mtouch/mmp] Make it possible to compute assembly identity even if an assembly doesn't have a filename.
In .NET AssemblyDefinitions don't have MainModule.FileName set, because they're not
loaded using FileStreams.

Ref: https://github.com/mono/linker/issues/1313
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge e83dd1071b [bundlers] Refactor code to cope with not knowing whether a particular assembly is a framework assembly or not.
Turns out we don't actually _need_ to know, in every case we use this knowledge it's
a performance improvement to not process the framework assemblies, so skip this for
now, since there's no harm done (except to the planet) to do some extra processing
by processing all assemblies in these cases.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge dd3967bfaf [dotnet-linker] Work around a linker bug where the linker won't tell us the original path of an assembly.
We need the path for several reasons, so poke into the linker using reflection to
find the information we need.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 7a446f6531 [dotnet-linker] Add a LoadNonSkippedAssembliesStep.
This step is used to load the result of the linker into our Application/Target/Assembly
instances.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge ebfc7e131c [mtouch/mmp] Simplify some code to add assemblies to a target. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 29fd334456 [dotnet-linker] Implement Application.ProductName instead of Application.GetProductName in dotnet-linker work better with the shared code. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 3046ebc1d6 [dotnet-linker] Add TargetFramework to the configuration and set Driver.TargetFramework.
This way we can use the shared Application.Platform implementation.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 17aabebb03 [dotnet-linker] Add a using so that the static registrar sees LinkContext extension methods in the Mono.Linker namespace 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 693f9423eb [dotnet-linker] Exclude Driver.Main from the build
The .NET linker code is a library, so it doesn't need a Main method.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 48620b43e7 [dotnet-linker] Stub out a few Driver members. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge e304993c3e [dotnet-linker] Stub out an Application.SelectRegistrar 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge f7d55eea24 [dotnet-linker] We don't need to stub out Application.LoadSymbols anymore. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 31f7b6f84c [dotnet-linker] Set Application.DeploymentTarget and Application.SdkVersion so that we can use the shared implementation. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge bb6e8d3f1b [dotnet-linker] Create compat API to make DerivedLinkContext compile. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge f6cf39c72b [dotnet-linker] Add a DotNetResolver.
This is just a stub to make code compile, it's not needed at runtime.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge c4186268b9 [dotnet-linker] Adjust ifdefs to make existing/shared code compile correctly. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 658d25f71e [dotnet-linker] Add a Target instance
The bundler (mtouch/mmp) code needs it to compile.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 578d84a0fd [dotnet-linker] Set Application.BuildTarget so that the shared Application.IsSimulatorBuild implementation can be used. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 08961a655b [dotnet-linker] Make Application take the input arguments, so that we can pass them to the cache to correctly determine cache validity. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 90914c1aab [dotnet-linker] Add a Constants class to the build.
The bundler (mtouch/mmp) code needs it to compile.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 0ac3879e6d [dotnet-linker] Enable unsafe code, since some of the bundler code is unsafe. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 1b093b8a7f [dotnet-linker] Include code we need from mtouch/mmp into our .NET linker code. 2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 9fddbbda58 [xharness] Enhance ResolveAllPaths to understand $(RootTestsDirectory).
This requires passing the root directory around in multiple places, since ResolveAllPaths
doesn't have access to the static class where we define the root directory.

Also call ResolveAllPaths in a few more places to ensure paths everywhere are resolved.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 5a5a53e1a9 [xharness] Add the .NET version of interdependent-binding-projects to our lineup 2020-08-14 18:33:28 +02:00
Rolf Bjarne Kvinge 98b52c7c3a [tests] Port interdependent-binding-projects to .NET. 2020-08-14 18:33:28 +02:00
Rolf Bjarne Kvinge 6186e98de8 [tests] Fix binding project file path 2020-08-14 18:33:28 +02:00
Sebastien Pouliot dafef3dfea
[tools] Fix message typo in device-tests.yml (#9373) 2020-08-14 09:02:03 -04:00
Rolf Bjarne Kvinge b28997fa8a
[xharness] Add support for getting the default AssemblyName for projects. (#9369)
In .NET projects there's a default value for most properties, which means that
there won't necessarily be an AssemblyName property in a csproj. We need to know the
AssemblyName, so calculate it from the csproj filename (which is how .NET does it).

This turned out slighly complicated, because we're pass an XmlDocument around,
and the XmlDocument doesn't know the file from where it was loaded, so we need
to keep that information separately.
2020-08-14 10:32:23 +02:00
Rolf Bjarne Kvinge 33ecd581ac
[mtouch/mmp] Move Application.BuildTarget, Application.IsDeviceBuild and Application.IsSimulatorBuild to shared code. (#9363)
Also add a 'None' build target for the BuildTarget enum for when we're
building for neither simulator nor device (i.e. macOS). This means the default
value will change (since 'Simulator' is no longer the first value), but as far
as I can tell we're always assigning a specific value and not relying on the
default, so this should not make any difference.

This will be needed when the .NET code starts using these classes.
2020-08-13 15:33:13 +02:00