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

13973 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 1ecd84353f
[dotnet] Fix hang after packing .NET NuGets. Fixes #13355. (#15407)
This has been bothering me for a while... the symptom is that the build just
hangs at the end. Curiously it's never happend on the bots, only locally.

1. It only happens when using parallel make. When using parallel make, make is
   in a jobserver mode, where sub-makes are controlled using a pair of file
   descriptors inherited by the sub-makes. A consequence of this algorithm is
   that the controlling make process will wait until all inherited file
   descriptors have been closed before it will realize that all its sub-makes
   have finished.
2. 'dotnet pack' will build the corresponding project, and that might start a
   background compiler server.
3. This background compiler server does not seem to close any file descriptors
   it inherits.
4. The background compiler server does not necessarily exit by the time `make`
   is done.
5. The result is that `make` things there are still sub-makes doing stuff,
   because there are inherited file descriptors still open.
6. Killing the compiler server (in another terminal for instance) will make
   make realize it's done (and the hang is resolved).

So I'm applying the last point: shutting down the compiler server after
packing all the .NET NuGets.

Fixes https://github.com/xamarin/xamarin-macios/issues/13355.
2022-07-08 16:50:20 +02:00
Manuel de la Pena 279054ab25
[CI] Change logic to take into account that CI has no labels. (#15414) 2022-07-07 15:57:35 -04:00
Manuel de la Pena 3314ed823b
[CI] Use the Stable Xcode channel in main related branches. (#15406)
Xcode14 broke actool. We have created two diff bot images:

- Stable: Contains the latests stable xcode (xcode13.4)
- Beta: Contains the latests beta xcode OR will allow it to be
  installed.

By doing this we mitigate the possible issues that the new Xcode might
create. Some of the bots have already been migrated.

This commit SHOULD NOT be backported to xcode14.
2022-07-06 13:51:10 -04:00
Manuel de la Pena 4700f69e71
[CI] Fix the skip of tests. (#15404)
When the label is not present we set the value to false. We also needed
to make sure that the project is checked out when we try to write the
comment.

This should be backported to xcode14.
2022-07-06 10:04:31 -04:00
Manuel de la Pena 68fe412e89
[CI] Allow to pass the xcode channel. (#15377)
Allow to pass the xcode channel we are going to be using. This is to
ensure that we do not try to build the xcode14 branch in beta bots. At
the moment all bots are using the Beta channel, but once the lab has
been updated we should be able to move main to Stable.
2022-06-30 09:19:12 -04:00
Manuel de la Pena 9a8d74b880
[Build] Allow to skip the build of Hotrestart. (#15380) 2022-06-30 09:18:42 -04:00
Manuel de la Pena cf26e6e627
[CI] Provide a script to help when doing bot reports. (#15376)
We have several issues with reports. VSTS UI is not very good at this,
yet we do the scripts to take care of it. Added a script that allows to
show all the bots based on a capability.

Example
```
pwsh bots-info.ps1 -Token "$YOURTOKEN" -PoolName "VSEng-Xamarin-RedmondMacBuildPool-iOS-Untrusted" -Capability "XcodeChannel"
```

Output:
```
VSEng-Xamarin-RedmondMacBuildPool-iOS-Untrusted bots:
	Name: BOT-0189.Catalina; XcodeChannel=Stable
	Name: BOT-0202.Catalina; XcodeChannel=Stable
	Name: XAMBOT-1098.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1104.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1042.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1043.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1108.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1107.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1109.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1017.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1023.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1044.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1105.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1103.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1106.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1030.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1033.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1035.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1036.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1037.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1039.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1100.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1101.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1094.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1096.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1102.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1099.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1097.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1160.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1161.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1162.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1163.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1165.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1164.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1166.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1167.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1168.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1169.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1170.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1171.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1172.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1173.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1174.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1175.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1176.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1177.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1180.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1181.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1183.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1184.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1179.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1178.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1182.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1193.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1192.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1185.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1188.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1187.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1186.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1190.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1191.Monterey; XcodeChannel=Beta
	Name: XAMBOT-1189.Monterey; XcodeChannel=Beta
```
2022-06-29 17:00:32 -04:00
Manuel de la Pena 8bd19e5514
[CI] Allow to skip all tests in the parallel implementation. (#15334)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-06-29 15:27:03 -04:00
Manuel de la Pena a5f72dda33
[CI] Provide hardware information. (#15369)
Get the bot information to improve the debugging of build failures. The
following is an example of the output:

Software:

    System Software Overview:

      System Version: macOS 12.4 (21F79)
      Kernel Version: Darwin 21.5.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Mandels Home iMac Pro
      User Name: Manuel de la Pena Saenz (mandel)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 3 days 23:43

Hardware:

    Hardware Overview:

      Model Name: iMac Pro
      Model Identifier: iMacPro1,1
      Processor Name: 8-Core Intel Xeon W
      Processor Speed: 3,2 GHz
      Number of Processors: 1
      Total Number of Cores: 8
      L2 Cache (per Core): 1 MB
      L3 Cache: 11 MB
      Hyper-Threading Technology: Enabled
      Memory: 64 GB
      System Firmware Version: 1731.120.10.0.0 (iBridge: 19.16.15071.0.0,0)
      OS Loader Version: 540.120.3~6
      Serial Number (system): C02WD0V7HX8F
      Hardware UUID: 85EE3276-4E8F-592A-A47B-599DFAB6DF1C
      Provisioning UDID: 85EE3276-4E8F-592A-A47B-599DFAB6DF1C
      Activation Lock Status: Disabled

Developer:

    Developer Tools:

      Version: 13.3.1 (13E500a)
      Location: /Applications/Xcode_13.3.0.app
      Applications:
          Xcode: 13.3.1 (20103)
          Instruments: 13.3.1 (64552.71)
      SDKs:
          DriverKit:
              21,4:
          iOS:
              15,4: (19E239)
          iOS Simulator:
              15,4: (19E239)
          macOS:
              12,3: (21E226)
          tvOS:
              15,4: (19L439)
          tvOS Simulator:
              15,4: (19L439)
          watchOS:
              8,5: (19T241)
          watchOS Simulator:
              8,5: (19T241)
2022-06-28 20:30:03 -04:00
Manuel de la Pena eee31cb3fa
Should be || not && (#15367) 2022-06-28 20:29:40 -04:00
Manuel de la Pena 19df6512d5
[CI] Stop running pipelines on debug mode. (#15364) 2022-06-28 20:29:24 -04:00
Manuel de la Pena 600eb67bac
[CI] Just collect sim logs on debug. (#15341)
The step takes time and it will be ignored unless we need to debug the
bots/pipeline.
2022-06-28 11:10:56 -04:00
Steve Hawley b4c68ab209
manage DisposableObject (#15355) 2022-06-27 16:02:20 -04:00
Manuel de la Pena 7fa68bc8e5
[CI] Ignore branches that start with dev/* (#15362)
Other teams in xamarin/microsoft do no use forks but use dev branhces.
The correct thing in our repo is to use forks, yet other developers
insist in not following our developement practices. The fact that this
branches are created results in 2 builds:

- One for CI
- On for the PR

It is harder to educate other developers than it is to ignore their
branches, therefore we have added the pattern dev/* to the exclude
list for branches in the CI build.
2022-06-27 14:50:31 -04:00
dependabot[bot] 73681fd173
Bump peterjgrainger/action-create-branch from 2.0.1 to 2.2.0 (#15350)
Bumps [peterjgrainger/action-create-branch](https://github.com/peterjgrainger/action-create-branch) from 2.0.1 to 2.2.0.
- [Release notes](https://github.com/peterjgrainger/action-create-branch/releases)
- [Commits](https://github.com/peterjgrainger/action-create-branch/compare/v2.0.1...v2.2.0)

---
updated-dependencies:
- dependency-name: peterjgrainger/action-create-branch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-27 11:21:36 -04:00
dependabot[bot] 389d09bca4
Bump actions/checkout from 2 to 3 (#15351)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-27 11:20:49 -04:00
dependabot[bot] 8fcf8d0daf
Bump peter-evans/repository-dispatch from 1 to 2 (#15352)
Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 1 to 2.
- [Release notes](https://github.com/peter-evans/repository-dispatch/releases)
- [Commits](https://github.com/peter-evans/repository-dispatch/compare/v1...v2)

---
updated-dependencies:
- dependency-name: peter-evans/repository-dispatch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-27 11:20:34 -04:00
dependabot[bot] 5f6855f021
Bump devmasx/merge-branch from 1.3.1 to 1.4.0 (#15353)
Bumps [devmasx/merge-branch](https://github.com/devmasx/merge-branch) from 1.3.1 to 1.4.0.
- [Release notes](https://github.com/devmasx/merge-branch/releases)
- [Changelog](https://github.com/devmasx/merge-branch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/devmasx/merge-branch/compare/v1.3.1...1.4.0)

---
updated-dependencies:
- dependency-name: devmasx/merge-branch
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-27 11:20:16 -04:00
Naveen 573480b394
chore: Included githubactions in the dependabot config (#15330)
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-06-27 13:23:48 +02:00
Rolf Bjarne Kvinge a55557fd54
[NSObject] Unify some code between iOS and macOS. (#15302)
* Add these methods to shared code so they're available on all platforms
  (they're already available on mobile platforms), since there's no reason to
  exclude them on macOS:
    * NSObject.Init
    * NSObject.Alloc
    * NSObject.InvokeInBackground
* Remove unused usings.
* Move identical code in platform-specific files to shared code.
2022-06-27 12:53:09 +02:00
Manuel de la Pena 1fa2efba62
[CI] Bump the build timeout. (#15345)
There are certain bots misbehaving and taking longer. We believ ethat it
might be due to some throttiling depending on their positio in the lab.
We are increasing the timeout for those cases.
2022-06-24 14:07:24 -04:00
Manuel de la Pena 2521d07ab2
[CI] Do not run introspection unless it has been selected. (#15342) 2022-06-24 12:45:26 -04:00
Peter Collins e39e8e3655
[post-build] Fix Maestro asset publishing (#15339)
Attempts to push build asset information to Maestro started failing
recently:

    D:\a\1\s\xamarin-macios\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21212.6\tools\SdkTasks\PublishBuildAssets.proj(43,5): error MSB4062: The "PushMetadataToBuildAssetRegistry" task could not be loaded from the assembly C:\Users\VssAdministrator\.nuget\packages\microsoft.dotnet.maestro.tasks\1.1.0-beta.20570.1\tools\netcoreapp3.1\Microsoft.DotNet.Maestro.Tasks.dll. Could not load file or assembly 'C:\Users\VssAdministrator\.nuget\packages\microsoft.dotnet.maestro.tasks\1.1.0-beta.20570.1\tools\netcoreapp3.1\Microsoft.DotNet.Maestro.Tasks.dll'. The system cannot find the path specified.

Commit a1d0b6eb looks like it may have broken this, as it changed the
`globalPackagesFolder` used for NuGet packages across the repo.

Looking at [PublishBuildAssets.proj][0] we should be able to set the
`$(NuGetPackageRoot)` property to the new `globalPackagesFolder` value,
fixing attempts to load `Microsoft.DotNet.Maestro.Tasks.dll`.

[0]: b8007eed82/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishBuildAssets.proj (L32)
2022-06-23 16:31:17 -04:00
Manuel de la Pena af69c5787b
[CI] Fix api diff comment (#15337)
Fix writting a comment when not on a PR build.
2022-06-23 14:49:10 -04:00
Steve Hawley 8965dde9a0
[nnyeah] Fix more ctor/handle mapping (#15324)
* Fix more ctor/handle mapping

* Make sure the mapping happens
2022-06-23 14:24:28 -04:00
Manuel de la Pena ab4dac6253
[CI] Fix tests for the pwsh. (#15338)
Fixed the following two issues:

1. Update tests to use the correct constructor.
2. Renamed $context because it is a known pester variable name and would
   get overriden.
2022-06-23 13:31:26 -04:00
Rolf Bjarne Kvinge 897ce7b736
[xharness] Environment variables need to be fetched. (#15316) 2022-06-23 12:15:21 -04:00
Manuel de la Pena 63c69e49c1
[CI] Fix error when collecting the sim logs. (#15333)
We are getting errors with the following:

> Error creating archive at '/Users/builder/azdo/_work/2/s/diagnostic-sim-output/output.tar.gz'.
> Files are still in /Users/builder/azdo/_work/2/s/diagnostic-sim-output/output
> An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=17):
> Unable to write or file already exists
> File exists

we remove the path in case it is present and continue even if there was
an error since it does not imply a test failure.
2022-06-23 12:11:41 -04:00
Manuel de la Pena b1ea4b51aa
[CI] Allow tests to be ran in parallel. (#15322)
This allows the CI to run ALL the tests that the project has in
parallel. This is divided in two main changes:

1. Xharness - We move away from using boolenas to use a flag that states
   the tests to run.
2. yaml - We have move the code to use a template per label. This new
   jobs all run in parallel and the results are later collected by a
   funel job
3. pwsh - Added a new class that understands that we have several mark
   downs with the tests results. The classes parses them and them writes
   a single comment (and example can be found here: https://github.com/xamarin/xamarin-macios/pull/15201#issuecomment-1162366240

The changes gives the following advantages vs how we used to run tests:

1. The CI run for all tests moves from taking 13 hours to 3/4 hours
   (depending on the number of bots in the pool).
2. The download needed to verify the results on a case of failure is
   smaller. Rather than downloading several GBs we now just download
   that part of the html that we are interested in.
3. Better bot utlization. Bots are just used to a max of 2 hours, this
   means that we can use the bots better since they are fragmented.
4. Less VMs. VSDrops has added support for macOS and Linux, we take
   advanges of that here.


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-06-23 08:54:21 -04:00
Manuel de la Pena f02a74af7d
[Tests] Bump Newtonsoft.Json version (#15329)
Bump the version to fix:

* https://github.com/xamarin/xamarin-macios/security/dependabot/1
* https://github.com/xamarin/xamarin-macios/security/dependabot/2

The dependency is in a tests, but this way we make the warning fo away.
2022-06-23 08:51:51 -04:00
Manuel de la Pena 0afa4860b7
[CI] Print the uri that was requested for better debugging. (#15325) 2022-06-23 08:48:58 -04:00
Rolf Bjarne Kvinge 27d131a8e6
A .NET 'servicing' release is also a stable release. (#15311) 2022-06-23 08:56:07 +02:00
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