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

17446 Коммитов

Автор SHA1 Сообщение Дата
Matt Sylvia 6c62a84755 Empty commit to test build-tasks upgrade 2024-08-02 14:45:34 -04:00
Alex Soto 76769f17d5
[main] Enable dedup only when targeting arm64 (#20953)
Backport of https://github.com/xamarin/xamarin-macios/pull/20952

--------

## Description

Previous fix https://github.com/xamarin/xamarin-macios/pull/20945 did
not take into account that when we target non arm64 apple mobile
platforms we are using `MONO_AOT_MODE_INTERP_ONLY` which cannot use
dedup optimization as it discards AOT images during runtime.

## Changes

- Enable dedup only when targeting ARM64
- Fix tests to cover builds for both ARM64 and X64 builds

Finally, the change was tested against MAUI iossimulator-x64 template
app

---------

Co-authored-by: Ivan Povazan <ivan.povazan@gmail.com>
Co-authored-by: Ivan Povazan <55002338+ivanpovazan@users.noreply.github.com>
2024-07-30 08:10:22 -04:00
Peter Collins 11f2ed6bd4
[ci] Update post-build pipeline triggers (#20950)
This post-build pipeline should only run against net8.0 servicing
branches that don't have the commit (2abbaf900b) that moved maestro
publishing into the regular build pipeline.
2024-07-29 18:54:30 -04:00
Ivan Povazan 40a8eba6bf
Do not enable dedup when targeting `maccatalyst-x64` (#20945)
## Description

This is a follow-up PR to:
https://github.com/xamarin/xamarin-macios/pull/20936

We should not enable dedup when targeting `maccatalyst-x64` because in
case when the project file specifies
`MtouchInterpreter=all,-System.Private.CoreLib`, the build will run the
full AOT compiler with interpreter enabled.

In this setup the runtime is configured to run in interp only mode:
97a91cc4e3/tools/common/Target.cs (L812-L813)

which means that during runtime, AOT images will be ignored - aot
runtime will load them but mark them as unusuable since they are
compiled with `full` compiler switch and the code falls back to
interpreter (ref:
efebf202a4/src/mono/mono/mini/aot-runtime.c (L2131-L2148)
)

This is problematic for the `aot-instances` container image, which has a
special handling at the runtime and does not accept it to be marked as
unusable (we might want to revisit this in the future):

efebf202a4/src/mono/mono/mini/aot-runtime.c (L2527-L2529)

## Changes

This PR disables dedup optimization when targeting `maccatalyst-x64` and
updates the required tests to match the behavior.

---

Backports:

- [x] https://github.com/xamarin/xamarin-macios/pull/20946
- [x] Original reenabling of dedup for .NET 9 already includes these
changes: https://github.com/xamarin/xamarin-macios/pull/20941

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2024-07-26 18:44:07 -04:00
Ivan Povazan 97a91cc4e3
Reenable dedup optimization for all AOT modes (#20936)
## Description

As part of the fix for: https://github.com/dotnet/runtime/issues/99248
we disabled dedup optimization in partial/hybrid AOT mode (when both
interpreter and AOT compiler are enabled). This change got backported to
.NET 8 and with the latest servicing release regressed build times and
app sizes significantly as reported in:
https://github.com/xamarin/xamarin-macios/issues/20848

However, it turns out that disabling dedup optimization is not required
to fix https://github.com/dotnet/runtime/issues/99248 but instead we
should correct the Xamarin SDK integration with this optimization which
this PR is doing. The following section describes the initial problem in
more details.

## Overview of AOT modes and dedup optimization

When the repro project from
https://github.com/dotnet/runtime/issues/99248 is built with dedup
enabled in hybrid AOT+interpreter mode, the app crashes with:
```
024-07-23 14:32:37.524110+0200 IvansApp[12711:20244208] debug: AOT NOT FOUND: (wrapper other) object:gsharedvt_out_sig (intptr).
2024-07-23 14:32:37.524120+0200 IvansApp[12711:20244208] error: * Assertion at /Users/ivan/repos/runtime-mono-iOS/src/mono/mono/mini/interp/interp.c:2667, condition `is_ok (error)' not met, function:init_jit_call_info, Attempting to JIT compile method '(wrapper other) void object:gsharedvt_out_sig (intptr)' while running in aot-only mode. See https://learn.microsoft.com/xamarin/ios/internals/limitations for more information.
```

To track down why these wrappers which are used to transition from
interpreter to AOT code, are not generated we need to understand when
they are compiled in different AOT modes with and without dedup
optimization enabled:

- In full AOT setup - all assemblies AOT compiled
    - `gsharedvt_out_sig` methods are never generated

- In hybrid AOT + interpreter setup - all assemblies AOT compiled:
`MtouchInterpreter=-all`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT images of every
assembly (to enable interpreter calling into each specific assembly -
here wrappers with same signatures are duplicated)
    - Dedup ON:
- `gsharedvt_out_sig` methods are generated only in `aot-instances` AOT
image
- during AOT compilation of individual assemblies generation of
`gsharedvt_out_sig` is skipped
- during AOT compilation of `aot-instances` assembly we collect all
`gsharedvt_out_sig` variants from the full program scope and generate
code for them in `aot-instances` AOT image

- In hybrid AOT + interpreter setup - all assemblies interpreted except
a given assembly: `MtouchInterpreter=all,-MyAssembly`
    - Dedup OFF:
- `gsharedvt_out_sig` methods are generated in AOT image of `MyAssembly`
(to enable interpreter calling into it)
    - Dedup ON: <- $${\color{red} ISSUE }$$ 
- `gsharedvt_out_sig` methods *should* be generated only in
`aot-instances` AOT image, but the `aot-instances` image is missing
    - explanation:
- what happens is that generation of `gsharedvt_out_sig` is skipped
during AOT compilation of `MyAssembly` (as expected).
- But, the build does not mark `aot-instances` assembly as the one that
should be AOT compiled.
- The reason for this is that we have a global `_IsDedupEnabled` flag,
but when custom linker step analysis `aot-instances.dll` it does not see
it as an assembly which should not be interpreted.
- To explain that better: we mark *all* assemblies as to be interpreted
(via: `MtouchInterpreter=all`), but exclude only `MyAssembly` (via:
`MtouchInterpreter=all,-MyAssembly`).
- So when custom linker step processes `aot-instaces.dll` it treats it
as an assembly to be interpreted, so it does not mark it for AOT
compilation.
- This further results with `aot-instances` AOT image missing, and all
the methods which we skipped during AOT compilation never get generated.

## The fix

To fix this and address regressions reported in:
https://github.com/xamarin/xamarin-macios/issues/20848 we are reenabling
dedup optimization whenever AOT compilation is requested and fixing the
issue where the custom linker step for generating AOT parameters always
treates the dedup assembly as the one to be AOTed.

Once approved this should be backported to .NET 8 as servicing releases
are also affected with it.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2024-07-25 19:50:21 -04:00
dotnet-maestro[bot] c66b6ea8b7
[main] Update dependencies from dotnet/xharness (#20902)
This pull request updates the following dependencies

[marker]: <> (Begin:601bc5e1-1cae-44b5-cf5f-08db9342aa2f)
## From https://github.com/dotnet/xharness
- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20240708.1
- **Date Produced**: July 8, 2024 9:23:17 PM UTC
- **Commit**: 2c5fdbed5ea74da70649c03084bc01035f35a3fe
- **Branch**: refs/heads/main

[DependencyUpdate]: <> (Begin)

- **Updates**:
- **Microsoft.DotNet.XHarness.iOS.Shared**: [from
9.0.0-prerelease.24354.1 to 9.0.0-prerelease.24358.1][1]

[1]: 0302f46c9d...2c5fdbed5e

[DependencyUpdate]: <> (End)


[marker]: <> (End:601bc5e1-1cae-44b5-cf5f-08db9342aa2f)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2024-07-19 20:46:41 -04:00
Michael Cummings (MSFT) 261a603bc1
Add UseInterpreter as part of the check for DynamicCodeSupport (#20912)
fixes: https://github.com/dotnet/maui/issues/23577

## Cause:
`MtouchInterpreter` is set as
d1ec7a793f/msbuild/Xamarin.Shared/Xamarin.Shared.props (L308)
`DynamicCodeSupport` is set by
d1ec7a793f/dotnet/targets/Xamarin.Shared.Sdk.targets (L146)
`Xamarin.Shared.Sdk.targets` is imported *before* `Xamarin.Shared.props`
as shown below (courtesy of @ivanpovazan)
<img
src="https://github.com/user-attachments/assets/c97b7f01-2372-4f9d-bedf-83060eed1c50">
 
so unless the value of `MtouchInterpreter` is set in the project, it's
value will be empty when the `DynamicCodeSupport` property is evaluated.

## Resolution:
To minimize the impact of this change, until it can be investigated more
fully, the value of `MtouchInterpreter` is evaluated as
d1ec7a793f/msbuild/Xamarin.Shared/Xamarin.Shared.props (L308)
So adding `( '$(MtouchInterpreter)' == '' And '$(UseInterpreter)' ==
'false' )` to the definition of `DynamicCodeSupport` to match the
`MtouchInterpreter` definition.

A further fix might be to either:
1. Reorder the imports so that the props are included before the
targets, although the ramifications of that change could be significant
2. Move the definition of `DynamicCodeSupport` to
`Xamarin.Shared.props`. This at first glance seems to be less
significant than 1) but would need review and testing.

---------

Co-authored-by: Ivan Povazan <55002338+ivanpovazan@users.noreply.github.com>
2024-07-19 15:18:09 -04:00
dotnet-maestro[bot] 54ed26c388
[main] Update dependencies from dotnet/installer (#20897)
This pull request updates the following dependencies

[marker]: <> (Begin:Coherency Updates)
## Coherency Updates

The following updates ensure that dependencies with a
*CoherentParentDependency*
attribute were produced in a build used as input to the parent
dependency's build.
See [Dependency Description
Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

[DependencyUpdate]: <> (Begin)

- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 8.0.5 to 8.0.7 (parent:
Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.AspNetCore.App.Ref**: from 8.0.5 to 8.0.7 (parent:
Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.5 to 8.0.7 (parent:
Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: from
8.0.5 to 8.0.7 (parent: Microsoft.NETCore.App.Ref)
- **Microsoft.NETCore.App.Ref**: from 8.0.5 to 8.0.7 (parent:
Microsoft.Dotnet.Sdk.Internal)

[DependencyUpdate]: <> (End)

[marker]: <> (End:Coherency Updates)






[marker]: <> (Begin:80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb)
## From https://github.com/dotnet/installer
- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20240717.6
- **Date Produced**: July 17, 2024 5:52:17 PM UTC
- **Commit**: b77bfa17bd4c52d32d5bdbd031ddf66da44a06a1
- **Branch**: refs/heads/release/8.0.1xx

[DependencyUpdate]: <> (Begin)

- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.107-servicing.24324.1 to
8.0.108-servicing.24367.6][21]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.5 to 8.0.7][22]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.5 to 8.0.7][23]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.5 to 8.0.7][22]
- **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: [from
8.0.5 to 8.0.7][24]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.5 to 8.0.7][22]

[21]:
03065cafae...b77bfa17bd
[22]:
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime/branches?baseVersion=GC087e15321bb712ef6fe8b0ba6f8bd12facf92629&targetVersion=GC2aade6beb02ea367fd97c4070a4198802fe61c03&_a=files
[23]:
https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore/branches?baseVersion=GCc9e3996173cec136bc2e9f3b4ec45f2a323b1d63&targetVersion=GC2f1db20456007c9515068a35a65afdf99af70bc6&_a=files
[24]: 71359b18c2...a64772f521

[DependencyUpdate]: <> (End)


[marker]: <> (End:80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb)

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2024-07-18 18:36:39 -04:00
Manuel de la Pena ce67ab3f2b
[CI] Clean a number of yamllint issues and update a name to help debug. (#20907)
I have cleaned the yaml files while I was trying to debug the issue with
the provisioning of the simulators on Xcode 16. We should back port this
change there.
2024-07-17 13:25:49 -04:00
Rolf Bjarne Kvinge d1ec7a793f
[tests] Fix determining whether we're building for the simulator or not. (#20852)
The 'Platform=iPhoneSimulator' property is not necessarily set for .NET
projects, so don't rely on it.
2024-07-12 18:46:17 +02:00
Rolf Bjarne Kvinge 01400da900
[xtro] Get libclang-mono.dylib from where sharpie is. (#20815)
This fixes a crash when using a locally built sharpie - in which case we
shouldn't use the system libmono-clang.dylib, but the locally built one too.
2024-07-12 18:40:21 +02:00
Rolf Bjarne Kvinge cfff12457c
[msbuild] Add support for signing with the placeholder key. (#20823)
Add support for signing with a placeholder key ("-") from the developer,
and then use this to sign the prebuilt HotRestart app this way.

The app will have to be signed anyway on the end user machine, so this
shouldn't have any real effect (I've tested it locally and Hot Restart
still works).

This simplifies our build (both locally and on bots), because we won't
need a certificate around to do the actual signing.
2024-07-12 17:34:51 +02:00
Rolf Bjarne Kvinge 219c74a3c4
[xcode15.4] Update bindings to Xcode 15.4 (#20865)
Co-authored-by: Alex Soto <alex@soto.dev>
2024-07-11 14:09:52 -04:00
Manuel de la Pena c49df7ddc0
[CI] Allow to execute the push even when we have had warnings. (#20873)
If we get a warning from one of the governance tools, not an error but a
warning, we should be allowed to push to the nuget feeds.
2024-07-11 12:25:06 -04:00
Manuel de la Pena 67e056e14f
[CI] Ensure that the signing jobs do upload binlogs. (#20871)
We have had issues with the signing steps, allow us to grab all bin logs
to be able to debug.
2024-07-11 12:19:53 -04:00
Alex Soto 2e5ef1eb1c
[xcode15.3] Bump to Xcode 15.3 bindings (#20780)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-07-11 11:41:31 +02:00
dotnet-maestro[bot] a557dbc884
[main] Update dependencies from dotnet/xharness (#20829)
This pull request updates the following dependencies

## From https://github.com/dotnet/xharness

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20240704.1
- **Date Produced**: July 4, 2024 2:21:08 PM UTC
- **Commit**: 0302f46c9df3a01533fc7b911a77b3507af64e15
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.24326.1 to 9.0.0-prerelease.24354.1][1]

[1]: c1a7044cbe...0302f46c9d
2024-07-11 11:33:58 +02:00
Rolf Bjarne Kvinge 4fd259d4dc
[tests] Simplify NWPathTest.EnumerateGatewayTest (#20853)
* Remove code to test NWPath.EnumerateInterfaces, because this method is already tested elsewhere.
* Assume that if the test fails to find any gateways, it might be because the
  current machine doesn't have any (which happens on one of my machines), and
  in that case ignore the test.
2024-07-10 21:40:50 +02:00
Rolf Bjarne Kvinge b3fc0d93ec
[src] Implement a more generic way of calling objc_msgSend with variadic arguments. (#20832)
Move the architecture-specific vargs implementation of UIAppearance.GetAppareance into a more generic way of calling objc_msgSend with variadic arguments.

This prepares the way for more APIs with variadic arguments (which is coming in Xcode 16).
2024-07-10 21:19:51 +02:00
Rolf Bjarne Kvinge ed77cd6224
[dotnet] Limit custom dotnet/runtime selection to the current .NET version. (#20840)
This way any tests using the previous .NET version still works.
2024-07-10 16:30:34 +02:00
Rolf Bjarne Kvinge 7ddf1284a5
[dotnet] Force 'AppendRuntimeIdentifierToOutputPath=true' for the inner build of universal apps. (#20839)
When building universal apps, each inner build must add the runtime identifier to the output path, otherwise the inner builds may conflict with eachother, overwriting eachother's files.

That's bad.

So we explicitly set `AppendRuntimeIdentifierToOutputPath` to `true` when building inner builds.
2024-07-10 13:00:05 +02:00
Rolf Bjarne Kvinge f2ae944988
[system-dependencies] Only download the simulators for platforms we target. (#20842)
In particular we don't need the visionOS simulator/platform.
2024-07-10 12:58:16 +02:00
Rolf Bjarne Kvinge 180a7e0bb9
[tests] Fix a couple of minor issues. (#20843)
* xtro: Fix how we build the u2todo project to actually build the correct project.
* Don't import eng/Versions.props in several test projects, it's already imported in a Directory.Build.props further up the directory hierarchy.
2024-07-10 12:57:30 +02:00
Manuel de la Pena 6ac0fe15fc
[CI] Disable CodeQL for signing classic since it gives problems. (#20834) 2024-07-09 11:26:30 -04:00
Rolf Bjarne Kvinge 808fb1f115
[system-dependencies] Split simulator installation. (#20837)
Split installing new and old simulators, so that we can choose to only
install the old simulators if we want so.

And then only install the old simulators when we're doing beta builds,
because that's the only time we need them.
2024-07-09 17:03:13 +02:00
Rolf Bjarne Kvinge c81cb4aa77
[xtro] Move xtro-sharpie.csproj to its own directory. (#20825)
This will make it easier to eventually migrate this project to .NET.
2024-07-09 16:25:39 +02:00
Rolf Bjarne Kvinge 83e3951c37
[Darwin] Treat this code as a framework, which simplifies things a little bit. (#20833)
Also move the TimeSpec struct to its own file, this will be necessary
for Xcode 16.
2024-07-09 16:24:26 +02:00
Rolf Bjarne Kvinge 1520e0ebbc
[tests] Update 'KnownFrameworkReference' and 'KnownRuntimePack' to the reference the correct dotnet/runtime version when using a custom dotnet/runtime. (#20838) 2024-07-09 14:17:58 +02:00
Manuel de la Pena 122ed73df5
[CI] We must pass the signing too in order to be able to push nugets. (#20836) 2024-07-08 23:08:31 -04:00
Manuel de la Pena 35240f75ed
[CI] Provide display name for paramenters. (#20835) 2024-07-08 22:37:10 -04:00
Rolf Bjarne Kvinge e840379342
[tools] Ignore a few warnings by default. Fixes #20670. (#20805)
Ignore a few warnings by default, when reporting about types that we
couldn't register because they're deprecated/removed.

Also add a way to re-enable these warnings.

Fixes https://github.com/xamarin/xamarin-macios/issues/20670.
2024-07-08 19:28:01 +02:00
Rolf Bjarne Kvinge 26ede64161
[tests] Make the generator tests in the Makefile use the locally installed Xamarin.iOS/Xamarin.Mac. (#20821) 2024-07-08 18:30:36 +02:00
Rolf Bjarne Kvinge ddaf7822f9
[devops] Copy XMA's NuGet.config to XMA's home directory. (#20819)
This way we're using the same NuGet configuration even when executing outside
of XMA's .NET directory.

Also collect a bit more diagnostic info.
2024-07-08 18:30:21 +02:00
Rolf Bjarne Kvinge 544b96817f
[xtro] Fix version comparison with macOS 10.7. (#20816)
This also required updating the xtro files.
2024-07-08 18:30:14 +02:00
Rolf Bjarne Kvinge 71acf6a588
[bgen] Add simple makefile. (#20789)
Add a simple makefile to the src/bgen directory that only builds and
tests bgen.

This is very useful when working on bgen to make sure your changes are
at building and working.
2024-07-05 15:01:47 +02:00
Rolf Bjarne Kvinge 9582522ccb
[xtro] Convert most projects to .NET projects. (#20760)
Convert all projects except xtro-sharpie.csproj to .NET projects.
xtro-sharpie.csproj can't be converted yet, because it depends on
Objective-Sharpie, which hasn't been converted yet.
2024-07-05 14:54:29 +02:00
Rolf Bjarne Kvinge 91ffc65e85
[msbuild] Show a slightly better warning message when trying to expand TeamIdentifierPrefix/AppIdentifierPrefix without a provisioning profile. (#20759)
By including the key and the offending value in the warning message.
2024-07-04 16:38:31 +02:00
Rolf Bjarne Kvinge c930ab321b
[monotouch-test] Remove ignore for Mac Catalyst. (#20810)
Apple says the bug on their side causing a runtime crash has been fixed since
macOS 12, so unignore the code and add a version check for macOS 12.

Fixes https://github.com/xamarin/maccore/issues/2345.
2024-07-04 14:16:38 +02:00
Rolf Bjarne Kvinge 7f2c575b40
[siminstaller] Don't use the C# compiler server. (#20812)
The C# build server makes trouble for us, because:

* We're using parallel make, and parallel make will start a jobserver, managed
  by file descriptors, where these file descriptors must be closed in all
  subprocesses for make to realize it's done.
* 'dotnet build' might have started a build server
* The build server does not close any file descriptors it may have inherited
  when daemonizing itself.
* Thus the build server (which will still be alive after we're done building)
  might have a file descriptor open which make is waiting for.
* The proper fix is to fix the build server to close its file descriptors.
* The intermediate working is to shut down the build server instead. An
  alternative solution would be to pass /p:UseSharedCompilation=false to
  'dotnet pack' to disable the usage of the build server.
* Note that build server will exit automatically after 10 minutes of idle
  time, so the hang is only a 10 minute delay at works.

For the siminstaller, which builds using the system .NET, the simplest
solution is to just not use the build server.

This fixes a problem where the build would hang for 10 minutes after running
the system dependency check (which builds and runs siminstaller).
2024-07-04 14:16:12 +02:00
dotnet-maestro[bot] 63b4703d02
[main] Update dependencies from dotnet/xharness (#20770)
This pull request updates the following dependencies

## From https://github.com/dotnet/xharness

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20240626.1
- **Date Produced**: June 26, 2024 1:01:59 PM UTC
- **Commit**: c1a7044cbe36ea67281412766a417eece02fb3a5
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.24312.3 to 9.0.0-prerelease.24326.1][2]

[2]: 6ce15319de...c1a7044cbe
2024-07-03 21:55:56 +02:00
dotnet-maestro[bot] 7e615b07ad
[main] Update dependencies from dotnet/installer (#20753)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20240624.1
- **Date Produced**: June 24, 2024 9:52:55 PM UTC
- **Commit**: 03065cafae0f89b376fa983773e909e341db96c0
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.107-servicing.24317.4 to 8.0.107-servicing.24324.1][14]

[14]: de7be3dce6...03065cafae

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-07-03 20:20:29 +02:00
Rolf Bjarne Kvinge 6da82734ee
[src/tools] Propagate the BackwardsCompatibleCodeGeneration field from Protocol attributes in bindings to the generated code. (#20804)
Also fix the MustSetBackwardsCompatibleCodeGenerationToFalse test to skip
protocols that actually set BackwardsCompatibleCodeGeneration=false.
2024-07-03 20:18:13 +02:00
Rolf Bjarne Kvinge 323d28c220
[Foundation] Make the generic collection classes' generic GetEnumerator methods public. (#20808)
When finding an enumerator for the given code:

```cs
var collection = new NSSet<NSNumber> ();
foreach (var item in collection) {
	// ...
}
```

the C# compiler will first look for any `GetEnumerator` methods. The non-generic `NSSet` class defines a `IEnumerator<NSObject> GetEnumerator<NSObject> ()` method, which, since the generic `NSSet<T>` class doesn't define such a method, is selected.

The end result is that the type of the foreach element is `NSObject`
(`GetEnumerator`'s return type') - which is somewhat unexpected:

```cs
var collection = new NSSet<NSNumber> ();
foreach (var item in collection) {
	Console.WriteLine (item.LongValue); // error CS1061: 'NSObject' does not contain a definition for 'LongValue'
}
```

The fix is to define a  `IEnumerator<T> GetEnumerator<T> ()` method in the
generic `NSSet<T>` class, which the C# will find and choose over the base
class' method. Then the type of the foreach element is the correct type, and
the following code works:

```cs
var collection = new NSSet<NSNumber> ();
foreach (var item in collection) {
	Console.WriteLine (item.LongValue); // it works!
}
```

Do this for all our generic collection classes.

Also document these methods + all the other public `GetEnumerator` methods.
2024-07-03 20:16:53 +02:00
Rolf Bjarne Kvinge 95df610900
[build] Parameterize the .NET download script url. (#20806)
This way it can easily be overridden when building from the command line (to provide a different url if the normal url doesn't work for some temporary reason).
2024-07-03 20:12:40 +02:00
Manuel de la Pena 9a888820b5
[CI] Disable the governance checks on the tests. (#20797)
Disable the autoinjected governance checks in the tests templates since
they timeout on the mac.

ref: https://docs.opensource.microsoft.com/tools/cg/index.html
2024-07-01 16:58:32 -04:00
Mike Bond a3f61a970e
Backport bot: Use managed identity (MI) authorization (#20798) 2024-07-01 13:14:18 -07:00
Rolf Bjarne Kvinge a28cf64a8c
[msbuild] Don't support RuntimeIdentifiers for Hot Restart. (#20750)
There's no need to support `RuntimeIdentifiers` (plural) for Hot Restart
(because we don't have any scenarios where multiple runtime identifiers
applies to iOS; a single runtime identifier can always be used).

Adding support would make our code base more complex, so just avoid it by
showing an early error if someone tries (which is likely to be accidental
anyways).

This way we show an actionable error message for a scenario customers will
probably be confused about (because the build would fail in rather
inexplicable ways) if they run into it.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/19262.
2024-07-01 19:26:57 +02:00
Rolf Bjarne Kvinge b30dc91f99
Revert "Migrate Messaging Build agent to .NET 8 (#20705)" (#20790)
This reverts commit f8552e9294.

This change is only supposed to be released with .NET 9, and we might
release new .NET 8 updates from main. Thus we need to make sure these
changes are only in the net9.0 branch (they already are).
2024-07-01 18:25:55 +02:00
Manuel de la Pena 002eeddaf4
[CI] Fix credscan by checking out all the repos used for buildng. (#20788)
We fixed the credscan issue in two diff ways:
1. When the job allows it, we checkout all repos using our own checkout template.
2. When the jib does not allow it, we create an empty json file. In the future we can add any needed exception.

We also needed to fix the signature because the VS code moved to net core which changed the extension of their build.exe to build.dll.
2024-06-27 23:44:24 -04:00
Rolf Bjarne Kvinge 5f7792ab91
[tests] Fix BuildBindingsTest expectations. (#20768)
Fix BuildBindingsTest expectations to expect the resources in either a sidecar or a zipped sidecar.

Fixes this test failure:

    Xamarin.Tests.DotNetProjectTest.BuildBindingsTest(TVOS): Bundle existence
    Expected: file or directory exists
    But was: "/Users/builder/azdo/_work/1/s/xamarin-macios/tests/bindings-test/dotnet/tvOS/bin/Debug/net8.0-tvos/bindings-test.resources.zip"
2024-06-27 09:38:12 +02:00