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

13741 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 9ff8a6b3da
[devops] Collect diagnostic logs from the simulator. (#15215)
Collect diagnostic logs from the simulator to try to get better diagnostic information for https://github.com/xamarin/maccore/issues/2558.

Interestingly it seems like just collecting diagnostic information makes the problem much less likely to occur...
2022-06-22 23:18:52 +02:00
Manuel de la Pena fae8c53bbf
[Tests] Add missing nuget. (#15313)
Tests work because other tests do use the nugets and gets picked up by
the runner. Yet, if we execute this projects witjout others, the tests
will fail when trying to use the nunit2 format.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-06-22 17:10:27 -04:00
Manuel de la Pena e8f935417b
[CI] Add a comment in md to ensure that we can identify the vsts comments. (#15301)
The job that hides the previous bot comments tries to find comments with
[OR\CI build] to decide if a comment should be hidden. This is added
when a title is present, so we just add a titles so that we can hide the
comments.
2022-06-22 10:36:36 -04:00
Manuel de la Pena 19632296e6
[CI] Enable Write-Debug when the pipeline was executed in debug mode. (#15312) 2022-06-22 10:35:44 -04:00
nathannaveen b03bd25855
chore: Set permissions for GitHub actions (#15300)
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
2022-06-22 15:23:45 +02:00
Rolf Bjarne Kvinge 62c7b173d6
Generate table of released versions. (#15308)
Generate the table of released versions from the source VSMac uses to list
available versions.
2022-06-22 11:31:05 +02:00
Sebastien Pouliot 799574027c
[foundation] Cache parts of `NSObject.ConformsToProtocol` (#15294)
Note that the call to native code still _always_ happen (not cached) since the application could use `class_addProtocol` to add conformance to a protocol at runtime.

So the cache is limited to the .net specific reflection code that is present (only) when the dynamic registrar is included inside applications. This is the default for macOS apps, but not iOS / tvOS or MacCatalyst apps.

The linker/trimmer will remove the caching code when the dynamic registrar is removed. IOW this PR should not have any impact, performance or size, for most iOS apps (where the dynamic registrar is removed by default).

Fix https://github.com/xamarin/xamarin-macios/issues/14065

Running Dope on macOS, a 2 minutes benchmark, shows the following times (in seconds and percentage) spent calling this API:

## Before

<img width="1051" alt="Screen Shot 2022-06-15 at 9 21 22 PM" src="https://user-images.githubusercontent.com/260465/174201703-a91860a5-ec29-4e19-9de0-5158fd7aafa7.png">

* `RemoveFromSuperview` 7.99s (6.4%)
  * `NSObject.ConformsToProtocol` 3.26s (2.6%)

## After

<img width="1228" alt="Screen Shot 2022-06-15 at 9 24 42 PM" src="https://user-images.githubusercontent.com/260465/174201708-92193e77-ea8e-41bc-9672-bddaaa18a4f6.png">

* `RemoveFromSuperview` 4.67s (3.8%)
  * `NSObject.ConformsToProtocol` 0.32s (.26%)

So a 10x improvements on `ConformsToProtocol` which helps a lot the code path calling `RemoveFromSuperview`.
2022-06-22 10:09:48 +02:00
github-actions[bot] c6cc025edf
Juno: check in to lego/hb_dca0a672-370a-4b3c-b55f-cd146e93faf9_20220614235728397. (#15274)
Co-authored-by: CSIGS <csigs@outlook.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-06-21 12:16:32 -05:00
Rolf Bjarne Kvinge 3be1d9d760
Use unix-style line endings in project files. (#15303)
This also removes the BOM in a few project files.

This is a whitespace-only change, as can be seen here: https://github.com/xamarin/xamarin-macios/pull/15303/files?w=1
2022-06-21 17:22:58 +02:00
Rolf Bjarne Kvinge e3bc284ab1
[build] Set DEVELOPER_DIR and MD_APPLE_SDK_ROOT to the Xcode we're using. (#15266)
This makes it not necessary to check for the currently selected Xcode in our
system dependency check. It also means it'll become much easier to work with
multiple branches simultaneously where each branch needs its own Xcode.
2022-06-20 09:52:21 +02:00
Manuel de la Pena 5b353d70d6
[CI] Use isPR parameter instead of the build reason. (#15281) 2022-06-19 12:15:11 -04:00
Manuel de la Pena bcf3e6aca2
[CI] Use isPR parameter instead of the build reason on the checkout template. (#15284) 2022-06-19 12:11:58 -04:00
Manuel de la Pena ae115441f2
[CI] Use isPR parameter instead of the build reason on publishing nugets. (#15283) 2022-06-18 11:51:31 -04:00
Rolf Bjarne Kvinge 42c1c66a14
[SceneKit] Fix SCNMatrix4 in .NET. Fixes #15094. (#15160)
When we changed SCNMatrix4 to be column-major instead of row-major in .NET, there
were several other related changes we should have done but didn't do. In particular
we should have made transformation operations based on column-vectors instead of
row-vectors.

In legacy Xamarin, a vector would be transformed by a transformation matrix by doing
matrix multiplication like this:

    [ x y z w] * [ 11 21 31 41 ]
                 | 12 22 32 42 |
                 | 13 23 33 43 |
                 [ 14 24 34 41 ]

In this case the vector is a row-vector, and it's the left operand in the multiplication.
When using column-major matrices, we want to use column-vectors, where the vector
is the right operand, like this:

    [ 11 21 31 41 ] * [ x ]
    | 12 22 32 42 |   | y |
    | 13 23 33 43 |   | z |
    [ 14 24 34 41 ]   [ w ]

This affects numerous APIs in SCNMatrix4, SCNVector3 and SCNVector4:

* The M## fields have been changed to make the first number the column and the
  second number the row, to reflect that it's a column-major matrix (this is
  also how it's defined in the native SCNMatrix4 type).
* Functions that return a transformation matrix have been modified to return column-vector
  transformers. Technically this means that these matrices are transposed compared
  to legacy Xamarin. The functions involved are:
    * CreateFromAxisAngle
    * CreateRotation[X|Y|Z]
    * CreateTranslation
    * CreatePerspectiveFieldOfView
    * CreatePerspectiveOffCenter
    * Rotate
    * LookAt
* Combining two column-vector transforming transformation matrices is done by multiplying
  them in the reverse order, so the Mult function (and the multiplication operator)
  have been modified to multiply the given matrices in the opposite order (this matches
  how the SCNMatrix4Mult function does it). To make things clearer I've changed the
  parameter names for XAMCORE_5_0.
* Functions that transform a vector using a transformation matrix have been modified
  to do a column-vector transformation instead of a row-vector transformation. This
  involves the following functions:
    * SCNVector3.TransformVector
    * SCNVector3.TransformNormal
    * SCNVector3.TransformNormalInverse
    * SCNVector3.TransformPosition
    * SCNVector4.Transform
* Numerous new tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/15094.
2022-06-17 20:17:05 +02:00
TJ Lambert 893cd77503
[webkit] Add nullability to (generated and manual) bindings (#15028)
* Adding nullable enable

* throw better exceptions

* use is null

* fix messages on throw exceptions

* throw ObjectDisposedException

* throw another ObjectDisposedException

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-06-17 09:59:10 -05:00
TJ Lambert a1e53d6d0d
[opengl] Add nullability to (generated and manual) bindings (#15174)
* Enable Nullability

* throw better exceptions

* use is null

* Style fixes

* address Rolf suggestions

* use better syntax

* make properties private and use ActualOpenGLContext

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-06-17 09:50:52 -05:00
Rolf Bjarne Kvinge ab52bb2f45
[msbuild] Unify the DetectSdkLocations task logic between iOS and Mac. (#15256)
This was mostly a clean merge, with a few minor differences:

* We no longer compute whether we're running in the simulator or not when building for Mac Catalyst.
* The task now supports building remotely for macOS (due to code sharing).
  Will be useful if we ever support building macOS apps remotely.
* We now call AppleSdkSettings.Init () on macOS. No idea why we weren't
  before, but it seems logical for macOS to behave like our other platforms.

There shouldn't be any other functional differences.
2022-06-16 23:52:43 +02:00
Steve Hawley 357adfde76
test for private classes (#15292) 2022-06-16 14:43:34 -04:00
Manuel de la Pena 771478a7ac
[CI] Add missing paramenter. (#15293) 2022-06-16 11:39:38 -04:00
Manuel de la Pena 59582575e3
[CI] Use isPR parameter instead of the build reason on the loc translations. (#15282) 2022-06-16 11:13:18 -04:00
Steve Hawley e1c334564e
[nnyeah] Added correct mapping for NSObject.Handle fixing #15261 (#15270)
* Added correct mapping for NSObject.Handle

* removed dead code
2022-06-15 14:17:13 -04:00
TJ Lambert db9412b542
[passkit] Add nullability to (generated and manual) bindings (#15262)
* Validating Null ignores and adding tests

* add nullability

* use is null

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-06-15 11:33:06 -05:00
TJ Lambert 3e6fdd86ed
[coretext] Add nullability to (generated and manual) bindings (#14978)
* Add nullability

* throw better exceptions

* use is null

* revert a new throw

* remove unused ConstructionError Exception

* started the nullable gethandle changes

* Update the nullable NSStrings

* revert the bool property nullability and other small fix

* Remove extra indentation

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-06-15 11:30:20 -05:00
Rolf Bjarne Kvinge 011f9776fd
[tests] Ignore the CS1416 warning by default in .NET test projects. (#15234) 2022-06-15 15:07:13 +02:00
Rolf Bjarne Kvinge 438e312503
[msbuild] Only pass -z to dsymutil when using Xcode 13.2 or earlier. (#15254)
Apple removed the -z / --minimize option in Xocde 13.3, so now if you use it
you get a warning: "ignoring unknown option: -z".

So just don't pass -z when using Xcode >= 13.3

Ref: https://github.com/dotnet/runtime/issues/66770
Ref: 5d07dc8977
2022-06-15 14:55:51 +02:00
Rolf Bjarne Kvinge a04fcf6d41
[tools] Fix nunit3-console shell scripts. (#15255)
We're putting all packages in the xamarin-macios/packages directory, and that
includes the nunit3-console package, so we need to point these shell scripts
that way.

Also make them behave the same with regards to stsack traces and the --debug
option to mono.
2022-06-15 14:54:00 +02:00
Rolf Bjarne Kvinge d5e8656b53
[introspection] Fix protocol checks on iOS and tvOS 12.4. (#15265) 2022-06-15 12:18:04 +02:00
Manuel de la Pena f2d0a16562
[CI] Do not provision simulators on builds. (#15268)
There is no need to provision the simulators on a build. Provisioning
simuatlors is giving problems with the EO pool after an upgrade to macOS
12.4.

We remove the provisioning from the build BUT not from the tests since
those tests are executed in non EO complient machines.
2022-06-14 14:12:32 -04:00
Manuel de la Pena eb16a0dd69
[Siminstaller] Use latests versin of the lang and enable nullability. (#15260) 2022-06-14 11:44:37 -04:00
Steve Hawley 18f18f9b76
[nnyeah] ensure that outside invocations of IntPtr constructors will work correctly (#15246)
* ensure that outside invocations of IntPtr constructors will work correctly

* Remove E0017 and ignore such constructors instead of hard erroring, they exist in real life
2022-06-14 11:22:20 -04:00
Rolf Bjarne Kvinge 8adbefdac8
[runtime] Fix 'skip_nested_brace' to not read past the string. Fixes #15253. (#15257)
Fix 'skip_nested_brace' to not double skip characters.

Also add a test.

Fixes https://github.com/xamarin/xamarin-macios/issues/15253.
2022-06-14 14:26:07 +02:00
Manuel de la Pena 28d286f91f
[CI] Remove the need of a variable to state if we are building a PR. (#15205)
Deciding if we build a PR or not used to be more complicated since we
had to make the diff between a CI build and a PR build. Now, since we
added diff pipelines we do not longer need to check any variable since
we can use a parameter.

This new fact makes the decision making simpler (although forces use to
add a new parameter in a few templates). The overall result is a simple
way to decide what can be used or not in the pipeline.

* Simplify logic.

* Add missing param.

* Fix the checkout for signing in the pr build.

* There is not need to sign in PR builds.

The signature is not needed for the tests and using -s in codesign means
that it is only valid in the machine that signed it.
2022-06-13 13:40:22 -04:00
Manuel de la Pena d66af89399
[CI] Conditions have no meanign in templates. (#15259) 2022-06-13 11:38:42 -04:00
Rolf Bjarne Kvinge ee2af3c896
[msbuild] Only sign the prebuilt hotrestart app in CI (#15236)
Only sign the prebuilt hotrestart app in CI, to avoid making it required for
developers to configure code signing.

Also fix DetectSigningIdentity to not require a code signing certificate for
device builds when RequireCodeSigning is false.

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2022-06-13 17:30:22 +02:00
Manuel de la Pena 5c2bcf9b8b
[CI] Ensure we do upload the agent logs in case of failure. (#15248) 2022-06-13 11:27:28 -04:00
Manuel de la Pena 2d720057b4
[Siminstaller] Print valid arguments when a unvalid one is provided. (#15249) 2022-06-13 11:26:46 -04:00
Manuel de la Pena 9aecafc510
[Siminstaller] Add help option. (#15250) 2022-06-13 11:26:20 -04:00
Rolf Bjarne Kvinge 0fa87fef48
[introspection] Fix according to macOS 12.4. Fixes #15229. (#15230)
* Ignore anything Chip-related, the framework was removed from macOS.
* Fix reporting errors some protocol-related errors so that they're actually
  reported as errors (by calling 'ReportError' instead of just adding the
  errors to a list that doesn't affect anything else).
* Ignore the NSUserActivityRestoring protocol, according to the macOS headers
  it's attached to NSResponder using a category, which is invisible at
  runtime. Due to the previous point this didn't show up before, but once at
  least another error (which happened with the Chip framework), then this was
  listed as well.
* Add ignores for a couple of protocols.

Fixes https://github.com/xamarin/xamarin-macios/issues/15229.
2022-06-13 09:55:24 +02:00
David Ortinau 5532f148d8
[Templates] Updated app icons for net6 templates (#15237)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-06-10 22:39:56 +02:00
Manuel de la Pena 6cdececce4
[CI] The cron jobs do not need to use ESRP signing. (#15245) 2022-06-10 16:37:43 -04:00
Rolf Bjarne Kvinge de08350eba
[devops] Fix computation of the vsdrops uri prefix. (#15241) 2022-06-10 14:08:07 -04:00
Rolf Bjarne Kvinge e974999d94
[apidiff] Bump the .NET reference files to the final stable version we released. (#15235) 2022-06-10 10:39:15 +02:00
Manuel de la Pena b504dcb140
[CI] Add another pipeline just for cronjobs so that we can easily identify those builds. (#15239) 2022-06-09 17:28:22 -04:00
Manuel de la Pena c1b5c4029c
[Tests] Ensure we do check the catalyst version on catalyst. (#15240) 2022-06-09 17:28:00 -04:00
Rolf Bjarne Kvinge b387776ee8
[msbuild] Update ILRepack location now that we're putting all our packages in a directory in our repo. (#15228) 2022-06-09 13:23:26 -04:00
Steve Hawley 3e12f0550e
[nnyeah] add code to handle get_ClassHandle calls. Fixes #15218 (#15225)
* add code to handle get_ClassHandle calls.

* tweak on the unit test
2022-06-09 11:48:15 -04:00
Rolf Bjarne Kvinge 414c5bf99e
Improve the API diff (#15020) 2022-06-09 15:47:00 +02:00
Rolf Bjarne Kvinge 78c7918929
[build] Fix invalid cache management by 'dotnet tool restore'. (#15227)
Fix invalid cache management by 'dotnet tool restore' by deleting 'dotnet tool's cache.
2022-06-09 15:38:59 +02:00
Manuel de la Pena 454e16a59a
[CI] Remove the usage of python2 and move to python 3. (#15226) 2022-06-09 08:38:41 +02:00
Rolf Bjarne Kvinge 38b0a2fafd
[tests] Fix nullability warning in the .NET tests. (#15213) 2022-06-09 07:39:22 +02:00