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

15550 Коммитов

Автор SHA1 Сообщение Дата
Git History Editor a1410ac7fa [static registrar] Refactor code to make it easier to reuse code later on.
There are no functional changes here, just refactoring to make code easier to re-use.
2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge e66f82d5fc [static registrar] Refactor code to make it easier to reuse code later on.
There are no functional changes here, just refactoring to make code easier to re-use.
2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge 872af5d9e1 [static registrar] Refactor code to make it easier to reuse code later on.
There are no functional changes here, just refactoring to make code easier to re-use.
2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge 3ac9b8fc76 [xharness] Add new variations using the managed static registrar for monotouch-test. 2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge 4351674beb [dotnet-linker] Add a way for ConfigurationAwareStep subclasses to return exceptions.
Without having to throw them.
2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge eb01507dd6 [dotnet-linker] Unify exception handling to go through the LinkerConfiguration.Report method.
Since LinkerConfiguration.Report uses the trimmer's API to report warnings and errors.
2023-05-11 12:16:48 +02:00
Rolf Bjarne Kvinge 9e112978fd [dotnet-linker] Don't fail trimming if all the exceptions we collect are warnings. 2023-05-11 12:16:48 +02:00
Rolf Bjarne Kvinge 7c7637ee75 [dotnet-linker] Reduce a bit of code duplication.
There are no functional changes here, just code simplification.
2023-05-11 12:16:48 +02:00
Rolf Bjarne Kvinge 527cba2382 [docs] Document the managed static registrar. 2023-05-11 12:16:48 +02:00
Rolf Bjarne Kvinge 69eb2755b5
[tests] Ignore a network failure condition on bots in the LinkSdk.AsyncTests.Bug12221 test. (#18252) 2023-05-11 07:28:38 +02:00
Rolf Bjarne Kvinge 792a223c37
[autoformat] Fix running sed on Linux. (#18254)
The autoformat action doesn't necessarily run on macOS, and sed's syntax is
different between macOS and Linux - so make sure to cope with these
differences.

Also execute the nullability fixes in a separate subshell to not interfere
with the rest of the script.

This fixes an issue where autoformat would fail with:

    + sed -i '' -e 's/!= null/is not null/g' -e 's/== null/is null/g' builds/fix-maccatalyst-assembly/Program.cs
    sed: can't read : No such file or directory
2023-05-11 07:27:47 +02:00
Manuel de la Pena 34b2b9466f
[CI] Disable the config detection in prs too. (#18153)
We do the same in the ci yaml already.
2023-05-10 18:43:03 -04:00
Rolf Bjarne Kvinge 199b43e2d9
[monotouch-test] Ignore network failures in CI for SecProtocolMetadataTest.TlsDefaults. Fixes #xamarin/maccore@2040. (#18255)
Fixes https://github.com/xamarin/maccore/issues/2040.
2023-05-10 11:04:53 +02:00
Rolf Bjarne Kvinge f358715a38
[xharness] Use our own SetProperty to set properties instead of the SetTopLevelPropertyGroupValue extension method. (#18253)
This is because the SetTopLevelPropertyGroupValue method doesn't always
work as expected (it doesn't always set seomthing), while SetProperty does.

Fixing the SetTopLevelPropertyGroup method is somewhat complex, since it
lives in the dotnet/xharness repository, so instead use the SetProperty
method, which is our own (working) version.
2023-05-10 10:53:53 +02:00
Filip Navara 7d8fa7fa41
Fix nullability of WebView.EditingDelegate (#18247)
Note that both the headers and the documentation are incorrect in this case. All of the `WebView.*Delegate` objects are documented as non-nullable, but in all cases it's wrong. The binding for the other `Delegate`s allows `null`s in Xamarin.

Failure to remove the `EditingDelegate` reference may result in a crash when the `WebView` object gets disposed:
```
16  xamarin_release_managed_ref + 108 (eM Client + 63772) [0x100ecf91c]
  16  -[Xilium_CefGlue_CefWebView release] + 32 (eM Client + 116128) [0x100edc5a0]
  16  xamarin_invoke_objc_method_implementation + 140 (eM Client + 73400) 
[0x100ed1eb8]
  16  -[WebView dealloc] + 112 (WebKitLegacy + 166520) [0x1ccf72a78]
  16  -[WebView(WebPrivate) _close] + 364 (WebKitLegacy + 167048) [0x1ccf72c88]
  16  WebCore::FrameLoader::detachFromParent() + 48 (WebCore + 628864) [0x1d248f880]
  16  WebCore::FrameLoader::closeURL() + 244 (WebCore + 26226672) [0x1d3cf8ff0]
  16  WebEditorClient::clearUndoRedoOperations() + 52 (WebKitLegacy + 102060) 
[0x1ccf62eac]
  16  -[WebView(WebViewEditing) undoManager] + 72 (WebKitLegacy + 153444) 
[0x1ccf6f764]
  16  _CF_forwarding_prep_0 + 96 (CoreFoundation + 408816) [0x1b6993cf0]
  16  ___forwarding___ + 1004 (CoreFoundation + 410012) [0x1b699419c]
  16  objc_opt_respondsToSelector + 48 (libobjc.A.dylib + 185536) [0x1b67944c0]
  7   PAL_DispatchExceptionWrapper + 16 (libcoreclr.dylib + 262040) [0x102db7f98]
```
2023-05-09 22:59:46 +02:00
VS MobileTools Engineering Service 2 e97707b224
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7737739 (#18238)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.

---------

Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
2023-05-09 11:03:52 -05:00
TJ Lambert aed4d7a5d0
[Localization] Bring More Translations Manually (#18241)
Until, we can try a VSEng PAT for the Pipeline as seen in this
[PR](https://github.com/xamarin/xamarin-macios/pull/18122#issuecomment-1533558542),
I will continue to bring the [not-yet usable] translation strings
manually!

---------

Co-authored-by: CSIGS <csigs@outlook.com>
2023-05-09 11:03:08 -05:00
Rolf Bjarne Kvinge 415086c4ce
[Foundation] Fix nullability issues in NSUserDefaults. Fixes #18243. (#18246)
Fixes https://github.com/xamarin/xamarin-macios/issues/18243.
2023-05-09 17:39:34 +02:00
Rolf Bjarne Kvinge 62a43f4fa9
[msbuild] Merge the MTouch and MTouchTaskBase classes. (#18212)
We no longer need to have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-05-08 16:40:59 +02:00
Rolf Bjarne Kvinge e56920642b
[runtime] Re-generate product.h when the current commit changes. (#18231)
This way the runtime libraries are always up-to-date after building
after making local commits.
2023-05-08 14:54:47 +02:00
Rolf Bjarne Kvinge da23c8e488
[tests] Install workloads on Windows without checking the signature of the packages. (#18210)
Hopefully fixes:

    MSBuild version 17.4.1+9a89d02ff for .NET
    D:\AzDO\_work\_tool\dotnet\sdk\7.0.102\MSBuild.dll --property:DisableImplicitNuGetFallbackFolder=true -bl:D:\AzDO\_work\2\s/xamarin-macios/tests/dotnet/Windows/install.binlog -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,D:\AzDO\_work\_tool\dotnet\sdk\7.0.102\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,D:\AzDO\_work\_tool\dotnet\sdk\7.0.102\dotnet.dll -maxcpucount -restore -verbosity:m -verbosity:quiet D:\AzDO\_work\2\s/xamarin-macios/tests/dotnet/Windows/InstallDotNet.csproj
    EXEC : error : NU3004: The package is not signed. [D:\AzDO\_work\2\s\xamarin-macios\tests\dotnet\Windows\InstallDotNet.csproj]
2023-05-08 11:03:18 +02:00
Rolf Bjarne Kvinge eb7184831b
[msbuild] Merge the ILStrip and ILStripTaskBase classes. (#18211)
We no longer need to have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-05-08 11:03:00 +02:00
Rolf Bjarne Kvinge 32bf0b1996
[msbuild] Show a warning if asked to load an app manifest that doesn't exist. (#18222)
This makes it easier to diagnose problems loading/finding app manifests.

Specifying an app manifest that doesn't exist should probably be an
error, but that's very likely to break existing projects, so just make this a
warning for now.
2023-05-08 11:02:40 +02:00
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
Rolf Bjarne Kvinge 6c3e745a93
[devops] Fail the 'Add summaries' task if something goes wrong. (#18227)
That way we can re-run it when something does go wrong (instead of
rerunning the _entire pipeline_).
2023-05-05 17:15:34 +02:00
Rolf Bjarne Kvinge 185a9a8c9a
[xharness] Add a release + all optimization test variation of monotouch-test for desktop. (#18140)
Add a 'release + all optimization' test variation of monotouch-test for
macOS and Mac Catalyst.
2023-05-05 11:24:26 +02:00
Rolf Bjarne Kvinge 17bcfbf4cb
[tests] Fix running dotnet with MSBUILD_EXE_PATH. (#18223)
'dotnet build' doesn't work when MSBUILD_EXE_PATH is set (which we do in
some places for legacy tests), so make sure to unset MSBUILD_EXE_PATH before running
'dotnet build'.
2023-05-05 11:16:54 +02:00
TJ Lambert a54fefd836
[Localization] Revert change to non-breaking space (#18216)
This change didn't really get rid of the non-breaking space and caused
extra changes after we built xamarin-macios.

Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
2023-05-04 21:59:37 -05:00
dotnet-maestro[bot] ba52c29f88
[main] Update dependencies from dotnet/installer (#18201)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: fffd7604-ce46-455f-0f2f-08db24524baf
- **Build**: 20230504.11
- **Date Produced**: May 4, 2023 10:10:59 AM UTC
- **Commit**: ccc5191a306acdad77bbfea6675886dc72bf9454
- **Branch**: refs/heads/release/7.0.2xx

- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.204-servicing.23214.3 to
7.0.206-servicing.23254.11][2]
2023-05-04 23:42:23 +02:00
Rolf Bjarne Kvinge 21afe8a602
[msbuild] Simplify code by using updated API from Xamarin.MacDev. (#18090)
This also requires a Xamairn.MacDev bump.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@bab25f5 [Xamarin.MacDev] Add a few convenience
overloads to IAppleSdk.
* xamarin/Xamarin.MacDev@920e87e Update UnitTests.csproj
* xamarin/Xamarin.MacDev@ccc9bd4 Update Xamarin.MacDev.csproj

Diff:
74c95ee1c3..bab25f535f
2023-05-04 22:48:37 +02:00
Rolf Bjarne Kvinge 70e33e4924
[xharness] Unify MtouchExtraArgs and MonoBundlingExtraArgs handling when creating test variations. (#18215)
Make the code that creates test variations set a single BundlingArguments
property, and then when we generate the corresponding test project we set both
MtouchExtraArgs and MonoBundlingExtraArgs. The property that doesn't apply to
the current platform will just be ignored.
2023-05-04 22:44:55 +02:00
Rolf Bjarne Kvinge 066ab68bc6
[xharness] Append to MtouchExtraArgs/MonoBundlingExtraArgs instead of just setting the value. (#18200)
When generating/cloning test projects and modifying
MtouchExtraArgs/MonoBundlingExtraArgs, we always want to add to any existing
properties instead of overwriting them, so do exactly that.

With this change we now find the latest top-level PropertyGroup in the project
file with no Condition, and add a MtouchExtraArgs/MonoBundlingArgs that adds
to any existing property.
2023-05-04 17:09:50 +02:00
Rolf Bjarne Kvinge 791b98cac2
[dotnet-linker] Enable nullability in numerous files. (#18184)
This required some minor refactorings to simplify the changes, but no
behavior should change.
2023-05-04 07:50:32 +02:00
Rolf Bjarne Kvinge 101f800082
[msbuild] Merge the ILLink and ILLinkTaskBase classes. (#18086)
We no longer need two have overridable logic for remote builds, so the
non-abstract task class and the abstract base class can be merged.

Also enable nullability and fix any issues.
2023-05-04 07:40:09 +02:00
Rolf Bjarne Kvinge d12c04689f
Enable nullability in various places (#18082)
I started fixing nullability in one place, and then it snowballed a bit
and I had to fix nullability in a lot of places.

Most are trivial, except for the `generate-frameworks-constants`
project: I had to create a .NET version of the project in order to
compile a .NET version of the tool.
2023-05-04 07:39:56 +02:00
Rolf Bjarne Kvinge 0ad313fc1c
Use the current version of .NET in a few projects. (#18206) 2023-05-03 22:46:58 +02:00
Rolf Bjarne Kvinge 8936c7a936
[src] Enable nullability in a few files. (#18185) 2023-05-03 20:04:46 +02:00
VS MobileTools Engineering Service 2 9b7b3360da
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7704520 (#18191)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-05-03 12:32:16 -05:00
Filip Navara abd9883af6
Fix the name of the item function. (#18199)
The name is `HasMetadata`, not `HasMetadataValue`
(https://learn.microsoft.com/en-us/visualstudio/msbuild/item-functions?view=vs-2022).
2023-05-03 16:48:36 +02:00
Rolf Bjarne Kvinge 98cc2817ba
[xharness] Improve listing files in the repository. (#18183)
When cloning projects, we need to list all the files in the original project
directory and manually include some of them in the cloned project (because in
.NET some files from the project directory are included automatically, and if
we clone a project and put the cloned project in a different directory, those
files won't be picked up automatically by the build anymore).

The previous code to list the files in the project directory would run 'git
ls-files' for each project directory. This is rather slow, since it happens
quite a few times. Instead modify the logic to run 'git ls-files' once for the
entire tests/ directory, store the result, and then when we need to list files
in a particular project directory, just look in that stored list for the
applicable files.

This is much, much faster.
2023-05-03 14:21:50 +02:00
Rolf Bjarne Kvinge a4b5edd1d1
[xharness] Remove the MtouchExtraArgs parameters/properties/fields in numerous places. (#18182)
It's not being used for anything at all, it's only passing empty strings
around.
2023-05-03 14:10:11 +02:00
Rolf Bjarne Kvinge 6e7128b619
[msbuild/tests/dotnet] Add support for xcframeworks for Hot Restart and add tests. Fixes #16571. (#18103)
Rework Hot Restart builds to use as much as possible of the normal build
logic, because this is the easiest way to make sure the Hot Restart build is
as close as possible to normal builds (and we don't end up missing features).

This is done by executing selected parts of a normal build, and at the end we
have a new task that computes where each file goes in the various output
directories Hot Restart uses (HotRestartAppBundlePath, HotRestartContentDir,
HotRestartAppContentDir, etc.)

This PR also:

* Adds a test that runs on Windows and verifies that everything consumed in a
  build is placed in the correct location for a Hot Restart build (this is a
  variation of the BundleStructure test we already have).
* Removes tasks that aren't used anymore.
* Misc fixes to make sure existing code works on Windows.

---

This PR is best reviewed commit-by-commit.

Ref: https://github.com/xamarin/xamarin-macios/issues/13924

* Fixes https://github.com/xamarin/xamarin-macios/issues/16571
* Fixes https://github.com/xamarin/xamarin-macios/issues/16001
* Fixes https://github.com/xamarin/xamarin-macios/issues/10784
* Fixes https://github.com/xamarin/xamarin-macios/issues/17579
* Contributes towards https://github.com/xamarin/xamarin-macios/issues/13924.
2023-05-03 14:09:31 +02:00
Manuel de la Pena 9159d0d849
[CI] Fix the windows tests in the unified pipeline. (#18196)
Add the prefixes that were missing in the csproj using the env variable
set by the pipeline.
2023-05-02 14:42:38 -04:00
Steve Hawley 2ec000df27
[dotnet] Use the type_map_path arg (#18175)
Removed the default argument value
Added `Application.ClassMapPath`
Added options and setter for `ClassMapPath`
Integrated usage.
2023-05-01 14:48:09 -04:00
Rolf Bjarne Kvinge a182ad5a1f
[AVFoundation] Add missing AVCapture members. Fixes #18155. (#18156)
Fixes https://github.com/xamarin/xamarin-macios/issues/18155.
2023-04-28 10:48:03 +02:00
Rolf Bjarne Kvinge 35432b22b7
[tests] Package macOS tests even if only Mac Catalyst is enabled. (#18158)
We have tests to execute on macOS even if only Mac Catalyst is enabled,
so package those tests in that case as well.
2023-04-28 10:24:24 +02:00
Peter Collins abe065f639
[ci] Add parameter to disable classic signing (#18142)
A new parameter has been added to allow the unified pipeline to skip
classic signing jobs.

The jobs that would sign and notarize the custom workload .pkg and .zip
files have been removed, as we do not ship these anywhere and do not
need to wait on signing for them.  The `dotnet-signed` artifact has been
removed as a result, and the `not-signed-package` artifact is used in
its place.
2023-04-27 12:40:21 -04:00
Rolf Bjarne Kvinge bc272a9446
[tests] Find a workaround for #xamarin/maccore@2668. (#18159)
1. Mono changed dyld lookup to start looking in directories in
   NATIVE_DLL_SEARCH_DIRECTORIES before the actual given path, even when the
   given path is absolute [1].
2. This turned out to break Mac Catalyst, because when a DllImport says a
   P/Invoke is in "/System/Library/Frameworks/SceneKit.framework/SceneKit",
   Mono would try loading by prefixing the directories in
   NATIVE_DLL_SEARCH_DIRECTORIES. We add the Contents/MonoBundle directory to
   NATIVE_DLL_SEARCH_DIRECTORIES, so Mono would try to load
   "/path/to/my.app/Contents/MonoBundle//System/Library/Frameworks/SceneKit.framework/SceneKit",
   and things would go wrong.
3. We found a workaround: add "/" to NATIVE_DLL_SEARCH_DIRECTORIES. This works
   on Ventura, but apparently not on older macOS version, because the actual
   path we pass to dlopen ends up being "///System/Library/Frameworks/SceneKit.framework/SceneKit"
   (note the three initial slashes instead of a single slash).
4. Add a second workaround, where we add a dll import resolver to load exactly
   the path we want to load.

[1]: 5a1baebc09
[2]: https://github.com/dotnet/runtime/pull/85255

Technical sidenote:

Why trying to load "/path/to/my.app/Contents/MonoBundle//System/Library/Frameworks/SceneKit.framework/SceneKit"
turned out so bad on Mac Catalyst is not obvious. What happens is this:

* The app calls 'dlopen ("/path/to/my.app/Contents/MonoBundle//System/Library/Frameworks/SceneKit.framework/SceneKit")'
* dlopen checks if this is a Mac Catalyst override of a macOS system
  framework, by prefixing "/System/iOSSupport" and trying to load that. So
  dlopen would try to load "/System/iOSSupport/path/to/my.app/Contents/MonoBundle//System/Library/Frameworks/SceneKit.framework/SceneKit",
  which would obviously fail.
* Then dlopen would try a few more fallbacks, eventually trying
  "/System/Library/Frameworks/SceneKit.framework/SceneKit", and successfully
  loading that library.
* Unfortunately "/System/Library/Frameworks/SceneKit.framework/SceneKit" is
  the wrong library to load for Mac Catalyst ("/System/iOSSupport/System/Library/Frameworks/SceneKit.framework/SceneKit"
  is the correct version). These two libraries are incompatible, and calling
  one when you mean to call the other will do nasty things like corrupting the
  stack.
2023-04-27 18:17:33 +02:00
Rolf Bjarne Kvinge bdf25df990
[tests] Allow a little bit of leeway when testing floating point numbers in SKTransformNodeTest. (#18157)
Fixes this test failure:

    MonoTouchFixtures.SpriteKit.SKTransformNodeTest
        [FAIL] EulerAngles :   #x1
            Expected: -2.14159298f
            But was:  -2.14159274f
2023-04-27 17:55:49 +02:00
Steve Hawley 935ec25827
[dotnet] integrate writing out class map into static registrar (#18141)
Replaced the existing type map in StaticRegistrar.cs with a
`CSToObjCMap`.
Added code to write it out to a specified path as XML.
Currently the path is a parameter that defaults to null and is not (yet)
used.
2023-04-26 11:57:07 -04:00