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

15756 Коммитов

Автор SHA1 Сообщение Дата
Steve Hawley 91daf664c4
[dotnet] Add to optimizations (#18387)
add redirect-class-handles to test output along with options

---------

Co-authored-by: Alex Soto <alex@soto.dev>
2023-06-01 22:04:33 -04:00
Rolf Bjarne Kvinge b4f7daac08
[tests] Ignore the NWParametersTest.SetPrivacyContextText, it crashes everywhere. (#18383) 2023-06-01 12:03:56 +02:00
Rolf Bjarne Kvinge 722bc0c555
[devops] Collect test results and upload them for the Windows tests. (#18386)
Also make the tests log to stdout so that we can see what happened (i.e. went
wrong) from the logs.
2023-06-01 10:39:38 +02:00
Manuel de la Pena d2b6a5afb6
[CI] Move the script to run the tests to a file rather than being inline. (#18379) 2023-05-31 10:28:01 -04:00
dustin-wojciechowski 2606b2341e
[docs]Created a doc for preparing an app for TestFlight (#18125)
I created a short doc to help anyone uploading their app to Test Flight.

I targeted MacCatalyst apps for the Mac App Store but would work the
same for iOS apps.
2023-05-30 17:46:10 -04:00
Steve Hawley 62634bdc7a
[dotnet] add redirect-class-handles to optimizations. (#18354)
Add redirect-class-handles to optimization options.
2023-05-30 14:45:25 -04:00
Rolf Bjarne Kvinge 3e13f66948
[dotnet] Add support for asking more of 'open' when launching desktop apps. (#18366)
* Add support for forwarding our debugging msbuild properties to their
  corresponding environment variables (the XamarinDebug* properties).
* Add support for passing --stdout/--stderr/--stdin to open to redirect
  to/from a file. This is particularly useful for debugging debugging.
* Add support for passing -a (to always create a new instance of the app).
  This is useful when debugging (when the developer would always want a new
  instance, instead of opening an existing instance).
* Also add support for any other argument using the 'OpenArguments' property.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1825427.
2023-05-30 17:55:31 +02:00
Manuel de la Pena c5ef1a0a43
[CI] Use the template to generate a matrix strategy which reduces the yaml explosion. (#18312)
The final result is the same, but because a matrix strategy is a native
element of azure pipeline, it does not get expanded. This makes our
pipeline to be reduce to under 10.000 lines of yaml when it was around
40.000. This should unblock the dev of
https://github.com/xamarin/xamarin-macios/pull/18279
2023-05-30 10:26:53 -04:00
Rolf Bjarne Kvinge 12be89c189
[CoreFoundation] Add a few missing APIs to CFRunLoop and enable nullability. (#18322) 2023-05-30 08:50:42 +02:00
TJ Lambert 67ee512660
[Localization] Change PAT for automated PRs (#18345)
Let's try using this new PAT from VSEng in our automation to bring
translations from the Localization branch in PRs.

Tested here on a test branch:
https://github.com/xamarin/xamarin-macios/pull/18326

Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
2023-05-26 11:47:04 -05:00
Mauro Agnoletti 495ebc9ffd
[main] Hot Restart fixes (#18317)
- Update Hot Restart client to 1.0.119: bring latest isignsharp fix 71220d490a

- Added missing app markers back:
    - Added .stamp files to make incremental deployments work again and to avoid re-installing the application. We use .stamp files to know which files to copy on incremental deployments and also to avoid unnecessary app installations
    - Added .hotrestartapp file back to identify the main app entry point. We need this since the main entry point to dynamically load the app might change between Forms and MAUI (could be a .dll or an .exe), so we need a way to let the Hot Restart app to know which is the main assembly to load
    
- Fixed outputs in _CodesignHotRestartAppBundle target: the codesign was being executed always, causing the incremental builds to not work as expected.

- Ensure the _CodesignHotRestartAppBundle target is executed before the copy of the content files and not after: Hot Restart content files doesn't affect the code signing, so they don't need to be copied before the signing process. Copying the content files before the code sign was causing unwanted behaviors and errors since the code sign logic will try to clear the signing folder before the execution, to avoid mixing old and new content
2023-05-26 16:24:30 +02:00
Rolf Bjarne Kvinge eb9ab07404
[msbuild] Add a missing 'UsingTask' for the FindILLink task. (#18334) 2023-05-25 18:32:25 +02:00
Rolf Bjarne Kvinge 95f6c356d0
[msbuild] Make the GetFileSystemEntries task capable of copying files to the Mac. (#18324)
Make the GetFileSystemEntries task capable of copying files to the Mac, and
enable this new behavior when inspecting references for binding resources.

Otherwise the task might not find anything, if the files aren't copied to the
Mac (this happens if the files originate from NuGets instead of referenced
projects).

Ref:

* https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (third attempt)
* https://github.com/xamarin/xamarin-macios/issues/18308
* https://github.com/dotnet/maui/issues/15042
2023-05-25 16:34:04 +02:00
Rolf Bjarne Kvinge 87bba7b3e6
[msbuild] Bump ILStrip and add a maestro dependency to keep it updated. (#18291) 2023-05-25 16:33:16 +02:00
Rolf Bjarne Kvinge 3dd412daa6
[tests] Adjust ImageCaptioningTest to clean up after itself and support concurrent execution. (#18329)
* This test creates a file in the temp directory, so make sure the file name
  is unique enough to not clash with any other test runs running concurrently.

Fixes this problem:

> SetCaption: System.IO.IOException : IO_SharingViolation_File, /var/folders/r7/kvhxkfw54qlc5y72d620783h0000gn/T/basn3p08.png


* Also delete the temporary file at the end of the test.

This PR is best viewed by ignoring whitespace, since it indents a big chunk of
code.
2023-05-25 10:50:08 +02:00
Rolf Bjarne Kvinge 52e538db6e
[tests] Detect another way to be unable to record audio in AVAudioSinkNodeTest and ignore the test in that case. (#18316) 2023-05-25 10:49:34 +02:00
Rolf Bjarne Kvinge 8cff397db0
[tests] Fix adding no files to package-test-libraries.zip. (#18307)
If only some platforms are enabled, some of the commands to find files to add
to package-test-libraries.zip won't find any files at all.

Asking 'zip' to add no files fails with:

    zip error: Nothing to do!

and there's no way to add 'zip' to ignore this error condition.

However, we can instead try to not call zip at all when we don't find any
files, and we do that by using:

    "find ... -exec zip"

instead of:

   "find .. | zip ..."
2023-05-24 17:04:57 +02:00
Rolf Bjarne Kvinge 5ad0df2dde
[tests] Adjust AXHearingUtilitiesTest to accept more values regarding hearing configuration. (#18313)
These values are returned on device.
2023-05-24 17:04:28 +02:00
Rolf Bjarne Kvinge 0a3ba93d38
[tests] Update CaptureMetadataOutputTest to work on older devices by adding an OS version check. (#18314) 2023-05-24 17:04:15 +02:00
Rolf Bjarne Kvinge ac6b1e0a1c
[monotouch-test] Ignore MTLArgumentEncoderTest on older devices. (#18315)
The test fails on iOS 12.4, and works on iOS 16.5, so for now ignore if <iOS 13.0.
2023-05-24 16:58:49 +02:00
Manuel de la Pena 88e3e258de
[CI] Move a number of bash scripts from inline scripts to file based scripts (#18311)
This allow stop minize the expanded size of the yaml.
2023-05-23 10:50:14 -04:00
VS MobileTools Engineering Service 2 a054c52d54
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7800490 (#18306)
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-23 08:26:52 +02:00
Rolf Bjarne Kvinge 1337268bbf
[dotnet-linker] Add a tasks.json to ease development with VSCode. (#18292) 2023-05-19 07:59:24 +02:00
Rolf Bjarne Kvinge 464cf6986e
[tools] Add helper tool to create launch.json for dotnet-linker. (#18294)
This tool takes a binlog as input, and creates a launch.json for dotnet-linker
that will execute the linker as was done in the binlog.

This is very useful for debugging custom linker steps, since they can be
debugged in VSCode now.
2023-05-19 07:45:21 +02:00
Rolf Bjarne Kvinge cdbf30cb92
[dotnet-linker] Add a 'vscode' target that will launch VSCode with the paths configured to use the local .NET. (#18293) 2023-05-19 07:45:06 +02:00
Rolf Bjarne Kvinge 0bc12c8def
Add a managed static registrar. Fixes #17324. (#18268)
Add a new version of the static registrar (called the managed static
registrar), which most notably doesn't use metadata tokens (because NativeAOT
doesn't support metadata tokens). In addition, the new registrar also takes
advantage of new features in both C# and the runtime, in order to be more
performant.

I won't go into detail about everything here, because it would be rather long,
but I've added documentation for the new registrar (the first commit, so start
reviewing there).

Fixes https://github.com/xamarin/xamarin-macios/issues/17324.
2023-05-19 07:30:33 +02:00
Manuel de la Pena 6e216f0e4c
[DevOps] Provide a script that will allow use to debug the expanded yaml. (#18289)
This pr provides a script that will allow to create a dry run in vsts
and will return the expanded yaml after the yaml compiler has been
executed, this will be written in the given output file.

Usage:

Basic usage: Query the expanded template from the ci pipeline in main:

```pwsh
./preview_yaml.ps1 -AccessToken $pat -OutputFile ./full.yaml
```

Query the expansion in the pr pipeline:
```pwsh
./preview_yaml.ps1 -AccessToken $pat -OutputFile ./full.yaml -Pipeline "pr"
```

Query the expansion in the ci pipeline for a diff branch than main:
```pwsh
./preview_yaml.ps1 -AccessToken $pat -OutputFile ./full.yaml -Branch "trigger-issues"
```

The output file is ALLWAYS overriden.
2023-05-18 15:30:04 -04:00
Manuel de la Pena 9f503ea48a
[DevOps] Do not sign the sbom on the prs. (#18288)
That step is failing or Prs with the following messsage:

`
##[error]The signing feature is not available for your organization yet.
`

Yet we do not need or care about the sbom on a pr. We can remove it and
that way not get the error and use less resources.
2023-05-18 15:20:47 -04:00
Rolf Bjarne Kvinge edd0bc48f2
[msbuild] Fix calling the GetFileSystemEntries task on Windows when not connected to a Mac. (#18287)
Given the following truths:

* A task will (try to) connect to a Mac if its SessionId property isn't empty.
* The BuildSessionId property is always set on Windows when building from an IDE (even if not connected to a remote Mac).

It stands to reason that we can't use BuildSessionId to distinguish between
connected/not conected status on Windows. Instead introduce a new property,
BuildSessionIdIfConnected, which is only set if connected to a Mac (i.e. if
'IsMacEnabled=true').

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1808448 (second attempt).
2023-05-18 18:21:21 +02:00
Steve Hawley d57f205feb
[dotnet] Turn class-redirector into a Task (#18244)
Rework the class-redirector as an MSBuild Task.
2023-05-18 10:55:37 -04:00
Rolf Bjarne Kvinge 65590ba8c0 Merge remote-tracking branch 'origin/main' into msr 2023-05-18 15:19:39 +02:00
GitHub Actions Autoformatter 03488a28b7 Auto-format source code 2023-05-18 10:12:06 +00:00
Rolf Bjarne Kvinge 666ec96bf5 [dotnet-linker] Simplify generated code for constructors of generic types.
We can't create an instance of a generic type in the UnmanagedCallersOnly trampoline,
so simplify the code to not even try, and instead just throw the final exception.
2023-05-18 11:54:10 +02:00
Git History Editor d540050538 [dotnet-linker] Add a missing cast to make generated code more verifiable 2023-05-18 11:54:10 +02:00
Git History Editor aa75c706dc [dotnet-linker] Keep track of when we called MethodBase.Invoke and an 'object' reference is left on the stack.
Keep track of when we called MethodBase.Invoke and an 'object' reference is left
on the stack, so that we can cast to the appropiate type later on when we know how
the value is converted to the corresponding native type.

This fixes a few cases of the managed static registrar creating unverifiable IL.
2023-05-18 11:54:10 +02:00
Git History Editor ed7b4b6485 [dotnet-linker] Keep better track of when we're calling MethodBase.Invoke.
Keep better track of whether we're calling MethodBase.Invoke to call the target method,
which allows us to detect certain error scenarios (and show a corresponding error).
2023-05-18 11:54:10 +02:00
Git History Editor 469fdb5bed [dotnet-linker] Fix detecting when we must call the object-based Runtime.GetNSObject
We can't call the generic Runtime.GetNSObject<T> method when we don't know the final
type of the returned object, which happens for open types. However, we must always
call the generic Runtime.GetNSObject<T> when we know the final type, so that we have
the correct object type on the evaluation stack.

Fix this by properly detecting open types and only calling Runtime.GetNSObject in
that case.
2023-05-18 11:54:09 +02:00
Rolf Bjarne Kvinge a7371cf53c [dotnet-linker] Remove dead code. 2023-05-18 11:54:09 +02:00
Rolf Bjarne Kvinge 799095e761 [dotnet-linker] Ensure we call Runtime.CopyAndAutorelease in all applicable code paths. 2023-05-18 11:54:09 +02:00
Rolf Bjarne Kvinge 643015e9cb [dotnet-linker] Make sure local variables are initialized before use in generated method bodies. 2023-05-18 11:54:09 +02:00
Emanuel Fernandez Dell'Oca 73fefdb0c1
[dotnet] Fix linker path on Windows (#18285)
When building from Windows, we need to pass the path to the illink
assembly located on the Mac to the linker task. The educated guess we've
been using is a bit fragile and has been getting us problems almost on
each new .NET major release. On top of that, from .NET 8 the linker is
in a separate NuGet package, so the assembly is no longer located in the
SDK directory on the Mac.

The fix is to follow the same approach we use to find the AOT compiler
on the Mac by running a target that finds that information on the remote
Mac, and brings it back to Windows, where it is cached and use across
build.

Created a new XamarinBuildTask class to share most of the code needed
for this approach.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-05-17 21:56:34 +02:00
Rolf Bjarne Kvinge 2906f0202d
[msbuild] Enable nullability in a few classes. (#18248) 2023-05-17 16:57:01 +02:00
Manuel de la Pena 7ce9c03ee9
[Generator] Clean code left behind in a refactor. (#18283) 2023-05-17 10:22:33 -04:00
Manuel de la Pena 87e3edcb5a
[Generator] Remove nullability warnings. (#18281)
Remove some warnings that started to happen "recently".


Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-05-17 10:21:59 -04:00
Rolf Bjarne Kvinge 70de850be6
[runtime] Add support for keeping the same block alive multiple times. Fixes #18161. (#18277)
We can be asked to keep the same block+delegate pair alive multiple
times, so add support for keeping track how many times a block must be freed once
the corresponding delegate is collected by the GC.

Fixes https://github.com/xamarin/xamarin-macios/issues/18161.
2023-05-17 14:14:03 +02:00
Emanuel Fernandez Dell'Oca aec2af30ce
[dotnet] Stop looking for the AOT compiler if cached (#18286)
The AOT compiler does not exist on Windows, so this check was making the
cache never work there. We don't really need to check if the compiler
does still exist, since the cache can be deleted by rebuilding the
project if anything fails.
2023-05-17 14:06:10 +02:00
VS MobileTools Engineering Service 2 9f60e3631d
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 7769228 (#18275)
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: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: tj-devel709 <tjlambert@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-05-16 11:07:02 -05:00
TJ Lambert f64c6f4412
[Localization] Bring over non-breaking space change (#18272)
The Loc team was able to change the non-breaking space on their end!

Co-authored-by: CSIGS <csigs@outlook.com>
2023-05-16 11:05:46 -05:00
Rolf Bjarne Kvinge 43cb1e8dcb
Auto-format source code. (#18278)
The autoformatter was down for a litle while, and these issues crept in.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-05-16 12:46:24 +02:00
Rolf Bjarne Kvinge cdac4507a2
[devops] Stop building test dependencies on each test run. (#18096)
Stop building the test dependencies on each test run, and instead use the archived test dependencies we have from the main build:

* Stop running 'make all' in tests/ on every separate test run.
* Add a lot more stuff in the package-test-libraries.zip archive.
* Extract all the new stuff on every test run. We add stuff from outside the tests/
  directory, so adjust archive creation and extraction to use the root directory
  of the repository as the root of the zip archive as well.
* Also add the introspection dependencies to the same archive to simplify the logic.
* Fix xharness to not store absolute paths in generated projects.
* Fix test project to not automatically run make in tests/test-libraries when running
  on the bots.

Building the test dependencies takes ~10 minutes for each test run, so this saves
about that time for each test run.
2023-05-15 18:41:49 +02:00