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

17419 Коммитов

Автор SHA1 Сообщение Дата
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
Rolf Bjarne Kvinge 9b7ff19b47
[src] Fix definition of AVSampleCursorAudioDependencyInfo for Mac Catalyst. (#20781)
We need the backwards compatible code for the
AVSampleCursorAudioDependencyInfo struct (i.e. use the
AVSampleCursorAudioDependencyInfo_Blittable version), so adjust the ifdefs
accordingly - which wasn't obvious at first, because __IOS__ is defined for
Mac Catalyst.

Also fix the corresponding test, because it would cache the result of
computing whether a struct was blittable or not, but that's not true across
platforms ("AVSampleCursorAudioDependencyInfo" is blittable on iOS, but not on
Mac Catalyst). The result was that the test would incorrectly pass if we
processed Microsoft.iOS.dll before Microsoft.MacCatalyst.dll. The fix is to
cache per platform, instead of using a global cache.
2024-06-26 14:17:58 +02:00
Rolf Bjarne Kvinge 02e14e6e77
[msbuild] Update values we put in the generated Info.plist for Xcode archives. (#20719)
* Set the Architectures array, which Xcode does. This requires passing RuntimeIdentifier(s)
  to the task, so do that.
* Set SchemeName, which Xcode does.

This is a partial fix for https://github.com/xamarin/xamarin-macios/issues/20714.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2024-06-25 14:30:47 +02:00
Manuel de la Pena 3138e62995
[CI] Use the default credscan setup except for the exclusion. (#20765)
The configuration was giving issues in one of the jobs with binaries.
Using the default fixes the issue.
2024-06-24 11:19:32 -04:00
Emanuel Fernandez Dell'Oca f8552e9294
Migrate Messaging Build agent to .NET 8 (#20705)
This is part of the effort to migrate the Pair to Mac agents .NET.

As the Xamarin.iOS.Tasks.Windows project targets netstandard2.0, I'm
removing the Build agent reference, and modifying the Makefile to take
it from it's output directory. Note: the agent zip file is generated in
the intermediate output directory.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-06-24 14:10:15 +02:00
Rolf Bjarne Kvinge 2f9ddc1933
[Foundation] Add missing properties to NSCharacterSet. Fixes #20745. (#20761)
Fixes https://github.com/xamarin/xamarin-macios/issues/20745.
2024-06-21 18:37:16 +02:00
Rolf Bjarne Kvinge e15955bb67
[siminstaller] Fix the binlog location during the build. (#20755) 2024-06-21 10:41:21 +02:00
Manuel de la Pena fe9f5f15b3
[CI] Fix a failing pwsh test. (#20758) 2024-06-20 18:41:08 -04:00
Manuel de la Pena 35690fc99b
[Governance] Adapt the APIScan arguments to the new version of the cmd. (#20757) 2024-06-20 18:21:26 -04:00
Manuel de la Pena e615133676
[CI] Expose all the CI build variables of the parent (#20749)
This change allows cascading pipelines to download the configuration
file and use it rather than recalculating the configuration. This is the
first step to ensure that cascading pipelines use the same config, a
second one is needed to load the configuration in those pipelines.

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-06-20 18:20:29 -04:00
Manuel de la Pena 29560c5758
[CI] Disable the credscan step on the signing job since 1ES has a bug with it. (#20756) 2024-06-20 18:20:08 -04:00
dotnet-maestro[bot] 8720672ff6
[main] Update dependencies from dotnet/installer (#20742)
This pull request updates the following dependencies

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

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20240617.4
- **Date Produced**: June 17, 2024 6:20:02 PM UTC
- **Commit**: de7be3dce619f5998e041962b4a1062cc44bfd37
- **Branch**: refs/heads/release/8.0.1xx

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

[2]: 8882eb09fc...de7be3dce6
2024-06-20 08:29:01 +02:00
Manuel de la Pena c855596467
[CI] Reduce dependecies on the maccore repo. (#20748)
Move the config files to the macios repo since they have no private
info.
2024-06-19 21:54:12 -04:00
Manuel de la Pena 9255b00592
[CI] On-board the build pipeline to 1ES. (#20735)
Few comments:

1. Extends cannot be used on templates. So we have to do a single extend
and have duplicated code.
2. There are some common templates that we are working around using the
use1ES parameter.
3. We are reusing the configure steps on other pipelines. That step
should only be done in the build, that change is too big for this PR.
4. The governance template is not longer needed since the 1ES template
provides it.

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-06-19 10:53:20 -04:00
Rolf Bjarne Kvinge fc6ce95b52
[runtime] Convert the bindings-generator.csproj project to a .NET project. (#20743) 2024-06-19 15:11:28 +02:00
Rolf Bjarne Kvinge 10f3b5ae32
[tests] Convert the testgenerator.csproj to a .NET project. (#20740) 2024-06-19 15:10:54 +02:00
Rolf Bjarne Kvinge 47806611e7
[siminstaller] Convert to .NET project. (#20739)
In addition to being good by itself, by fixing all the resulting nullability
warnings, this random problem goes away:

    Unhandled Exception:
    System.NullReferenceException: Object reference not set to an instance of an object
      at xsiminstaller.MainClass.Main (System.String[] args) [0x006ca] in /Users/builder/azdo/_work/4/s/xamarin-macios/tools/siminstaller/Program.cs:228
    [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
      at xsiminstaller.MainClass.Main (System.String[] args) [0x006ca] in /Users/builder/azdo/_work/4/s/xamarin-macios/tools/siminstaller/Program.cs:228

Also use HttpClient instead of WebClient (which is deprecated).
2024-06-19 15:10:39 +02:00
dotnet-maestro[bot] 1bb1648b6c
[main] Update dependencies from dotnet/xharness (#20733)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20240612.3
- **Date Produced**: June 12, 2024 7:26:05 PM UTC
- **Commit**: 6ce15319de72ab6d4c3b0f4c40f59300cffc5450
- **Branch**: refs/heads/main

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

[1]: 03a55dc446...6ce15319de
2024-06-19 15:06:42 +02:00
Rolf Bjarne Kvinge 6c2a7a9eac
[msbuild] The DTPlatformName is supposed to be 'macosx' for Mac Catalyst. (#20720)
Change how we compute DTPlatformName so that it's 'macosx' for Mac Catalyst.
The PlatformUtils.GetTargetPlatform returns SdkPlatform for all platforms
except Mac Catalyst, where it returns the same as for macOS (i.e. 'macosx').
It also returns a lowercased value, so we don't need to do that either.

This is a partial fix for https://github.com/xamarin/xamarin-macios/issues/20714.
2024-06-17 20:19:06 +02:00
dotnet-maestro[bot] f2c5cc5a6b
[main] Update dependencies from dotnet/installer (#20721)
This pull request updates the following dependencies

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

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20240611.1
- **Date Produced**: June 11, 2024 9:45:46 PM UTC
- **Commit**: 8882eb09fcade072ffad12ad477b91bdefa5fe12
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.107-servicing.24306.1 to 8.0.107-servicing.24311.1][6]

[6]: 0fea32701d...8882eb09fc
2024-06-17 15:54:29 +02:00
Manuel de la Pena 38ef781bbe
[CI] Remove the need to checkout the sdk-insertions repor to run the tests. (#20726) 2024-06-14 09:15:41 -04:00
Manuel de la Pena 8a0acaf547
[CI] Remove the need to refer to the insertions repo in the api diff. (#20725) 2024-06-13 23:29:44 -04:00
Manuel de la Pena bdde9115ec
[CI] Move the API diff outside of the normal build CI. (#20699)
The api diff generates a number of artefacts that are not released. The
way it works is that it compiles the project twice and compares the
reuslts, therefore it has no dependency on the build pipeline or in the
tests. Moving the step to its own pipeline simplifies the migration to
the 1ES template AND allows use to identify exactly what failed.

The two new pipelines are:

- ci:
https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=9690468&view=results
- pr: https://dev.azure.com/devdiv/DevDiv/_build?definitionId=22268

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-06-12 16:20:16 -04:00
Rolf Bjarne Kvinge f0d4375295
[devops] Remove logic to detect if the tests failed to build before reporting results. (#20715)
This check is redundant now, because the post-build test pipeline just
won't run in this case.

This fixes an issue where the GitHub comment reports 0 tests passing,
because we'd detect that the tests failed to build even when they didn't.
2024-06-12 14:12:13 +02:00
Manuel de la Pena 9b8cf0d9ba
[CI] Fix the comments by using the variable from the checkout template. (#20703)
There is no need to pass the GIT_HASH variable from job to job since it
is calculated by the checkout template in the fix_commit step. We just
need to update the variables usage.
2024-06-12 09:44:56 +02:00
Rolf Bjarne Kvinge aff1b3c95d
[CoreFoundation] Fix memory leak in CFProxySupport. (#20713)
The Xcode 16 release notes have this note:

    CFNetwork Resolved Issues

    * Fixed: CFNetworkExecuteProxyAutoConfigurationScript and
      CFNetworkExecuteProxyAutoConfigurationURL have always returned a +1
      retained CF type object, but the function declarations were not
      decorated with the CF_RETURNS_RETAINED attribute until iOS 18, macOS 15,
      tvOS 18, and visionOS 2.

      For C-based languages, the clang static analyzer might note if the
      object is leaked. No source code changes are required, but they are
      encouraged to fix the leak.

      For Swift, this changes the return type of these functions from
      Unmanaged<> to the actual CF type returned, which will require a source
      change to fix when compiling with newer SDKs. However, Swift programs
      compiled with older SDKs will continue to work on the new OSes, though
      the returned CF type object will continue to leak as it did prior to
      this change. (126154509)

So update our code accordingly to take into account that
CFNetworkExecuteProxyAutoConfigurationScript and
CFNetworkExecuteProxyAutoConfigurationURL return retained objects.
2024-06-11 16:52:15 +02:00
Rolf Bjarne Kvinge 0f2a3df282
[devops] Remove dead code referring to xamarin-storage. (#20708) 2024-06-10 21:34:48 +02:00
Rolf Bjarne Kvinge 9c2bd68d92
[src] Remove a few MarshalAs attributes in various APIs. (#20704)
In these cases the APIs in question aren't used in P/Invokes at the moment,
but that may change, so just make as much as we can blittable by removing any
MarshalAs attributes.
2024-06-10 19:11:47 +02:00