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

11414 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 46afe81149
[dotnet] Add support for 'dotnet publish'. Fixes #11807. (#12397)
* Add support for 'dotnet publish'.
* Add support for a 'PkgPackagePath' for macOS and Mac Catalyst, an MSBuild
  property to specify the resulting .pkg path, to reflect the existing
  'IpaPackagePath' (for iOS and tvOS).
* Fix MSBuild logic that uses 'IpaPackagePath'. Looks like nobody has ever
  used this...
* Add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/11807.
2021-08-11 10:01:16 +02:00
Rolf Bjarne Kvinge 104ab12bdd
[dotnet/msbuild] Fix publishing user frameworks and dynamic libraries from binding projects. (#12396)
We extract frameworks from third-party libraries when running the linker, and
we need to store this information on disk and the reload it after the linker
has executed, and add it to the existing MSBuild variables that keep track of
the user frameworks and dynamic libraries that have to be copied to the app
bundle.

Fixes the framework-test tests.
2021-08-11 09:58:00 +02:00
Rolf Bjarne Kvinge 5b23ea83b1
[monotouch-test] Use unique file names to avoid issues when multiple proceseses of monotouch-test are running simultaneously. Fixes #xamarin/maccore@2461. (#12395)
Fixes https://github.com/xamarin/maccore/issues/2461.
2021-08-11 09:52:02 +02:00
Rolf Bjarne Kvinge 5e35f80677
[src] Define __MACOS__ for macOS builds. (#12385)
This also meant I had to remove Obsolete attributes when there's an existing
Obsoleted attribute.

For .NET we'll generate an Obsolete attribute from any Obsoleted attribute,
and if there already are any Obsolete attributes as well, then this happens:

    build/dotnet/macos/generated-sources/Intents/INCallCapability.g.cs(49,3): error CS0579: Duplicate 'Obsolete' attribute
    build/dotnet/macos/generated-sources/Intents/INCallCapabilityOptions.g.cs(50,3): error CS0579: Duplicate 'Obsolete' attribute
    build/dotnet/macos/generated-sources/Intents/INCallDestinationType.g.cs(50,3): error CS0579: Duplicate 'Obsolete' attribute
    build/dotnet/macos/generated-sources/Intents/INCallRecordTypeOptions.g.cs(50,3): error CS0579: Duplicate 'Obsolete' attribute
    [...]

So avoid this by removing any Obsolete attributes when there's also an
Obsoleted attribute.
2021-08-11 09:49:18 +02:00
Manuel de la Pena 0d5d94da41
[OSLog] Add support for xcode13 beta4. (#12392) 2021-08-10 23:12:16 -04:00
Sebastien Pouliot 32e1381ee1
[src] Ensure complete (error) coverage for nullability warnings (#12401)
Use the _recent_ [1] `nullable` to ensure we treat all nullable warnings
as errors. That list can (and has) change[d] over time...

Fix one case, `CVTime`, that was (only) a warning in our build.

Also fix `Makefile` so we are not giving the `warnaserror` for nullable
to the generator. It does not use them (different codes) and does not
accept string values (which breaks the build). IOW it's the generated
code that must be nullable-aware, not the input to the generator.

[1] https://github.com/dotnet/roslyn/issues/41605
2021-08-10 17:38:28 -04:00
Sebastien Pouliot a20d417bf7
[dotnet][linker] Enable the sealer optimization (#12009)
when (by default)
* the interpreter is not enabled (since new code might subclass or override the members analyzed at build time)
* building for release

Reverts c56b893b68
Fix https://github.com/xamarin/xamarin-macios/issues/9573

Notes

* Even if possible (in metadata) there is no point in setting `final` on
a method if we remove `virtual`. This match ILLink version of the sealer
and makes the same test pass on both.

* Don't apply optimization on non-AOT builds, e.g. simulators, since some
features (like XML serialization) checks for
`RuntimeFeature.IsDynamicCodeSupported` and that requires some types
to be subclassed thru SRE
2021-08-10 16:01:30 -04:00
Sebastien Pouliot 300fc28360
[msbuild] Set `UseSecureTimestamp` inside `_CodesignFrameworks` too (#12387)
That's needed for Xamarin.Mac and was _lost_ when the task was merged
between XI and XM.

Fixes https://github.com/xamarin/xamarin-macios/issues/11784
2021-08-10 10:39:08 -04:00
Manuel de la Pena 687b3b9d08
[SystemConfiguration] Add support for xcode13 beta4. (#12393) 2021-08-10 10:16:05 -04:00
Manuel de la Pena c5573db360
[OpenGL] Add support for xcode 13 beta4. (#12394) 2021-08-10 10:15:34 -04:00
Rolf Bjarne Kvinge 9273704267
[xtro] Ignore Obsoleted enums in EnumCheck. (#12390)
Treat [Obsoleted] enums as [Obsolete] enums: ignore them. This makes it
possible to remove a few ignored entries.
2021-08-10 13:40:25 +02:00
Rolf Bjarne Kvinge 7b286adb47
[tests] Add a .NET version of framework-test to our test list. (#12373) 2021-08-10 07:40:00 +02:00
Rolf Bjarne Kvinge 15ace257ab
[msbuild] Delete any Mono crash dump files in the root app bundle before codesigning. Fixes #12320. (#12332)
This is what happens:

1. Mono will write crash dumps in the current directory:
   57bfe47451/src/mono/mono/utils/mono-state.c (L302-L322)
2. The current directory is by default the root of the app bundle.
3. If there are any files in the root of the app bundle for macOS or Mac
   Catalyst, 'codesign' will fail ("unsealed contents present in the bundle
   root").

This leads to the following sequence of events:

1. App developer builds & runs a Mac Catalyst app.
2. The app crashes for some reason.
3. Mono creates a crash dump (in the root directory of the app bundle).
4. The app developer changes something in the project and tries again.
5. The build fails, because 'codesign' fails.

Avoid this by deleting any crash dump files from the root of the app bundle
before signing the app.
2021-08-10 07:39:00 +02:00
VS MobileTools Engineering Service 2 7dc6c9cffd
Localized file check-in by OneLocBuild Task (#12380) 2021-08-09 23:23:55 -04:00
Manuel de la Pena ae77aed7e8
[Security] Add Xcode 13 beta 4 support. (#12365) 2021-08-09 21:30:14 -04:00
Sebastien Pouliot 9307052231
[objcruntime] Enable nullable on `ErrorHelper` and `RuntimeException` (#12377)
also avoid intermediate/chained calls to help the linker eliminate
some methods
2021-08-09 10:36:56 -04:00
Sebastien Pouliot cffd57d681
[cecil] Update all package references to the latest 0.11.4 (#12379) 2021-08-09 10:18:16 -04:00
Rolf Bjarne Kvinge 6232edc9ed
[monotouch-test] Ignore ReadingListTest.DefaultReadingList. (#12383)
This test adds entries to the global reading list in Safari, and there's no
API for the test to clean up after itself, so the reading list becomes an
endless list of entries after a whlie.

Beside the fact that this is somewhat annoying for people who actually use
their reading lists, it can also can end up consuming a significant amount of
space on the hard drive, because Safari will download each site to be
available offline.
2021-08-09 14:51:44 +02:00
Rolf Bjarne Kvinge d7a4d894d8
[msbuild] Fix the inclusion of the mtouch errors in the Xamarin.MacDev.Tasks.Core assembly. (#12360)
Otherwise we'll end up showing a MissingManifestResourceException whenever we
try to show any of the mtouch errors from the msbuild targets.
2021-08-09 14:43:22 +02:00
Rolf Bjarne Kvinge baaa08eb00
[tests] Fix typo in error message. (#12370) 2021-08-09 09:49:51 +02:00
Rolf Bjarne Kvinge 4371133cf7
[dotnet] Remove workaround for private symbols for AOT. (#12334)
* [dotnet] Remove workaround for private symbols for AOT.

* [tools] Make Application.AotArguments a list of string.

This is just a simple refactoring to make Application.AotArguments a list of
strings instead of a comma-separated list of values.

* [tools] Only use direct-icalls when linking mono statically.

Ref: https://github.com/dotnet/runtime/issues/55000

* [mtouch] Fix aot arguments comparison.

* [tests] Adjust mtouch test according to mtouch changes.

* [tests] Add minimum OS version to the Mac Catalyst variation of the MySimpleApp test case.
2021-08-09 09:45:58 +02:00
Sebastien Pouliot ecad9d9667
[tests][intro] Fix Phase tests on macOS 12 and iOS devices (#12376)
It's a `Phase` vs `PHASE` lookup that make the tests checking for
fields fail.

```
FieldExists: 3 errors found in 6603 fields validated: PHASESpatialCategoryDirectPathTransmission, PHASESpatialCategoryEarlyReflections, PHASESpatialCategoryLateReverb
```
2021-08-06 16:28:04 -04:00
Manuel de la Pena 1330597435
[NearbyInteraction] Convert spaces to tabs. (#12364) 2021-08-06 15:18:19 -04:00
Rachel Kang e45969fb08
Merge pull request #12337 from rachelkang/xcode13.0-quicklook-b1-b2-b3-b4
[QuickLook] Update bindings for Xcode 13.0 beta 1,2,3,4
2021-08-06 12:27:08 -04:00
Sebastien Pouliot 22ccf2e81b
[generator] Use new `CFArray.StringArrayFromHandle` instead of the existing `NSArray` API (#12368)
This is another example that p/invokes are much faster than calling
selectors.

Beside the generator the manual bindings were updated to use the newer
API and the old one was decorated as `[Obsolete]`.

|                        Method |          name |                value |            Mean |           Error |        StdDev |
|------------------------------ |-------------- |--------------------- |----------------:|----------------:|--------------:|
| CFArray_StringArrayFromHandle |         empty |                   () |        123.9 ns |        68.92 ns |       3.78 ns |
| NSArray_StringArrayFromHandle |         empty |                   () |      1,422.6 ns |        25.83 ns |       1.42 ns |
| CFArray_StringArrayFromHandle |           few |    (  (...).") [108] |      1,885.2 ns |        46.37 ns |       2.54 ns |
| NSArray_StringArrayFromHandle |           few |    (  (...).") [108] |      8,530.0 ns |       594.40 ns |      32.58 ns |
| CFArray_StringArrayFromHandle | large_mutable |    ((...)) [8419330] | 15,821,101.0 ns | 4,803,631.19 ns | 263,303.23 ns |
| NSArray_StringArrayFromHandle | large_mutable |    ((...)) [8419330] | 22,823,871.9 ns | 6,589,380.43 ns | 361,186.18 ns |
| CFArray_StringArrayFromHandle |       mutable |   (   (...)9e") [54] |        867.4 ns |        59.23 ns |       3.25 ns |
| NSArray_StringArrayFromHandle |       mutable |   (   (...)9e") [54] |      4,939.6 ns |       203.28 ns |      11.14 ns |

note: `NSArray.StringArrayFromHandle` was already using (p/invoke-based)
`CFString.FromHandle` instead of (selector-based) `NSString.FromHandle`
to create the managed `string` instances inside the `string[]`.
2021-08-06 09:17:48 -04:00
Emanuel Fernandez Dell'Oca 78cc290613
[net6] Fixes LinkNativeCode task execution from Windows (#12367)
This is an improvement on how we detect if the file that is going to be copied to the Mac is coming from the output path or not. Copying files from the Windows output dir to the Mac will make the build fail.

There were two problems:
- The paths we were comparing could contain different path separators.
- The item we are trying to copy may be in a folder that is inside the output dir.

For example:
- OutputFile = `obj\Debug\net6.0-ios\iossimulator-x64\nativelibraries/Foo`
- Item to copy: `obj/Debug/net6.0-ios/iossimulator-x64/nativelibraries/aot-output/x86_64/System.Private.CoreLib.dll.o`
2021-08-06 10:45:09 +02:00
Emanuel Fernandez Dell'Oca ff56f32c77
[net6] Stops replacing custom linker steps on Windows (#12362)
The `_AdditionalTaskAssembly` prop was already fixed by 7c66aa3829, so we don't need to do this anymore. This breaks building from Windows because we're missing custom steps.

I missed adding this file to that commit.
2021-08-06 10:25:33 +02:00
Rolf Bjarne Kvinge 6d078c2ac8
[tests] Add debug spew to track down #xamarin/maccore@2414. (#12354) 2021-08-06 09:45:55 +02:00
Rolf Bjarne Kvinge b06baea3c8
[tests] Merge the Main function into the AppDelegate class in numerous tests. (#12356)
Also use a non-obsolete overload of UIApplication.Main.

This shrinks our code and file count a bit.
2021-08-06 09:44:58 +02:00
Rolf Bjarne Kvinge 8abe5f8188
Bump maccore. (#12358)
New commits in xamarin/maccore:

* xamarin/maccore@49c78df930 Fixes for msbuild.zip creation (#2483)
* xamarin/maccore@2fc29b2c02 [mlaunch] Create a binlog when building mlaunch. (#2485)

Diff: e14b89f9eb..49c78df930
2021-08-06 09:34:48 +02:00
Rolf Bjarne Kvinge 013054a48c
[tests] Add .NET version of the fsharp test. (#12359)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/10217.
2021-08-06 09:29:30 +02:00
Sebastien Pouliot 77defde89e
[corefoundation] Fix minimum version on MacCatalyst (#12361)
There's no need in having availability attributes for versions earlier
than the current minimum.

Re-enable the `Introduced` test for _legacy_ Catalyst as it's fine since
it use the older attributes. It's still not possible to enable it for
`NET` until all manual bindings are updated.
2021-08-05 19:19:26 -04:00
Manuel de la Pena 244232d52d
[NearbyInterction] Add support for xcode 13 beta 4. (#12351) 2021-08-05 15:29:00 -04:00
Rachel Kang 75ac7eb7b4
Add comment about NoPlatform availabilities 2021-08-05 11:12:01 -04:00
Rachel Kang cae72a9fa7
Update based on feedback 2021-08-05 10:47:56 -04:00
Rachel Kang 5b72769db2
Merge branch 'main' into xcode13.0-quicklook-b1-b2-b3-b4 2021-08-05 10:03:43 -04:00
Manuel de la Pena 0ffed970d6
[NetworkExtension] Add Xcode 13 beta 4 support. (#12352) 2021-08-05 09:41:43 -04:00
Sebastien Pouliot 9844af75f8
[foundation] Enable nullable for `MonoTouchException` (#12350)
and avoid potential `NullReferenceException` in some code paths.

Also remove multiple string concatenations by using `StringBuilder`
2021-08-05 09:28:09 -04:00
Mauro Agnoletti 9dbf451d39
Added Hot Restart support into the SDK (#12293)
- Added Hot Restart support for net6
- Added Hot Restart content into the Windows iOS pack

Co-authored-by: emaf <ema@xamarin.com>
2021-08-05 09:19:51 +02:00
dotnet-maestro[bot] 2507d92588
Update dependencies from https://github.com/dotnet/installer build 20210803.66 (#12345)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rc.1.21402.7 -> To Version 6.0.100-rc.1.21403.66

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-08-05 08:31:51 +02:00
Rolf Bjarne Kvinge 576dbb9b35
[msbuild/dotnet] Don't overwrite the 'CreateAppBundleDependsOn' property, only add to it. Fixes #12325. (#12346)
Fixes https://github.com/xamarin/xamarin-macios/issues/12325.
2021-08-05 08:17:44 +02:00
Rolf Bjarne Kvinge fb63f2388a
[runtime] Add support for logging exceptions that go through exception marshalling using an environment variable. Fixes #12343. (#12344)
Setting the XAMARIN_LOG_MARSHALLED_EXCEPTIONS environment variable will now
make us print all exceptions that go through exception marshalling, and how
we'll handle them.

Fixes https://github.com/xamarin/xamarin-macios/issues/12343.
2021-08-05 08:17:20 +02:00
Manuel de la Pena 818198b789
[MLCompute] Add support for Xcode 13 beta 4. (#12348) 2021-08-05 01:02:27 -04:00
Manuel de la Pena 41253c3636
[ModelIO] Add Xcode 13 beta4 support. (#12349) 2021-08-04 22:40:05 -04:00
Manuel de la Pena 9aef167b19
[PHASE] Add suppport for Xcode13 beta 2. (#12098) 2021-08-04 22:38:03 -04:00
Sebastien Pouliot fa5f323c88
[tests][intro] Fix protocol results for macOS 12 beta (#12347)
IOW move some custom checks from iOS to the base class that also
covers macOS.
2021-08-04 16:40:14 -04:00
Rolf Bjarne Kvinge a91e34f01b
[xharness] Automatically inline Imports to a "shared.csproj" when cloning projects. Fixes #12316 and #12277. (#12322)
This way we process the shared.csproj that we use in our .NET test projects.
The main effect is that we'll clone any project references included in the
shared.csproj, which will fix #12316. On another hand, it means that we'll
add/remove defines in referenced projects, which fixes #12277.

It also allows us to put more code in the "shared.csproj" files.

Fixes https://github.com/xamarin/xamarin-macios/issues/12316.
Fixes https://github.com/xamarin/xamarin-macios/issues/12277.
2021-08-04 18:13:02 +02:00
Rachel Kang 142e71780a
[QuickLookThumbnailing] Update bindings for Xcode 13.0 beta 1 (#12338) 2021-08-04 10:12:56 -04:00
Manuel de la Pena 62eec286db
[MetricKit] Add support for Xcode 13 beta4. (#12326)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-08-04 10:12:29 -04:00
TJ Lambert 68a5091cfa
[AuthenticationServices] Updates for Xcode13 Beta3 (#12203)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-08-04 10:11:26 -04:00