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

181 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 23dffef8c4
[xharness] Remove a lot of legacy code. (#21419) 2024-10-16 19:07:09 +02:00
Rolf Bjarne Kvinge e63de079a6
[tests] Remove dead code. (#21422)
This logic was intented to zip up the .NET unit tests to run them on Windows,
but in the end we went with a different approach that doesn't require zipping.
2024-10-15 09:24:47 +02:00
Rolf Bjarne Kvinge 43cd02dc23
[msbuild] Improve the error message when the SupportedOSPlatformVersion is lower than the minimum. Fixes #21368. (#21369)
This isn't very user friendly:

    ILLink : unknown error IL7000: An error occurred while executing the custom linker steps. Please review the build log for more information.
    ILLINK : error MT0073: Microsoft.iOS 18.0.8337 does not support a deployment target of 10.0 for iOS (the minimum is 11.0). Please select a newer deployment target in your project's Info.plist or change the SupportedOSPlatformVersion property in your project file.
    ILLINK : error MT2301: The linker step 'Setup' failed during processing: Microsoft.iOS 18.0.8337 does not support a deployment target of 10.0 for iOS (the minimum is 11.0). Please select a newer deployment target in your project's Info.plist or change the SupportedOSPlatformVersion property in your project file.
    [...]/packages/microsoft.net.illink.tasks/8.0.8/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.

So improve this to only show a single error message:

    The SupportedOSPlatformVersion value '10.0' in the project file is lower than the minimum value '11.0'.

Fixes https://github.com/xamarin/xamarin-macios/issues/21368.
2024-10-10 20:10:04 +02:00
Rolf Bjarne Kvinge 9daafdae64
[builds] Remove all legacy logic. (#21307)
We still need some of the source files from the legacy Mono library, but it's
only a few files, so just add them to the git repo.

Also implement caching of the .NET download, which speeds up clean rebuilds
significantly.

Note: all the files in the `builds/mono-ios-sdk-destdir` are a straight import
from the Mono archive, so those shouldn't need much reviewing (nor will I
change them unless absolutely necessary).
2024-10-10 14:21:42 +02:00
Rolf Bjarne Kvinge 5ef0d91b33
[msbuild/tests] Use 'dotnet test' for the MSBuild tests (take 2). (#21363)
This is another step towards removing Mono.

This required a few changes:

* Nullability updates in test code.
* Explicitly sorted list of strings in a warning message, to make the warning text stable.
* Stopped allowing the test assemblies to see internals of the task assembly. This was necessary for to solve a problem with duplicate types:
    * The netstandard2.0 version of `System.Reflection.Metadata.dll` contains
      the `UnconditionalSuppressMessageAttribute` type (internally).
    * Since we ILMerge the tasks assembly, this type ends up in
      Xamarin.iOS.Tasks.dll (internally).
    * The test assembly can't be a net472 assembly, because that means using
      the netfx/desktop versions of the Microsoft.Build.* assemblies, which
      don't work on .NET (they check for Mono, but .NET isn't Mono, so the
      check fails and a PlatformNotSupportedException is thrown).
    * So I bumped the test assembly to be a net8.0 assembly, but then there's
      a conflict between the `UnconditionalSuppressMessageAttribute` shipped
      in .NET vs the one in `Xamarin.iOS.Tasks.dll` (because the test assembly
      can see the internals of `Xamarin.iOS.Tasks.dll`).
    * The fix that _doesn't work_ is to not merge system assemblies in the
      `Xamarin.iOS.Tasks.dll` assembly anymore. `Xamarin.iOS.Tasks.Windows.dll`
      already does this, but it doesn't work when building remotely.
    * The fix that seems to work is to just not allow the test assemblies to
      see the internals of the task assembly. This is really an anti-pattern
      anyway, so no big loss. This required a few changes (make some API in
      the task assembly public, remove some legacy tests that don't apply
      anymore in .NET, etc.)
2024-10-07 18:14:01 +02:00
Rolf Bjarne Kvinge 129ab97506
[tests] Fix generation for a few variables in test[-system].config. (#21344)
Lines end with a newline character...
2024-10-03 19:12:57 +02:00
Rolf Bjarne Kvinge abcec04b75
Revert "[msbuild/tests] Use 'dotnet test' for the MSBuild tests. (#21263)" (#21356)
This reverts commit 15c1e7527e.

It breaks the Windows tests.
2024-10-02 19:51:31 +02:00
Rolf Bjarne Kvinge 15c1e7527e
[msbuild/tests] Use 'dotnet test' for the MSBuild tests. (#21263)
This is another step towards removing Mono.

This required a few changes:

* Nullability updates in test code.
* Explicitly sorted list of strings in a warning message, to make the warning text stable.
* Stopped merging system assemblies in the merged tasks assembly. This was necessary for to solve a problem with duplicate types:
    * The netstandard2.0 version of `System.Reflection.Metadata.dll` contains
      the `UnconditionalSuppressMessageAttribute` type (internally).
    * Since we ILMerge the tasks assembly, this type ends up in
      Xamarin.iOS.Tasks.dll (internally).
    * The test assembly can't be a net472 assembly, because that means using
      the netfx/desktop versions of the Microsoft.Build.* assemblies, which
      don't work on .NET (they check for Mono, but .NET isn't Mono, so the
      check fails and a PlatformNotSupportedException is thrown).
    * So I bumped the test assembly to be a net8.0 assembly, but then there's
      a conflict between the `UnconditionalSuppressMessageAttribute` shipped
      in .NET vs the one in `Xamarin.iOS.Tasks.dll` (because the test assembly
      can see the internals of `Xamarin.iOS.Tasks.dll`).
    * The fix that seems to work is to *not* merge system assemblies in the
      `Xamarin.iOS.Tasks.dll` assembly. `Xamarin.iOS.Tasks.Windows.dll`
      already does this, so hopefully there are no problems on Windows, and on
      macOS our tests doesn't reveal any problems.
2024-10-01 17:54:27 +02:00
Rolf Bjarne Kvinge b327bcc493
[tests] Remove mono-native logic. (#21312)
It's only for legacy Xamarin.
2024-10-01 01:03:06 +02:00
Rolf Bjarne Kvinge ba954b9c24
[builds] Delete most of the legacy logic. (#21239) 2024-09-20 17:44:15 +02:00
Rolf Bjarne Kvinge cc1412c67b
Merge xcode16 into main. (#21260) 2024-09-19 08:57:07 +02:00
Rolf Bjarne Kvinge 6fa626f3ac
[tests] Remove the BCL tests. (#21197)
They're legacy Xamarin only, which we don't support anymore.
2024-09-18 17:59:23 +02:00
Rolf Bjarne Kvinge 00ec47ae39 Merge remote-tracking branch 'origin/main' into dev/rolf/bump-main-in-xcode16-2024-09-13 2024-09-17 06:57:03 +02:00
Rolf Bjarne Kvinge a52f186066 [xcode16] Merge main into xcode16. 2024-09-13 15:53:38 +02:00
Rolf Bjarne Kvinge 5fd9438bde
[tools/install-source] Remove. (#21195)
This is legacy only, so we don't need it anymore.
2024-09-13 15:49:53 +02:00
Rolf Bjarne Kvinge 3245946fdc
[xtro] Remove all legacy Xamarin bits. (#21196) 2024-09-13 15:49:13 +02:00
Rolf Bjarne Kvinge 674ded4af4
[xcode16] Use [Experimental] instead of [RequiresPreviewFeatures]. (#21178)
This is because `EnablePreviewFeatures=true` doesn't quite work, since it
requires the building .NET and the target .NET to be on the same version.

We might want to build with .NET 9, but the Xcode branch is targeting .NET 8,
so it doesn't work.

This behavior is explained here:
https://github.com/dotnet/designs/blob/main/accepted/2021/preview-features/preview-features.md#meaning-of-property-in-multi-targeted-projects

The best solution seems to switch to using the Experimental attribute instead,
which was designed for our scenario (and explicitly to fix the problem we're
running into): bba3216250/accepted/2023/preview-apis/preview-apis.md

This also meant we had to augment `-nowarn` for bgen to:

* Pass any nowarn values to the compiler when bgen compiles stuff.
* Pass `$(NoWarn)` (the MSBuild property) to bgen when building a binding project.

---------

Co-authored-by: Alex Soto <alex@soto.dev>
2024-09-10 16:11:58 +02:00
Rolf Bjarne Kvinge 53d21b14db
[xharness] Add launch.json/tasks.json for xharness. (#20428) 2024-04-16 17:36:15 +02:00
Rolf Bjarne Kvinge cbec66db7d
[tests] Ignore the VerifyEveryVisibleMemberIsDocumented test if the Xamarin bits aren't enabled. (#20321)
Our tool to inject documentation for Apple APIs live in maccore, so if that
part of the build isn't enabled, we'll get a lot of false positives.

Instead just ignore the test if the Xamarin bits (in maccore) aren't enabled.
2024-03-20 06:28:45 +01:00
Rolf Bjarne Kvinge a8a0132b56
[tests] Make the 'run-tests' and 'run-unit-tests' targets equivalent. (#20223)
I keep forgetting which makefile / test suite uses which run-* target, so just
make both work everywhere.
2024-03-01 09:54:33 +01:00
Rolf Bjarne Kvinge f6a5b6a4ab
[tests] Fix calling 'dotnet build' by actually passing 'build'. (#20038) 2024-02-06 14:43:47 +01:00
Rolf Bjarne Kvinge a80afad774
[tests] Build the msbuild tests with .NET. (#19918)
We already build the msbuild solution with .NET, so this is just playing
catchup.
2024-01-26 15:50:45 +01:00
Rolf Bjarne Kvinge f49188290d
[tests] Disable the BCL tests by default. (#19802)
A few facts:

* We very rarely bump Mono (which is really the only time we should run the BCL tests).
* At the moment we're not shipping legacy Xamarin packages from main anymore.
* The BCL tests only apply to legacy Xamarin.

means that there's no need to run the BCL tests on every commit, we can just
run them manually *if* we happen to ever bump Mono again *and* we start
shipping legacy Xamarin packages from main again.
2024-01-15 16:28:51 +01:00
Rolf Bjarne Kvinge 107d644b55
[xharness] Convert to .NET. (#19541)
* Convert xharness.csproj and Xharness.Tests.csproj to .NET/sdk-style projects.
* Fix numerous nullability issues that came up.
* Adjust Make logic to do the correct thing now that the executable is named differently.
* Port usage of WebClient to HttpClient, since WebClient is deprecated.
* Find an alternative solution to System.Web.MimeMapping.GetMimeMapping, which
  doesn’t exist in .NET.
* Fix misc other warnings and errors.
2023-12-06 15:57:12 +01:00
Rolf Bjarne Kvinge eaa69e79b7 [tests] Add multi-targeting test. 2023-09-06 11:32:54 +02:00
Rolf Bjarne Kvinge 45225dc88d
[dotnet] Parameterize the pack names. (#18732)
We're going to change the pack names to support multi-targeting, so ahead
of the pack name change I'm changing the existing logic to use a variable
for the pack name in most places (this will make the rename much easier and
simpler).

These changes should have no effect by themselves.
2023-08-29 10:06:46 +02:00
Rolf Bjarne Kvinge 8cff397db0
[tests] Fix adding no files to package-test-libraries.zip. (#18307)
If only some platforms are enabled, some of the commands to find files to add
to package-test-libraries.zip won't find any files at all.

Asking 'zip' to add no files fails with:

    zip error: Nothing to do!

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

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

    "find ... -exec zip"

instead of:

   "find .. | zip ..."
2023-05-24 17:04:57 +02:00
Rolf Bjarne Kvinge cdac4507a2
[devops] Stop building test dependencies on each test run. (#18096)
Stop building the test dependencies on each test run, and instead use the archived test dependencies we have from the main build:

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

Building the test dependencies takes ~10 minutes for each test run, so this saves
about that time for each test run.
2023-05-15 18:41:49 +02:00
Rolf Bjarne Kvinge 35432b22b7
[tests] Package macOS tests even if only Mac Catalyst is enabled. (#18158)
We have tests to execute on macOS even if only Mac Catalyst is enabled,
so package those tests in that case as well.
2023-04-28 10:24:24 +02:00
Rolf Bjarne Kvinge 6c04f7621a
[tools] Update SdkVersions.cs after the latest Xcode 14.2 bump. (#17101)
* Update `SdkVersions.cs` after the latest Xcode 14.2 bump.
* Rename `[SdkVersions|ProductConstants].cs.in` to `[SdkVersions|ProductConstants].in.cs`.
  This way the autoformatter makes sure it's formatted correctly.
2022-12-21 17:44:27 +01:00
Rolf Bjarne Kvinge dc37be300e
Remove bitcode-related code, since bitcode is dead. (#16986) 2022-12-12 15:25:37 +01:00
Rolf Bjarne Kvinge cc5c1bb4bf
[tests] Adjust cecil-tests to not test 32-bit iOS assemblies unless 32-bit iOS architectures are enabled. (#16989) 2022-12-07 18:24:14 +01:00
Rolf Bjarne Kvinge 25e951691d
[tests] Only package macOS tests for enabled platforms. (#16434)
For instance don't build for Mac Catalyst if Mac Catalyst isn't enabled.
2022-10-25 07:54:58 +02:00
Rolf Bjarne Kvinge 9ab18236b8
[xharness] Fix path to mlaunch when using mlaunch from a .NET SDK pack. (#16361) 2022-10-18 08:04:13 +02:00
Rolf Bjarne Kvinge ad8cdb3f91
[msbuild] Build the solution with .NET. (#16304)
Hopefully this fixes some of the recurrent build problems where we'd fail to
restore nuget packages.

Ref: https://github.com/xamarin/maccore/issues/2620

I wasn't able to execute ilrepack.exe with .NET, so that continues to be
executed with mono.
2022-10-17 07:22:24 +02:00
Rolf Bjarne Kvinge e8c7805ddf
Remove part of the maccore logic. (#16181)
* Don't load maccore/mk/versions.mk anymore, which means we're not checking
  any subsequent dependencies listed in maccore. Note that we still need the
  maccore dependency itself for a little while longer.
* Remove some outdated testing code that called into maccore.
* Don't recurse into the maccore directory during make.
* Remove some code checking for ENABLE_XAMARIN that's not used anymore, in
  particular in xharness.
2022-09-30 09:30:12 +02:00
Rolf Bjarne Kvinge 6e49a6748a
[xharness] Find a different mlaunch if legacy Xamarin is disabled. (#15996) 2022-09-21 14:27:10 +02:00
Rolf Bjarne Kvinge 57ee60106b
[tests] We do not need qa-dependencies.zip anymore. (#15964)
This was used in the old Xamarin days.
2022-09-16 18:36:51 +02:00
Rolf Bjarne Kvinge d1ef85446d
Misc fixes to make the build more silent. (#15852) 2022-09-05 10:55:41 +02: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
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
Rolf Bjarne Kvinge a1d0b6eba9
Make our local .NET the default .NET for the build. (#15086)
Make our local .NET the default .NET (in the root's global.json), and then if
a directory wants to use the system .NET, then that directory would have to
opt-in (using its own global.json).

This way we don't have to copy global.json/NuGet.config files around to run
tests with the correct .NET setup.
2022-06-07 10:11:02 +02:00
Rolf Bjarne Kvinge 9c185e1fff
[msbuild] Ask ditto to thin native libraries according to the architectures we're targetting. Fixes #13081. (#14403)
Ask ditto to thin native libraries and frameworks when copying them to the app
bundle to remove slices for architectures we're not building for.

Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/13081.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-04-07 08:17:01 +02:00
Rolf Bjarne Kvinge 08978fa4b1
[dotnet] Rename hardcoded 'net6.0' to use a 'DOTNET_TFM' variable instead. (#14524)
This makes things easier for .NET 7.
2022-04-01 13:48:09 +02:00
Rolf Bjarne Kvinge dea5c1e812
[tests] Fix logic to make generator tests work with a system install. (#14497)
Fixes https://github.com/xamarin/maccore/issues/2549.
2022-03-30 21:36:09 +02:00
Rolf Bjarne Kvinge 0802e2c359
[tests] Store symlinks in zips. Fixes #xamarin/maccore@2548. (#14459)
Fixes https://github.com/xamarin/maccore/issues/2548.
2022-03-28 08:59:29 +02:00
Rolf Bjarne Kvinge e44d0fd047
[.NET] Rename several DOTNET6_* variables to to DOTNET_*. (#14463)
Also rename DOTNET_VERSION to SYSTEM_DOTNET_VERSION to make it clear what it's
referring to (and to not clash with DOTNET6_VERSION which has now been renamed
to DOTNET_VERSION).

.NET 7 is right around the corner.
2022-03-23 08:07:34 +01:00
Rolf Bjarne Kvinge e369f466f7
[dotnet] Rename the DOTNET6 make variable to DOTNET. (#14441)
This is the follow-up to where the DOTNET variable was renamed SYSTEM_DOTNET.
2022-03-21 15:56:57 +01:00
Rolf Bjarne Kvinge d3643414e7
[dotnet] Rename the DOTNET make variable to SYSTEM_DOTNET. (#14416)
This makes it line up with our other make variables (SYSTEM_MSBUILD,
SYSTEM_MONO, SYSTEM_CSC, etc.), and also prepares for removing the version
from the DOTNET6 variable (so that it becomes just DOTNET).
2022-03-17 10:26:59 +01:00
Rolf Bjarne Kvinge 2afb9fc40e
[tests] Print labels after each MSBuild test when running from the command line. (#14428)
The advantage of writing the label after each test is that the test result will also
be printed, which means it's possible to see if any tests failed during the test
run, as opposed to having to wait until the entire test run is completed (which can
take a while) to realize that pretty much every test failed with some silly mistake
which could have been quickly fixed before re-running the tests.
2022-03-17 10:12:32 +01:00